From cb9d57b4912b4a2be9f3237bd6ea50f8f1878616 Mon Sep 17 00:00:00 2001 From: DB <2502523450@qq.com> Date: Mon, 27 May 2024 15:15:26 +0800 Subject: [PATCH] =?UTF-8?q?1.1.2=EF=BC=9A=E9=87=8D=E6=9E=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE,=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BE=9D?= =?UTF-8?q?=E8=B5=96,=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB,=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=BB=A3=E7=A0=81,=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cpop-Api/pom.xml | 2 +- .../cloudDb/handler/CloudBrandHandler.java | 2 +- .../handler/CloudClassCardHandler.java | 18 +- .../cloudDb/handler/CloudClassHandler.java | 13 +- .../cloudDb/handler/CloudCourseHandler.java | 23 +- .../handler/CloudCustomerStudentHandler.java | 14 +- .../cloudDb/handler/CloudOrderHandler.java | 12 +- .../cloudDb/handler/CloudStaffHandler.java | 8 +- .../cloudDb/handler/CloudStoreHandler.java | 14 +- .../handler/TencentLocationHandler.java | 4 +- .../core/base/WxWorkApiWebHookSendBase.java | 2 +- .../wxWork/handler/WebHookSendHandler.java | 9 +- .../webHook/WebHookSendTextRequest.java | 2 +- Cpop-ClockIn-Demo/pom.xml | 2 +- .../service/impl/StaffClassesServiceImpl.java | 6 +- Cpop-Core/pom.xml | 32 +- .../core/aspect/SignatureCheckAspect.java | 12 +- .../aspect/SimpleSignatureCheckAspect.java | 20 +- .../entity/FastJson2JsonRedisSerializer.java | 3 - .../com/cpop/core/base/entity/PageDomain.java | 69 +- .../com/cpop/core/base/entity/Permission.java | 19 - .../com/cpop/core/base/enums/CycleEnum.java | 56 - .../core/base/exception/BaseException.java | 4 +- .../java/com/cpop/core/config/CpopConfig.java | 232 ++++ .../com/cpop/core/config/FilterConfig.java | 58 - .../core/config/GenerateKeyPairConfig.java | 38 - .../com/cpop/core/config/RedisConfig.java | 4 +- .../cpop/core/config/SaTokenConfigure.java | 136 ++ .../com/cpop/core/config/ServerConfig.java | 31 - .../com/cpop/core/constant/Constants.java | 71 ++ .../cpop/core/filter/RepeatableFilter.java | 25 +- .../core/filter/RepeatedlyRequestWrapper.java | 43 +- .../java/com/cpop/core/filter/XssFilter.java | 61 - .../filter/XssHttpServletRequestWrapper.java | 98 -- .../com/cpop/core/handler/UploadHandler.java | 247 ++++ .../json/ArrayToStringDeserializer.java | 4 +- .../java/com/cpop/core/utils/JsonUtils.java | 30 - .../java/com/cpop/core/utils/QuartzUtils.java | 29 +- .../java/com/cpop/core/utils/RsaUtils.java | 242 ---- .../com/cpop/core/utils/ServletUtils.java | 124 +- .../java/com/cpop/core/utils/SpringUtils.java | 44 +- .../java/com/cpop/core/utils/SqlUtils.java | 30 +- .../java/com/cpop/core/utils/StringUtils.java | 582 --------- .../com/cpop/core/utils/bean/BeanUtils.java | 193 --- .../cpop/core/utils/file/FileTypeUtils.java | 71 -- .../cpop/core/utils/file/FileUploadUtils.java | 209 --- .../com/cpop/core/utils/file/FileUtils.java | 310 ----- .../cpop/core/utils/file/MimeTypeUtils.java | 57 - .../com/cpop/core/utils/html/EscapeUtil.java | 133 -- .../com/cpop/core/utils/html/HTMLFilter.java | 499 -------- .../com/cpop/core/utils/http/HttpHelper.java | 51 - .../com/cpop/core/utils/http/HttpUtils.java | 376 ------ .../com/cpop/core/utils/ip/AddressUtils.java | 50 - .../java/com/cpop/core/utils/ip/IpUtils.java | 196 --- .../com/cpop/core/utils/text/CharsetKit.java | 91 -- .../com/cpop/core/utils/text/Convert.java | 854 ------------- .../cpop/core/utils/text/StrFormatter.java | 77 -- .../com/cpop/core/utils/uuid/IdUtils.java | 44 - .../java/com/cpop/core/utils/uuid/Seq.java | 92 -- .../java/com/cpop/core/utils/uuid/UUID.java | 447 ------- Cpop-Generator/pom.xml | 2 +- .../com/cpop/generator/CpopGenerator.java | 4 +- Cpop-Jambox/Cpop-Jambox-Web/pom.xml | 39 - .../jambox/web/CpopJamboxWebApplication.java | 20 - .../src/main/resources/application-dev.yml | 80 -- .../src/main/resources/application-prod.yml | 60 - .../src/main/resources/application-test.yml | 81 -- .../src/main/resources/application.yml | 118 -- .../resources/static/i18n/messages.properties | 0 .../static/i18n/messages_en_US.properties | 4 - .../static/i18n/messages_zh_CN.properties | 4 - .../web/CpopJamboxWebApplicationTests.java | 13 - Cpop-Jambox/pom.xml | 44 - Cpop-Jambox/sql/Jambox.sql | 93 -- Cpop-Jambox/sql/website.sql | 174 --- .../business/bo/CardTemplateUnionBo.java | 154 --- .../bo/EasyLearnDigitalCurrencyBo.java | 31 - .../business/bo/EasyLearnOldContractBo.java | 37 - .../jambox/business/bo/EasyLearnPageBo.java | 58 - .../business/bo/EasyLearnUnifiedPayBo.java | 89 -- .../business/bo/EasyLearnUnionPayBo.java | 97 -- .../bo/LearnNowPayLaterOncePayDto.java | 114 -- .../business/bo/LearnNowPayLaterPlanBo.java | 70 - .../bo/LearnNowPayLaterPlanDetailBo.java | 49 - .../bo/LearnNowPayLaterServiceOrderBo.java | 61 - .../LearnNowPayLaterStopUserSignPlansBo.java | 31 - .../bo/LearnNowPayLaterUserSignPlansBo.java | 77 -- .../jambox/business/bo/OncePlaceOrderBo.java | 83 -- .../com/cpop/jambox/business/bo/PlugBo.java | 67 - .../cpop/jambox/business/bo/UnionPayDto.java | 21 - .../BackstageBusinessDataController.java | 110 -- .../BackstageBusinessIntroController.java | 110 -- .../BackstageCompanyIntroController.java | 110 -- .../BackstageCooperationController.java | 113 -- .../BackstageCooperationTypeController.java | 112 -- .../BackstageDevelopmentController.java | 110 -- .../BackstageEasyLearnController.java | 128 -- .../BackstageNavigationController.java | 113 -- .../BackstageWebProductController.java | 110 -- .../backstage/EasyLearnController.java | 56 - .../callback/CallBackEasyLearnController.java | 90 -- .../callback/EasyLearnCallBackController.java | 52 - .../mini/MiniCardTemplateController.java | 97 -- .../mini/MiniEasyLearnController.java | 107 -- .../controller/website/WebsiteController.java | 121 -- .../jambox/business/dto/EasyLearnPageDto.java | 71 -- .../jambox/business/entity/BrandExtend.java | 53 - .../jambox/business/entity/CardTemplate.java | 129 -- .../business/entity/CardTemplateExtend.java | 62 - .../business/entity/EasyLearnOrder.java | 123 -- .../business/entity/EasyLearnOrderDetail.java | 96 -- .../business/entity/EasyLearnOrderExtend.java | 106 -- .../com/cpop/jambox/business/entity/Plug.java | 77 -- .../jambox/business/entity/StoreActive.java | 68 - .../jambox/business/entity/StoreExtend.java | 57 - .../jambox/business/entity/StorePlug.java | 45 - .../business/entity/website/BusinessData.java | 51 - .../entity/website/BusinessIntro.java | 54 - .../business/entity/website/CompanyIntro.java | 64 - .../business/entity/website/Cooperation.java | 63 - .../entity/website/CooperationType.java | 52 - .../business/entity/website/Development.java | 65 - .../business/entity/website/WebProduct.java | 59 - .../business/mapper/BrandExtendMapper.java | 14 - .../business/mapper/BusinessDataMapper.java | 14 - .../business/mapper/BusinessIntroMapper.java | 14 - .../mapper/CardTemplateExtendMapper.java | 14 - .../business/mapper/CardTemplateMapper.java | 14 - .../business/mapper/CompanyIntroMapper.java | 14 - .../business/mapper/CooperationMapper.java | 14 - .../mapper/CooperationTypeMapper.java | 14 - .../business/mapper/DevelopmentMapper.java | 35 - .../mapper/EasyLearnOrderDetailMapper.java | 14 - .../mapper/EasyLearnOrderExtendMapper.java | 14 - .../business/mapper/EasyLearnOrderMapper.java | 14 - .../jambox/business/mapper/PlugMapper.java | 14 - .../business/mapper/StoreActiveMapper.java | 14 - .../business/mapper/StoreExtendMapper.java | 14 - .../business/mapper/StorePlugMapper.java | 14 - .../business/mapper/WebProductMapper.java | 14 - .../business/service/BrandExtendService.java | 14 - .../business/service/BusinessDataService.java | 14 - .../service/BusinessIntroService.java | 14 - .../service/CardTemplateExtendService.java | 14 - .../business/service/CardTemplateService.java | 63 - .../business/service/CompanyIntroService.java | 14 - .../business/service/CooperationService.java | 36 - .../service/CooperationTypeService.java | 26 - .../business/service/DevelopmentService.java | 26 - .../service/EasyLearnOrderDetailService.java | 14 - .../service/EasyLearnOrderExtendService.java | 14 - .../service/EasyLearnOrderService.java | 138 -- .../jambox/business/service/PlugService.java | 40 - .../business/service/StoreActiveService.java | 14 - .../business/service/StoreExtendService.java | 14 - .../business/service/StorePlugService.java | 26 - .../business/service/WebProductService.java | 14 - .../business/service/WebsiteService.java | 55 - .../service/impl/BrandExtendServiceImpl.java | 18 - .../service/impl/BusinessDataServiceImpl.java | 18 - .../impl/BusinessIntroServiceImpl.java | 18 - .../impl/CardTemplateExtendServiceImpl.java | 18 - .../service/impl/CardTemplateServiceImpl.java | 359 ------ .../service/impl/CompanyIntroServiceImpl.java | 18 - .../service/impl/CooperationServiceImpl.java | 62 - .../impl/CooperationTypeServiceImpl.java | 46 - .../service/impl/DevelopmentServiceImpl.java | 41 - .../impl/EasyLearnOrderDetailServiceImpl.java | 18 - .../impl/EasyLearnOrderExtendServiceImpl.java | 18 - .../impl/EasyLearnOrderServiceImpl.java | 1123 ----------------- .../service/impl/NavigationServiceImpl.java | 47 - .../service/impl/PlugServiceImpl.java | 60 - .../service/impl/StoreActiveServiceImpl.java | 18 - .../service/impl/StoreExtendServiceImpl.java | 18 - .../service/impl/StorePlugServiceImpl.java | 70 - .../service/impl/WebProductServiceImpl.java | 18 - .../service/impl/WebsiteServiceImpl.java | 133 -- .../business/task/CardTemplateAsyncTask.java | 84 -- .../cpop/jambox/business/vo/BrandListVo.java | 40 - .../jambox/business/vo/BrandStaffPageVo.java | 73 -- .../business/vo/CampusListByBrandVo.java | 39 - .../cpop/jambox/business/vo/CampusPageVo.java | 96 -- .../business/vo/CardTemplateInfoVo.java | 135 -- .../business/vo/CardTemplateListVo.java | 99 -- .../jambox/business/vo/CompanyIntroVo.java | 21 - .../business/vo/CooperationPlatformVo.java | 24 - .../jambox/business/vo/CooperationTypeVo.java | 26 - .../jambox/business/vo/DevelopmentVo.java | 24 - .../jambox/business/vo/EasyLearnPageVo.java | 79 -- .../vo/LearnNowPayLaterPlanDetailVo.java | 55 - .../business/vo/LearnNowPayLaterPlanVo.java | 70 - .../cpop/jambox/business/vo/NavigationVo.java | 28 - .../cpop/jambox/business/vo/PlugPageVo.java | 59 - .../com/cpop/jambox/business/vo/PlugVo.java | 60 - .../jambox/business/vo/StorePlugListVo.java | 77 -- .../framework/constant/JamboxCloudUrl.java | 22 - .../constant/JamboxRedisConstant.java | 25 - .../framework/enums/EasyLearnPayPayEnum.java | 76 -- .../framework/tasks/LearnNowPayLaterTask.java | 124 -- .../src/main/resources/application-jambox.yml | 8 - .../resources/mapper/BrandExtendMapper.xml | 7 - .../resources/mapper/BusinessDataMapper.xml | 7 - .../resources/mapper/BusinessIntroMapper.xml | 7 - .../mapper/CardTemplateExtendMapper.xml | 7 - .../resources/mapper/CardTemplateMapper.xml | 7 - .../resources/mapper/CompanyIntroMapper.xml | 7 - .../resources/mapper/CooperationMapper.xml | 7 - .../mapper/CooperationTypeMapper.xml | 7 - .../resources/mapper/DevelopmentMapper.xml | 30 - .../mapper/EasyLearnOrderDetailMapper.xml | 7 - .../mapper/EasyLearnOrderExtendMapper.xml | 7 - .../resources/mapper/EasyLearnOrderMapper.xml | 7 - .../resources/mapper/NavigationMapper.xml | 7 - .../src/main/resources/mapper/PlugMapper.xml | 7 - .../resources/mapper/StoreActiveMapper.xml | 7 - .../resources/mapper/StoreExtendMapper.xml | 7 - .../main/resources/mapper/StorePlugMapper.xml | 7 - .../resources/mapper/WebProductMapper.xml | 7 - .../Cpop-Mall-Web/Mall-DockerD-Dockerfile | 5 - Cpop-Mall/Cpop-Mall-Web/pom.xml | 41 - .../cpop/mall/web/CpopMallWebApplication.java | 20 - .../src/main/resources/application-dev.yml | 123 -- .../main/resources/application-dockerD.yml | 123 -- .../src/main/resources/application-local.yml | 107 -- .../src/main/resources/application-prod.yml | 88 -- .../src/main/resources/application-test.yml | 118 -- .../src/main/resources/application.yml | 142 --- .../src/main/resources/logback.xml | 102 -- .../resources/static/i18n/messages.properties | 0 .../static/i18n/messages_en_US.properties | 29 - .../static/i18n/messages_zh_CN.properties | 29 - .../mall/web/CpopMallWebApplicationTests.java | 51 - .../cpop/mall/web/CpopMiniUserSyncTests.java | 24 - .../com/cpop/mall/web/CpopWxPayTests.java | 196 --- Cpop-Mall/pom.xml | 48 - .../cpop/mall/business/bo/AdvanceOrderBo.java | 72 -- .../com/cpop/mall/business/bo/CarouselBo.java | 55 - .../mall/business/bo/LogisticsOrderBo.java | 34 - .../com/cpop/mall/business/bo/MallRoleBo.java | 82 -- .../cpop/mall/business/bo/MallRolePageBo.java | 33 - .../business/bo/ModifyUserPasswordBo.java | 44 - .../mall/business/bo/OrderApplyRefundBo.java | 41 - .../cpop/mall/business/bo/OrderDetailBo.java | 55 - .../mall/business/bo/OrderEvaluateBo.java | 54 - .../cpop/mall/business/bo/OrderPageBo.java | 43 - .../mall/business/bo/OrderRefundPageBo.java | 43 - .../mall/business/bo/OrderRejectRefundBo.java | 34 - .../cpop/mall/business/bo/PlaceOrderBo.java | 63 - .../com/cpop/mall/business/bo/ProductBo.java | 115 -- .../cpop/mall/business/bo/ProductPageBo.java | 70 - .../mall/business/bo/ProductRecordBo.java | 58 - .../business/bo/ProductSpecificationBo.java | 42 - .../cpop/mall/business/bo/ShoppingCartBo.java | 58 - .../mall/business/bo/ShoppingCartPageBo.java | 25 - .../com/cpop/mall/business/bo/StaffBo.java | 117 -- .../cpop/mall/business/bo/StaffPageBo.java | 27 - .../BackstageCarouselController.java | 132 -- .../BackstageMallRoleController.java | 126 -- .../backstage/BackstageOrderController.java | 107 -- .../BackstageOrderRefundController.java | 71 -- .../backstage/BackstageProductController.java | 204 --- .../backstage/BackstageStaffController.java | 197 --- .../callback/CallbackWxPayController.java | 53 - .../callback/WxPayCallbackController.java | 54 - .../controller/mini/MiniBrandController.java | 52 - .../controller/mini/MiniOrderController.java | 149 --- .../mini/MiniProductController.java | 141 --- .../mini/MiniShoppingCartController.java | 73 -- .../business/dto/ProductAndRecordDto.java | 33 - .../cpop/mall/business/dto/UserPointDto.java | 27 - .../cpop/mall/business/entity/Carousel.java | 74 -- .../com/cpop/mall/business/entity/Order.java | 127 -- .../mall/business/entity/OrderDetail.java | 68 - .../mall/business/entity/OrderEvaluate.java | 63 - .../mall/business/entity/OrderRefund.java | 73 -- .../cpop/mall/business/entity/Product.java | 119 -- .../cpop/mall/business/entity/ProductOut.java | 40 - .../mall/business/entity/ProductRecord.java | 73 -- .../business/entity/ProductSpecification.java | 51 - .../cpop/mall/business/entity/RoleBrand.java | 44 - .../mall/business/entity/ShoppingCart.java | 68 - .../com/cpop/mall/business/entity/Staff.java | 61 - .../mall/business/mapper/CarouselMapper.java | 14 - .../business/mapper/OrderDetailMapper.java | 14 - .../business/mapper/OrderEvaluateMapper.java | 14 - .../mall/business/mapper/OrderMapper.java | 14 - .../business/mapper/OrderRefundMapper.java | 14 - .../mall/business/mapper/ProductMapper.java | 14 - .../business/mapper/ProductOutMapper.java | 14 - .../business/mapper/ProductRecordMapper.java | 14 - .../mapper/ProductSpecificationMapper.java | 14 - .../mall/business/mapper/RoleBrandMapper.java | 14 - .../business/mapper/ShoppingCartMapper.java | 14 - .../mall/business/mapper/StaffMapper.java | 14 - .../business/service/CarouselService.java | 41 - .../business/service/OrderDetailService.java | 14 - .../service/OrderEvaluateService.java | 14 - .../business/service/OrderRefundService.java | 53 - .../mall/business/service/OrderService.java | 115 -- .../business/service/ProductOutService.java | 14 - .../service/ProductRecordService.java | 14 - .../mall/business/service/ProductService.java | 118 -- .../service/ProductSpecificationService.java | 14 - .../business/service/RoleBrandService.java | 63 - .../business/service/ShoppingCartService.java | 35 - .../mall/business/service/StaffService.java | 83 -- .../service/impl/CarouselServiceImpl.java | 78 -- .../service/impl/OrderDetailServiceImpl.java | 18 - .../impl/OrderEvaluateServiceImpl.java | 18 - .../service/impl/OrderRefundServiceImpl.java | 223 ---- .../service/impl/OrderServiceImpl.java | 705 ----------- .../service/impl/ProductOutServiceImpl.java | 18 - .../impl/ProductRecordServiceImpl.java | 18 - .../service/impl/ProductServiceImpl.java | 479 ------- .../impl/ProductSpecificationServiceImpl.java | 18 - .../service/impl/RoleBrandServiceImpl.java | 182 --- .../service/impl/ShoppingCartServiceImpl.java | 88 -- .../service/impl/StaffServiceImpl.java | 314 ----- .../cpop/mall/business/vo/BrandListVo.java | 32 - .../cpop/mall/business/vo/CarouselListVo.java | 41 - .../cpop/mall/business/vo/CarouselPageVo.java | 54 - .../business/vo/JamboxCardTemplateListVo.java | 31 - .../cpop/mall/business/vo/MallRolePageVo.java | 82 -- .../mall/business/vo/MiniProductPageVo.java | 111 -- .../business/vo/MiniShoppingCartPageVo.java | 120 -- .../cpop/mall/business/vo/OrderDetailVo.java | 80 -- .../cpop/mall/business/vo/OrderInfoVo.java | 103 -- .../cpop/mall/business/vo/OrderPageVo.java | 132 -- .../mall/business/vo/OrderRefundPageVo.java | 137 -- .../cpop/mall/business/vo/OrderRefundVo.java | 62 - .../mall/business/vo/ProductEvaluateVo.java | 59 - .../cpop/mall/business/vo/ProductInfoVo.java | 132 -- .../cpop/mall/business/vo/ProductPageVo.java | 153 --- .../mall/business/vo/ProductRecordVo.java | 65 - .../mall/business/vo/ProductSimpleVo.java | 25 - .../vo/ProductSpecificationCreateVo.java | 46 - .../business/vo/ProductSpecificationVo.java | 40 - .../cpop/mall/business/vo/StaffInfoVo.java | 88 -- .../cpop/mall/business/vo/StaffPageVo.java | 126 -- .../cpop/mall/business/vo/StoreListVo.java | 35 - .../framework/constant/MallRedisConstant.java | 22 - .../framework/enums/BuyRestrictEnums.java | 75 -- .../mall/framework/enums/QuartzEnums.java | 35 - .../buyRestrict/BuyRestrictStrategy.java | 19 - .../buyRestrict/MemberRestrictStrategy.java | 63 - .../NewCustomerRestrictStrategy.java | 44 - .../buyRestrict/UserRestrictStrategy.java | 65 - .../framework/task/OrderDetailAsyncTask.java | 90 -- .../task/OrderOverTimeUnPayTask.java | 49 - .../task/ProductRecordSyncStockTask.java | 86 -- .../framework/task/ShoppingCartAsyncTask.java | 69 - .../src/main/resources/application-mall.yml | 1 - .../resources/mapper/OrderDetailMapper.xml | 7 - .../resources/mapper/OrderEvaluateMapper.xml | 7 - .../src/main/resources/mapper/OrderMapper.xml | 7 - .../resources/mapper/OrderRefundMapper.xml | 7 - .../main/resources/mapper/ProductMapper.xml | 7 - .../resources/mapper/ProductOutMapper.xml | 7 - .../resources/mapper/ProductRecordMapper.xml | 7 - .../mapper/ProductSpecificationMapper.xml | 7 - .../resources/mapper/ShoppingCartMapper.xml | 7 - .../src/main/resources/mapper/StaffMapper.xml | 7 - Cpop-Mini/pom.xml | 35 - .../mini/business/entity/MiniUserMidSys.java | 40 - .../mini/business/mapper/MiniUserMapper.java | 14 - .../business/mapper/MiniUserMidSysMapper.java | 14 - .../service/MiniUserMidSysService.java | 14 - .../business/service/MiniUserService.java | 14 - .../impl/MiniUserMidSysServiceImpl.java | 18 - .../service/impl/MiniUserServiceImpl.java | 18 - .../src/main/resources/application-mini.yml | 1 - .../main/resources/mapper/MiniUserMapper.xml | 7 - .../resources/mapper/MiniUserMidSysMapper.xml | 7 - Cpop-Oam/Cpop-Oam-Web/pom.xml | 2 +- .../java/com/cpop/oam/web/CpopApiTests.java | 15 +- .../com/cpop/oam/web/CpopCloudDbTests.java | 4 +- .../oam/web/CpopEasyLearnDataAnalyseTest.java | 2 +- Cpop-Oam/pom.xml | 2 +- .../java/com/cpop/oam/business/bo/DutyBo.java | 5 +- .../cpop/oam/business/bo/NavigationBo.java | 40 + .../BackstageDictDataController.java | 4 +- .../BackstageDictTypeController.java | 6 +- .../backstage/BackstageDutyController.java | 2 + .../BackstageFinanceReimburseController.java | 8 +- .../backstage/BackstageLoginController.java | 3 +- .../BackstageNavigationController.java | 92 ++ .../BackstageSignGoalController.java | 8 +- .../BackstageSysCommonController.java | 10 +- .../BackstageTechnologyToolController.java | 8 +- .../backstage/BackstageWxOpenController.java | 86 +- .../callback/CallbackWxCpController.java | 8 +- .../callback/CallbackWxOpenController.java | 16 +- .../cpop/oam/business/entity}/Navigation.java | 10 +- .../cpop/oam/business/entity/WebMapData.java | 44 +- .../business/mapper/NavigationMapper.java | 4 +- .../oam/business/mapper/WebMapDataMapper.java | 12 + .../business/service/NavigationService.java | 6 +- .../business/service/WebMapDataService.java | 12 + .../service/impl/BrandManagerServiceImpl.java | 2 +- .../service/impl/BusinessServiceImpl.java | 20 +- .../service/impl/CluePutOffServiceImpl.java | 4 +- .../service/impl/ClueServiceImpl.java | 57 +- .../service/impl/CommonServiceImpl.java | 10 +- .../service/impl/DataImportServiceImpl.java | 56 +- .../service/impl/DeptServiceImpl.java | 14 +- .../service/impl/DictDataServiceImpl.java | 22 +- .../service/impl/DictTypeServiceImpl.java | 14 +- .../service/impl/DutyServiceImpl.java | 26 +- .../impl/FinanceReimburseServiceImpl.java | 14 +- .../service/impl/LoginServiceImpl.java | 11 +- .../service/impl/MenuServiceImpl.java | 36 +- .../service/impl/NavigationServiceImpl.java | 35 + .../service/impl/OamWxCpServiceImpl.java | 21 +- .../service/impl/RoleServiceImpl.java | 23 +- .../service/impl/SignGoalServiceImpl.java | 14 +- .../service/impl/StaffServiceImpl.java | 40 +- .../service/impl/TaskDemandServiceImpl.java | 23 +- .../service/impl/TaskServiceImpl.java | 42 +- .../impl/TaskStaffGroupServiceImpl.java | 16 +- .../impl/TaskWorkOrderServiceImpl.java | 45 +- .../service/impl/WebMapDataServiceImpl.java | 17 + .../service/impl/WxOpenMiniServiceImpl.java | 4 +- .../cpop/oam/business/vo/NavigationVo.java | 45 + .../cpop/oam/business/vo/WebItemStyleVo.java | 19 + .../oam/business/vo/WebMapRegionDataVo.java | 48 + .../cpop/oam/business/vo/WxOpenMiniVo.java | 2 +- .../framework/config/SaTokenConfigure.java | 100 -- .../framework/config/wxCp/WxCpProperties.java | 4 +- .../config/wxOpen/WxOpenRedisProperties.java | 4 +- .../oam/framework/enums/OamConfigEnum.java | 7 +- .../handler/tencentCos/TencentCosHandler.java | 47 +- .../handler/wxCp/ContactChangeHandler.java | 4 +- .../framework/handler/wxCp/LogHandler.java | 4 +- .../framework/handler/wxCp/MsgHandler.java | 4 +- .../framework/tasks/OamScheduledTasks.java | 11 +- .../cpop/oam/framework/utils/DictUtils.java | 10 +- .../src/main/resources/WebMapDataMapper.xml | 4 +- .../resources/{ => mapper}/DictDataMapper.xml | 0 .../resources/{ => mapper}/DictTypeMapper.xml | 0 .../resources/mapper/NavigationMapper.xml | 2 +- Cpop-Pay/pom.xml | 2 +- .../config/ecpp/EcppConfiguration.java | 78 +- .../config/wxPay/WxPayConfiguration.java | 15 +- .../dto/easyLearn/WxPayGoodsDetailDto.java | 2 +- .../ecpp/EcppCustomerVerifyRequest.java | 2 +- .../ecpp/EcppLogoutReturnCardRequest.java | 2 +- .../request/ecpp/EcppSigningQueryRequest.java | 2 +- .../core/request/ecpp/EcppSmsCodeRequest.java | 2 +- .../request/ecpp/EcppTradeListRequest.java | 2 +- .../ecpp/EcppWriteOffConfirmRequest.java | 2 +- .../ecpp/EcppWriteOffQueryRequest.java | 2 +- .../core/response/ecpp/EcppBaseResponse.java | 71 ++ .../ecpp/EcppLogoutReturnCardResponse.java | 2 +- .../ecpp/EcppServiceRecordResponse.java | 2 +- .../ecpp/EcppSigningQueryResponse.java | 2 +- .../response/ecpp/EcppSmsCodeResponse.java | 3 +- .../ecpp/EcppTradeRecordResponse.java | 2 +- .../ecpp/EcppWriteOffConfirmResponse.java | 2 +- .../ecpp/EcppWriteOffQueryResponse.java | 2 +- .../framewok/handler/ecpp/EcppHandler.java | 34 +- Cpop-System/pom.xml | 2 +- .../backstage/BackstageBrandController.java | 4 +- .../service/impl/BrandServiceImpl.java | 8 +- .../service/impl/StoreServiceImpl.java | 19 +- .../service/impl/StoreSignServiceImpl.java | 10 +- pom.xml | 63 +- 466 files changed, 2019 insertions(+), 25085 deletions(-) delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/base/entity/Permission.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/base/enums/CycleEnum.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/config/GenerateKeyPairConfig.java create mode 100644 Cpop-Core/src/main/java/com/cpop/core/config/SaTokenConfigure.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/config/ServerConfig.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/filter/XssFilter.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/filter/XssHttpServletRequestWrapper.java create mode 100644 Cpop-Core/src/main/java/com/cpop/core/handler/UploadHandler.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/JsonUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/RsaUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/StringUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/bean/BeanUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/file/FileTypeUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUploadUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/file/MimeTypeUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/html/EscapeUtil.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/html/HTMLFilter.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpHelper.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/ip/AddressUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/ip/IpUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/text/CharsetKit.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/text/Convert.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/text/StrFormatter.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/uuid/IdUtils.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/uuid/Seq.java delete mode 100644 Cpop-Core/src/main/java/com/cpop/core/utils/uuid/UUID.java delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/pom.xml delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/java/com/cpop/jambox/web/CpopJamboxWebApplication.java delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-dev.yml delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-prod.yml delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-test.yml delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application.yml delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages.properties delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_en_US.properties delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_zh_CN.properties delete mode 100644 Cpop-Jambox/Cpop-Jambox-Web/src/test/java/com/cpop/jambox/web/CpopJamboxWebApplicationTests.java delete mode 100644 Cpop-Jambox/pom.xml delete mode 100644 Cpop-Jambox/sql/Jambox.sql delete mode 100644 Cpop-Jambox/sql/website.sql delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnDigitalCurrencyBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnOldContractBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnPageBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnifiedPayBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnionPayBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterOncePayDto.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanDetailBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterServiceOrderBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterStopUserSignPlansBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterUserSignPlansBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/PlugBo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/UnionPayDto.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessDataController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessIntroController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCompanyIntroController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationTypeController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageDevelopmentController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageEasyLearnController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageNavigationController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageWebProductController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/CallBackEasyLearnController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniCardTemplateController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniEasyLearnController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/website/WebsiteController.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/dto/EasyLearnPageDto.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandExtend.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplate.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplateExtend.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderDetail.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderExtend.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Plug.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreActive.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreExtend.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StorePlug.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessIntro.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CompanyIntro.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Cooperation.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CooperationType.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Development.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/WebProduct.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandExtendMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessDataMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessIntroMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateExtendMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CompanyIntroMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationTypeMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/DevelopmentMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderDetailMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderExtendMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/PlugMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreActiveMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreExtendMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StorePlugMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/WebProductMapper.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandExtendService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessDataService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessIntroService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateExtendService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CompanyIntroService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationTypeService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/DevelopmentService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderDetailService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderExtendService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/PlugService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreActiveService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreExtendService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StorePlugService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebProductService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebsiteService.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandExtendServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessDataServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessIntroServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateExtendServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CompanyIntroServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationTypeServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/DevelopmentServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderDetailServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderExtendServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/NavigationServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/PlugServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreActiveServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreExtendServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StorePlugServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebProductServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebsiteServiceImpl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/task/CardTemplateAsyncTask.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandListVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandStaffPageVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusListByBrandVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusPageVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateInfoVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateListVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CompanyIntroVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationPlatformVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationTypeVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/DevelopmentVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/EasyLearnPageVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanDetailVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/NavigationVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugPageVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/StorePlugListVo.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxCloudUrl.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxRedisConstant.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/framework/enums/EasyLearnPayPayEnum.java delete mode 100644 Cpop-Jambox/src/main/java/com/cpop/jambox/framework/tasks/LearnNowPayLaterTask.java delete mode 100644 Cpop-Jambox/src/main/resources/application-jambox.yml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/BrandExtendMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/BusinessDataMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/BusinessIntroMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/CardTemplateExtendMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/CardTemplateMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/CompanyIntroMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/CooperationMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/CooperationTypeMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/DevelopmentMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderDetailMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderExtendMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/NavigationMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/PlugMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/StoreActiveMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/StoreExtendMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/StorePlugMapper.xml delete mode 100644 Cpop-Jambox/src/main/resources/mapper/WebProductMapper.xml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile delete mode 100644 Cpop-Mall/Cpop-Mall-Web/pom.xml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dockerD.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-local.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/logback.xml delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMiniUserSyncTests.java delete mode 100644 Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java delete mode 100644 Cpop-Mall/pom.xml delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/AdvanceOrderBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/CarouselBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/LogisticsOrderBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRoleBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRolePageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ModifyUserPasswordBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderApplyRefundBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderDetailBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderEvaluateBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderPageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRejectRefundBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductRecordBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductSpecificationBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartPageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffPageBo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageCarouselController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageStaffController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/CallbackWxPayController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniBrandController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniProductController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniShoppingCartController.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/dto/ProductAndRecordDto.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/dto/UserPointDto.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Carousel.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Order.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderDetail.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderEvaluate.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderRefund.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Product.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductOut.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductRecord.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductSpecification.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/RoleBrand.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ShoppingCart.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Staff.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/CarouselMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderDetailMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderEvaluateMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderRefundMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductOutMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductRecordMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductSpecificationMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/RoleBrandMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ShoppingCartMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/StaffMapper.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/CarouselService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderDetailService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderEvaluateService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderRefundService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductOutService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductRecordService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductSpecificationService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/RoleBrandService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/ShoppingCartService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/StaffService.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/CarouselServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderDetailServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderEvaluateServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderRefundServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductOutServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductRecordServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductSpecificationServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/RoleBrandServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ShoppingCartServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/StaffServiceImpl.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/BrandListVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselListVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/JamboxCardTemplateListVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MallRolePageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniProductPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniShoppingCartPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderDetailVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderInfoVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductEvaluateVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductInfoVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductRecordVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSimpleVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationCreateVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffInfoVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffPageVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StoreListVo.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/constant/MallRedisConstant.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/BuyRestrictEnums.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/QuartzEnums.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/BuyRestrictStrategy.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/MemberRestrictStrategy.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/NewCustomerRestrictStrategy.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/UserRestrictStrategy.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderDetailAsyncTask.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderOverTimeUnPayTask.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ProductRecordSyncStockTask.java delete mode 100644 Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ShoppingCartAsyncTask.java delete mode 100644 Cpop-Mall/src/main/resources/application-mall.yml delete mode 100644 Cpop-Mall/src/main/resources/mapper/OrderDetailMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/OrderEvaluateMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/OrderMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/OrderRefundMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/ProductMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/ProductOutMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/ProductRecordMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/ProductSpecificationMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/ShoppingCartMapper.xml delete mode 100644 Cpop-Mall/src/main/resources/mapper/StaffMapper.xml delete mode 100644 Cpop-Mini/pom.xml delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMapper.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMidSysMapper.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserMidSysService.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserService.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserMidSysServiceImpl.java delete mode 100644 Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserServiceImpl.java delete mode 100644 Cpop-Mini/src/main/resources/application-mini.yml delete mode 100644 Cpop-Mini/src/main/resources/mapper/MiniUserMapper.xml delete mode 100644 Cpop-Mini/src/main/resources/mapper/MiniUserMidSysMapper.xml create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/bo/NavigationBo.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageNavigationController.java rename {Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website => Cpop-Oam/src/main/java/com/cpop/oam/business/entity}/Navigation.java (95%) rename Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUser.java => Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WebMapData.java (52%) rename {Cpop-Jambox/src/main/java/com/cpop/jambox => Cpop-Oam/src/main/java/com/cpop/oam}/business/mapper/NavigationMapper.java (67%) create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/WebMapDataMapper.java rename {Cpop-Jambox/src/main/java/com/cpop/jambox => Cpop-Oam/src/main/java/com/cpop/oam}/business/service/NavigationService.java (76%) create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/service/WebMapDataService.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/NavigationServiceImpl.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WebMapDataServiceImpl.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/vo/NavigationVo.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebItemStyleVo.java create mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebMapRegionDataVo.java delete mode 100644 Cpop-Oam/src/main/java/com/cpop/oam/framework/config/SaTokenConfigure.java rename Cpop-Mall/src/main/resources/mapper/CarouselMapper.xml => Cpop-Oam/src/main/resources/WebMapDataMapper.xml (68%) rename Cpop-Oam/src/main/resources/{ => mapper}/DictDataMapper.xml (100%) rename Cpop-Oam/src/main/resources/{ => mapper}/DictTypeMapper.xml (100%) rename Cpop-Mall/src/main/resources/mapper/RoleBrandMapper.xml => Cpop-Oam/src/main/resources/mapper/NavigationMapper.xml (73%) create mode 100644 Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppBaseResponse.java diff --git a/Cpop-Api/pom.xml b/Cpop-Api/pom.xml index 0ee3aaf..698e160 100644 --- a/Cpop-Api/pom.xml +++ b/Cpop-Api/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-Api diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudBrandHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudBrandHandler.java index f5046c8..afbf509 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudBrandHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudBrandHandler.java @@ -1,6 +1,6 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudBrandDto; import com.cpop.core.base.exception.UtilException; diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassCardHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassCardHandler.java index 9438d2a..cada8a2 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassCardHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassCardHandler.java @@ -1,10 +1,10 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudClassCardDto; import com.cpop.api.cloudDb.core.dto.CloudClassCardRecordDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.entity.ExtendPage; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.exception.UtilException; @@ -50,17 +50,17 @@ public class CloudClassCardHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(customerId)) { + if (StrUtil.isNotBlank(customerId)) { jsonBody.put("customerId", customerId); } - if (StringUtils.isNotBlank(cardId)) { + if (StrUtil.isNotBlank(cardId)) { jsonBody.put("cardId", cardId); } - if (StringUtils.isNotBlank(cardType)) { + if (StrUtil.isNotBlank(cardType)) { jsonBody.put("cardType", cardType); } if (cardStatus != null) { @@ -111,14 +111,14 @@ public class CloudClassCardHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(customerId)) { + if (StrUtil.isNotBlank(customerId)) { jsonBody.put("customerId", customerId); } - if (StringUtils.isNotBlank(cardId)) { + if (StrUtil.isNotBlank(cardId)) { jsonBody.put("cardId", cardId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassHandler.java index 371bb00..fa7ce81 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudClassHandler.java @@ -1,11 +1,10 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudClassDto; import com.cpop.api.cloudDb.core.dto.CloudClassStudentDto; -import com.cpop.api.cloudDb.core.dto.CloudCourseDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.exception.UtilException; import com.mybatisflex.core.paginate.Page; import org.springframework.beans.factory.annotation.Autowired; @@ -45,11 +44,11 @@ public class CloudClassHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(classId)){ + if (StrUtil.isNotBlank(classId)){ jsonBody.put("classId", classId); } //校区id @@ -90,11 +89,11 @@ public class CloudClassHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(classId)){ + if (StrUtil.isNotBlank(classId)){ jsonBody.put("classId", classId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCourseHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCourseHandler.java index 84b67b0..50838cc 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCourseHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCourseHandler.java @@ -1,10 +1,10 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudCourseDto; import com.cpop.api.cloudDb.core.dto.CloudCourseStudentListDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.exception.UtilException; import com.mybatisflex.core.paginate.Page; import lombok.extern.slf4j.Slf4j; @@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import java.util.ArrayList; import java.util.List; /** @@ -48,14 +47,14 @@ public class CloudCourseHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(courseId)){ + if (StrUtil.isNotBlank(courseId)){ jsonBody.put("courseId", courseId); } - if (StringUtils.isNotBlank(classId)) { + if (StrUtil.isNotBlank(classId)) { jsonBody.put("classId", classId); } //校区id @@ -95,23 +94,23 @@ public class CloudCourseHandler { JSONObject jsonBody = new JSONObject(); jsonBody.put("_type", "courseStudent"); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(courseId)){ + if (StrUtil.isNotBlank(courseId)){ jsonBody.put("courseId", courseId); } - if (StringUtils.isNotBlank(customerId)){ + if (StrUtil.isNotBlank(customerId)){ jsonBody.put("customerId", customerId); } - if (StringUtils.isNotBlank(studentId)){ + if (StrUtil.isNotBlank(studentId)){ jsonBody.put("studentId", studentId); } - if (StringUtils.isNotBlank(cardId)){ + if (StrUtil.isNotBlank(cardId)){ jsonBody.put("cardId", cardId); } - if (StringUtils.isNotBlank(classId)){ + if (StrUtil.isNotBlank(classId)){ jsonBody.put("classId", classId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java index 8ffd03e..eac0770 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudCustomerStudentHandler.java @@ -1,10 +1,10 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudCustomerDto; import com.cpop.api.cloudDb.core.dto.CloudStudentDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.exception.UtilException; import com.mybatisflex.core.paginate.Page; import lombok.extern.slf4j.Slf4j; @@ -46,11 +46,11 @@ public class CloudCustomerStudentHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(customerId)){ + if (StrUtil.isNotBlank(customerId)){ jsonBody.put("customerId", customerId); } //校区id @@ -92,14 +92,14 @@ public class CloudCustomerStudentHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(customerId)) { + if (StrUtil.isNotBlank(customerId)) { jsonBody.put("customerId", customerId); } - if (StringUtils.isNotBlank(studentId)) { + if (StrUtil.isNotBlank(studentId)) { jsonBody.put("studentId", studentId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudOrderHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudOrderHandler.java index 7537a26..4c79859 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudOrderHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudOrderHandler.java @@ -1,9 +1,9 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudOrderDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.entity.ExtendPage; import com.cpop.core.base.exception.UtilException; import com.mybatisflex.core.paginate.Page; @@ -48,17 +48,17 @@ public class CloudOrderHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(customerId)) { + if (StrUtil.isNotBlank(customerId)) { jsonBody.put("customerId", customerId); } - if (StringUtils.isNotBlank(cardId)) { + if (StrUtil.isNotBlank(cardId)) { jsonBody.put("cardId", cardId); } - if (StringUtils.isNotBlank(orderId)) { + if (StrUtil.isNotBlank(orderId)) { jsonBody.put("ticketId", orderId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStaffHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStaffHandler.java index 1a2976c..4d51ec3 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStaffHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStaffHandler.java @@ -1,9 +1,9 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudStaffDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.exception.UtilException; import com.mybatisflex.core.paginate.Page; import org.springframework.beans.factory.annotation.Autowired; @@ -43,11 +43,11 @@ public class CloudStaffHandler { jsonBody.put("page", pageNum); jsonBody.put("limit", pageSize); //开始日期结束日期 - if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) { + if (StrUtil.isNotBlank(startDate) && StrUtil.isNotBlank(endDate)) { jsonBody.put("startTime", startDate); jsonBody.put("endTime", endDate); } - if (StringUtils.isNotBlank(staffId)){ + if (StrUtil.isNotBlank(staffId)){ jsonBody.put("staffId", staffId); } //校区id diff --git a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStoreHandler.java b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStoreHandler.java index a538dcb..291b0e6 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStoreHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/cloudDb/handler/CloudStoreHandler.java @@ -1,10 +1,10 @@ package com.cpop.api.cloudDb.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.api.cloudDb.core.dto.CloudStoreActiveDto; import com.cpop.api.cloudDb.core.dto.CloudStoreDto; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.exception.UtilException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -35,19 +35,19 @@ public class CloudStoreHandler { jsonBody.put("_type", "storeEdit"); //云校区id jsonBody.put("storeId", dto.getStoreCloudId()); - if (StringUtils.isNotBlank(dto.getBrandCloudId())) { + if (StrUtil.isNotBlank(dto.getBrandCloudId())) { jsonBody.put("brandId", dto.getBrandCloudId()); } - if (StringUtils.isNotBlank(dto.getStoreName())) { + if (StrUtil.isNotBlank(dto.getStoreName())) { jsonBody.put("name", dto.getStoreName()); } - if (StringUtils.isNotBlank(dto.getPersonCharge())) { + if (StrUtil.isNotBlank(dto.getPersonCharge())) { jsonBody.put("principalName", dto.getPersonCharge()); } - if (StringUtils.isNotBlank(dto.getPhone())) { + if (StrUtil.isNotBlank(dto.getPhone())) { jsonBody.put("phone", dto.getPhone()); } - if (StringUtils.isNotBlank(dto.getStoreAddr())) { + if (StrUtil.isNotBlank(dto.getStoreAddr())) { jsonBody.put("address", dto.getStoreAddr()); } JSONObject jsonObject = restTemplate.postForObject(CloudDbUrl.COMMON_USE_URL, jsonBody, JSONObject.class); diff --git a/Cpop-Api/src/main/java/com/cpop/api/tencent/location/handler/TencentLocationHandler.java b/Cpop-Api/src/main/java/com/cpop/api/tencent/location/handler/TencentLocationHandler.java index 18ba3a8..3986321 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/tencent/location/handler/TencentLocationHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/tencent/location/handler/TencentLocationHandler.java @@ -1,13 +1,11 @@ package com.cpop.api.tencent.location.handler; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.tencent.location.core.constant.TencentApiUrl; import com.cpop.core.utils.SpringUtils; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import java.io.IOException; - /** * 腾讯位置服务工具类 * @author DB diff --git a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/core/base/WxWorkApiWebHookSendBase.java b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/core/base/WxWorkApiWebHookSendBase.java index 0215a0a..0a1970f 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/core/base/WxWorkApiWebHookSendBase.java +++ b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/core/base/WxWorkApiWebHookSendBase.java @@ -1,6 +1,6 @@ package com.cpop.api.tencent.wxWork.core.base; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; /** diff --git a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/handler/WebHookSendHandler.java b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/handler/WebHookSendHandler.java index bab80f0..44461ee 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/handler/WebHookSendHandler.java +++ b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/handler/WebHookSendHandler.java @@ -1,10 +1,10 @@ package com.cpop.api.tencent.wxWork.handler; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.tencent.wxWork.core.config.WxWorkApiConfig; import com.cpop.api.tencent.wxWork.webHook.WebHookSendTextRequest; -import com.cpop.core.utils.http.HttpUtils; -import okhttp3.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -39,9 +39,8 @@ public class WebHookSendHandler { text.setContent(content); text.setMentionedMobileList(phoneList); request.setText(text); - Response response = HttpUtils.sendOkHttpPost(config.getWebhook() + key, JSONObject.toJSONString(request)); + HttpResponse response = HttpRequest.post(config.getWebhook() + key).body(JSONObject.toJSONString(request)).execute(); response.close(); } - } diff --git a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/webHook/WebHookSendTextRequest.java b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/webHook/WebHookSendTextRequest.java index 2144200..4152f8d 100644 --- a/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/webHook/WebHookSendTextRequest.java +++ b/Cpop-Api/src/main/java/com/cpop/api/tencent/wxWork/webHook/WebHookSendTextRequest.java @@ -1,6 +1,6 @@ package com.cpop.api.tencent.wxWork.webHook; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import com.cpop.api.tencent.wxWork.core.base.WxWorkApiWebHookSendBase; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-ClockIn-Demo/pom.xml b/Cpop-ClockIn-Demo/pom.xml index 435d07f..d3f5477 100644 --- a/Cpop-ClockIn-Demo/pom.xml +++ b/Cpop-ClockIn-Demo/pom.xml @@ -4,7 +4,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 Cpop-ClockIn-Demo diff --git a/Cpop-ClockIn-Demo/src/main/java/com/cpop/clockin/business/service/impl/StaffClassesServiceImpl.java b/Cpop-ClockIn-Demo/src/main/java/com/cpop/clockin/business/service/impl/StaffClassesServiceImpl.java index 17de52f..cf43569 100644 --- a/Cpop-ClockIn-Demo/src/main/java/com/cpop/clockin/business/service/impl/StaffClassesServiceImpl.java +++ b/Cpop-ClockIn-Demo/src/main/java/com/cpop/clockin/business/service/impl/StaffClassesServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import com.cpop.clockin.business.dto.StaffClassesDto; import com.cpop.clockin.business.entity.*; import com.cpop.clockin.business.mapper.ClockInStaffMapper; +import com.cpop.clockin.business.mapper.StaffClassesMapper; import com.cpop.clockin.business.service.*; import com.cpop.clockin.business.vo.ClassesVo; import com.cpop.clockin.business.vo.StaffClassesVo; @@ -12,7 +13,6 @@ import com.cpop.core.utils.SqlUtils; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.clockin.business.mapper.StaffClassesMapper; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -143,7 +143,7 @@ public class StaffClassesServiceImpl extends ServiceImpl clockInStaffPage = clockInStaffMapper.paginate(pageDomain.getPageNum(), pageDomain.getPageSize(), QueryWrapper.create().like("name",staffName)); + Page clockInStaffPage = clockInStaffMapper.paginate(pageDomain.getPage(), pageDomain.getPageSize(), QueryWrapper.create().like("name",staffName)); List staffClassesVoList = clockInStaffPage.getRecords().stream().map(entity -> { StaffClassesVo vo = new StaffClassesVo(); vo.setStaffName(entity.getName()); @@ -177,7 +177,7 @@ public class StaffClassesServiceImpl extends ServiceImpl staffClassesVoPage = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize()); + Page staffClassesVoPage = new Page<>(pageDomain.getPage(), pageDomain.getPageSize()); staffClassesVoPage.setRecords(staffClassesVoList); staffClassesVoPage.setTotalRow(clockInStaffPage.getTotalRow()); staffClassesVoPage.setTotalPage(clockInStaffPage.getTotalPage()); diff --git a/Cpop-Core/pom.xml b/Cpop-Core/pom.xml index 837da6b..9d8d8e9 100644 --- a/Cpop-Core/pom.xml +++ b/Cpop-Core/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-Core @@ -67,36 +67,16 @@ com.mybatis-flex mybatis-flex-processor - - - org.apache.commons - commons-text - com.alibaba.fastjson2 fastjson2 - - - commons-io - commons-io - com.alibaba easyexcel - - - org.springframework - spring-test - - - - com.squareup.okhttp3 - okhttp - org.springframework.boot @@ -122,6 +102,16 @@ com.gitee.anwena mongo-plus-boot-starter + + + cn.hutool + hutool-all + + + + com.google.guava + guava + diff --git a/Cpop-Core/src/main/java/com/cpop/core/aspect/SignatureCheckAspect.java b/Cpop-Core/src/main/java/com/cpop/core/aspect/SignatureCheckAspect.java index ede4fd1..aa15fed 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/aspect/SignatureCheckAspect.java +++ b/Cpop-Core/src/main/java/com/cpop/core/aspect/SignatureCheckAspect.java @@ -1,9 +1,9 @@ package com.cpop.core.aspect; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.RsaUtils; -import com.cpop.core.utils.StringUtils; +import com.cpop.core.config.CpopConfig; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; @@ -34,7 +34,7 @@ import java.util.stream.Collectors; public class SignatureCheckAspect { @Autowired - private RsaUtils rsaUtils; + private CpopConfig cpopConfig; private static final Map APP_IDS = new HashMap() {{ //数币 @@ -67,11 +67,11 @@ public class SignatureCheckAspect { String appId = null; for (Field field : fatherFields) { field.setAccessible(true); - if (StringUtils.equals("signature", field.getName())) { + if (StrUtil.equals("signature", field.getName())) { signature = (String) field.get(object); continue; } - if (StringUtils.equals("appId", field.getName())) { + if (StrUtil.equals("appId", field.getName())) { String[] strings = APP_IDS.get((String) field.get(object)); if (null == strings){ throw new ServiceException("appId匹配失败,请核实appId"); @@ -99,7 +99,7 @@ public class SignatureCheckAspect { //按照字母排序 String sign = signString.stream().sorted().collect(Collectors.joining("&")) + appId; String md5DigestAsHex = DigestUtils.md5DigestAsHex(sign.getBytes()); - if (!StringUtils.equals(md5DigestAsHex,signature)){ + if (!StrUtil.equals(md5DigestAsHex,signature)){ throw new ServiceException("签名匹配失败,请核实签名"); } } diff --git a/Cpop-Core/src/main/java/com/cpop/core/aspect/SimpleSignatureCheckAspect.java b/Cpop-Core/src/main/java/com/cpop/core/aspect/SimpleSignatureCheckAspect.java index 61f88ab..c5219ac 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/aspect/SimpleSignatureCheckAspect.java +++ b/Cpop-Core/src/main/java/com/cpop/core/aspect/SimpleSignatureCheckAspect.java @@ -1,9 +1,12 @@ package com.cpop.core.aspect; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.RsaUtils; -import com.cpop.core.utils.StringUtils; +import com.cpop.core.config.CpopConfig; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.JoinPoint; @@ -35,7 +38,7 @@ import java.util.Map; public class SimpleSignatureCheckAspect { @Autowired - private RsaUtils rsaUtils; + private CpopConfig cpopConfig; private static final Map APP_IDS = new HashMap() {{ //果酱内部 @@ -62,21 +65,22 @@ public class SimpleSignatureCheckAspect { HttpServletRequest request = (HttpServletRequest) requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST); assert request != null; String signature = request.getHeader("signature"); - if (StringUtils.isBlank(signature)){ + if (StrUtil.isBlank(signature)){ throw new ServiceException("签名为空,请核实签名"); } String appId = request.getHeader("appId"); - if (StringUtils.isBlank(appId)){ + if (StrUtil.isBlank(appId)){ throw new ServiceException("appId为空,请核实签名"); } String dateTime = request.getHeader("dateTime"); - if (StringUtils.isBlank(dateTime)){ + if (StrUtil.isBlank(dateTime)){ throw new ServiceException("时间为空,请核实签名"); } - String decrypt = rsaUtils.decrypt(signature, stringToKey(APP_IDS.get(appId)[1])); + RSA rsa = SecureUtil.rsa(APP_IDS.get(appId)[1], null); + String decrypt = rsa.decryptStr(signature, KeyType.PrivateKey); String sign = appId + dateTime; String md5DigestAsHex = DigestUtils.md5DigestAsHex(sign.getBytes()); - if (!StringUtils.equals(md5DigestAsHex, decrypt)) { + if (!StrUtil.equals(md5DigestAsHex, decrypt)) { throw new ServiceException("签名匹配失败,请核实签名"); } } diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/entity/FastJson2JsonRedisSerializer.java b/Cpop-Core/src/main/java/com/cpop/core/base/entity/FastJson2JsonRedisSerializer.java index aa10f6b..db30a65 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/base/entity/FastJson2JsonRedisSerializer.java +++ b/Cpop-Core/src/main/java/com/cpop/core/base/entity/FastJson2JsonRedisSerializer.java @@ -1,7 +1,5 @@ package com.cpop.core.base.entity; -import com.alibaba.fastjson.parser.ParserConfig; -import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONWriter; import com.fasterxml.jackson.databind.JavaType; @@ -11,7 +9,6 @@ import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.SerializationException; import org.springframework.util.Assert; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; /** diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/entity/PageDomain.java b/Cpop-Core/src/main/java/com/cpop/core/base/entity/PageDomain.java index a8618e3..fe428fc 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/base/entity/PageDomain.java +++ b/Cpop-Core/src/main/java/com/cpop/core/base/entity/PageDomain.java @@ -1,13 +1,16 @@ package com.cpop.core.base.entity; - -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; +import lombok.Getter; /** * 分页数据 * * @author DB + * @version 1.0.0 + * @since 2024/05/23 */ +@Getter public class PageDomain { /** * 当前记录起始索引 @@ -17,6 +20,7 @@ public class PageDomain { /** * 每页显示记录数 */ + private Integer pageSize; /** @@ -34,33 +38,50 @@ public class PageDomain { */ private Boolean reasonable = true; + /** + * 获得订单 + * + * @return {@link String } + * @author DB + * @since 2024/05/23 + */ public String getOrderBy() { - if (StringUtils.isEmpty(orderByColumn)) { + if (StrUtil.isEmpty(orderByColumn)) { return ""; } - return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; - } - - public Integer getPageNum() { - return page; + return StrUtil.toUnderlineCase(orderByColumn) + " " + isAsc; } + /** + * 设置页码 + * + * @param pageNum 页面num + * @author DB + * @since 2024/05/23 + */ public void setPageNum(Integer pageNum) { this.page = pageNum; } - public Integer getPageSize() { - return pageSize; - } - + /** + * 设置页面大小 + * + * @param pageSize 页面大小 + * @author DB + * @since 2024/05/23 + */ public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } - public String getOrderByColumn() { - return orderByColumn; - } + /** + * 按列设置顺序 + * + * @param orderByColumn 按列排序 + * @author DB + * @since 2024/05/23 + */ public void setOrderByColumn(String orderByColumn) { this.orderByColumn = orderByColumn; } @@ -70,11 +91,11 @@ public class PageDomain { } public Boolean getBoolAsc() { - return StringUtils.equals(isAsc, "asc"); + return StrUtil.equals(isAsc, "asc"); } public void setIsAsc(String isAsc) { - if (StringUtils.isNotEmpty(isAsc)) { + if (StrUtil.isNotEmpty(isAsc)) { // 兼容前端排序类型 if ("ascending".equals(isAsc)) { isAsc = "asc"; @@ -85,13 +106,13 @@ public class PageDomain { } } - public Boolean getReasonable() { - if (StringUtils.isNull(reasonable)) { - return Boolean.TRUE; - } - return reasonable; - } - + /** + * 设置合理 + * + * @param reasonable 合理 + * @author DB + * @since 2024/05/23 + */ public void setReasonable(Boolean reasonable) { this.reasonable = reasonable; } diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/entity/Permission.java b/Cpop-Core/src/main/java/com/cpop/core/base/entity/Permission.java deleted file mode 100644 index fa3f9f7..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/base/entity/Permission.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.cpop.core.base.entity; - -import lombok.Getter; - -/** - * 权限组 - */ -@Getter -public class Permission { - - /** - * 权限 - */ - private String permission; - - public void setPermission(String permission) { - this.permission = permission; - } -} \ No newline at end of file diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/enums/CycleEnum.java b/Cpop-Core/src/main/java/com/cpop/core/base/enums/CycleEnum.java deleted file mode 100644 index 86e8d94..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/base/enums/CycleEnum.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.cpop.core.base.enums; - -/** - * @author DB - */ -public enum CycleEnum { - /** - * 日 - */ - DAY(1, "每天"), - /** - * 月 - */ - MONTH(2, "月"), - /** - * 季 - */ - WEEK(3, "季"), - /** - * 年 - */ - YEAR(4, "年"); - - private int codeId; - private String message; - - CycleEnum(int codeId, String message) { - this.codeId = codeId; - this.message = message; - } - - public static CycleEnum getCycle(int code) { - for (CycleEnum c : CycleEnum.values()) { - if (c.codeId == code) { - return c; - } - } - return null; - } - - public int getCodeId() { - return codeId; - } - - public void setCodeId(int codeId) { - this.codeId = codeId; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/base/exception/BaseException.java b/Cpop-Core/src/main/java/com/cpop/core/base/exception/BaseException.java index 883967c..2a9ce04 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/base/exception/BaseException.java +++ b/Cpop-Core/src/main/java/com/cpop/core/base/exception/BaseException.java @@ -1,6 +1,6 @@ package com.cpop.core.base.exception; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import com.cpop.core.utils.MessageUtils; import lombok.Getter; @@ -63,7 +63,7 @@ public class BaseException extends RuntimeException { @Override public String getMessage() { String message = null; - if (!StringUtils.isEmpty(code)) { + if (!StrUtil.isEmpty(code)) { message = MessageUtils.message(code, args); } if (message == null) { diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/CpopConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/CpopConfig.java index b07955c..54b976a 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/config/CpopConfig.java +++ b/Cpop-Core/src/main/java/com/cpop/core/config/CpopConfig.java @@ -1,9 +1,26 @@ package com.cpop.core.config; +import cn.hutool.crypto.SecureUtil; +import cn.hutool.crypto.asymmetric.RSA; +import com.cpop.core.base.exception.UtilException; +import lombok.Data; import lombok.Getter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; +import java.io.File; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.Key; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; + /** * 读取项目相关配置 * @@ -81,5 +98,220 @@ public class CpopConfig { public String getUploadPath() { return getProfile() + "/upload"; } + + /** + * jwt + */ + private Jwt jwt; + + /** + * jwt设置 + * + * @param jwt jwt + * @author DB + * @since 2024/05/23 + */ + public void setJwt(Jwt jwt) { + this.jwt = jwt; + } + + /** + * jwt + * + * @author DB + * @version 1.0.0 + * @since 2024/05/23 + */ + @Data + public static class Jwt { + + /** + * 白名单 + */ + private String whiteList; + } + + /** + * 网关配置 + */ + private Gateway gateway; + + /** + * 设置网关 + * + * @param gateway 网关 + * @author DB + * @since 2024/05/23 + */ + public void setGateway(Gateway gateway) { + this.gateway = gateway; + } + + /** + * 网关 + * + * @author DB + * @version 1.0.0 + * @since 2024/05/23 + */ + @Data + public static class Gateway { + + /** + * rsa密钥对 + */ + private RsaKeypair rsaKeypair;; + + /** + * rsa密钥对 + * + * @author DB + * @version 1.0.0 + * @since 2024/05/23 + */ + @Data + public static class RsaKeypair { + + /** + * 算法 + */ + private String algorithm; + + /** + * 关键尺寸 + */ + private Integer keySize; + + /** + * 公钥文件 + */ + private String publicKeyFile; + + /** + * 私钥文件 + */ + private String privateKeyFile; + + } + } + + /** + * 获取登录rsa + * + * @return {@link RSA } + * @author DB + * @since 2024/05/23 + */ + public RSA getLoginRsa(){ + //rsa解密 + Gateway.RsaKeypair rsaKeypair = gateway.getRsaKeypair(); + Map keyPair = getKeyPair(rsaKeypair.getPublicKeyFile(), rsaKeypair.getPrivateKeyFile()); + return SecureUtil.rsa(keyPair.get("privateKey"), keyPair.get("publicKey")); + } + + + /** + * 获取密钥对 + * + * @param publicKeyFile 公钥文件 + * @param privateKeyFile 私钥文件 + * @return {@link Map }<{@link String }, {@link String }> + * @author DB + * @since 2024/05/23 + */ + private Map getKeyPair(String publicKeyFile, String privateKeyFile){ + Map keyPairMap = new HashMap<>(2); + File publicFile = new File(publicKeyFile); + File privateFile = new File(privateKeyFile); + //判断是否存在公钥和私钥文件 + if (!publicFile.exists() || !privateFile.exists()) { + generateKeyPairToFiles(publicKeyFile, privateKeyFile); + } + ObjectInputStream oisPublic = null; + ObjectInputStream oisPrivate = null; + Key publicKey = null; + Key privateKey = null; + try { + oisPublic = new ObjectInputStream(Files.newInputStream(Paths.get(publicKeyFile))); + oisPrivate = new ObjectInputStream(Files.newInputStream(Paths.get(privateKeyFile))); + publicKey = (Key) oisPublic.readObject(); + privateKey = (Key) oisPrivate.readObject(); + byte[] publicKeyBytes = publicKey.getEncoded(); + byte[] privateKeyBytes = privateKey.getEncoded(); + String publicKeyBase64 = Base64.getEncoder().encodeToString(publicKeyBytes); + String privateKeyBase64 = Base64.getEncoder().encodeToString(privateKeyBytes); + //公钥字符串 + keyPairMap.put("publicKey", publicKeyBase64); + //私钥字符串 + keyPairMap.put("privateKey", privateKeyBase64); + } catch (IOException | ClassNotFoundException e) { + throw new UtilException(e.getMessage()); + } finally { + try { + assert oisPrivate != null; + oisPrivate.close(); + oisPublic.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return keyPairMap; + } + + + /** + * 生成文件密钥对 + * + * @param publicKeyFile 公钥文件 + * @param privateKeyFile 私钥文件 + * @author DB + * @since 2024/05/23 + */ + private void generateKeyPairToFiles(String publicKeyFile, String privateKeyFile) { + ObjectOutputStream oosPublicKey = null; + ObjectOutputStream oosPrivateKey = null; + try { + Map keyPairMap = generateKeyPair(); + Key publicKey = keyPairMap.get("publicKey"); + Key privateKey = keyPairMap.get("privateKey"); + oosPublicKey = new ObjectOutputStream(Files.newOutputStream(Paths.get(publicKeyFile))); + oosPrivateKey = new ObjectOutputStream(Files.newOutputStream(Paths.get(privateKeyFile))); + oosPublicKey.writeObject(publicKey); + oosPrivateKey.writeObject(privateKey); + } catch (NoSuchAlgorithmException | IOException e) { + throw new UtilException(e.getMessage()); + } finally { + try { + //清空缓存,关闭文件输出流 + assert oosPublicKey != null; + oosPublicKey.close(); + assert oosPrivateKey != null; + oosPrivateKey.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + /** + * 生成密钥对 + * + * @return {@link Map }<{@link String }, {@link Key }> + * @throws NoSuchAlgorithmException 生成失败异常 + * @author DB + * @since 2024/05/23 + */ + private Map generateKeyPair() throws NoSuchAlgorithmException { + KeyPair keyPair = SecureUtil.generateKeyPair(gateway.getRsaKeypair().getAlgorithm(), gateway.getRsaKeypair().getKeySize()); + //得到公钥 + Key publicKey = keyPair.getPublic(); + //得到私钥 + Key privateKey = keyPair.getPrivate(); + Map keyPairMap = new HashMap<>(); + keyPairMap.put("publicKey", publicKey); + keyPairMap.put("privateKey", privateKey); + return keyPairMap; + } } diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java deleted file mode 100644 index fc57cc8..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cpop.core.config; - -import com.cpop.core.filter.XssFilter; -import com.cpop.core.utils.StringUtils; -import jakarta.servlet.DispatcherType; -import lombok.Data; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.HashMap; -import java.util.Map; - -/** - * Filter配置 - * - * @author DB - */ -@Data -@Configuration -@ConfigurationProperties(prefix = "xss") -public class FilterConfig { - - /** - * 排除链接(多个用逗号分隔) - */ - private String excludes; - - /** - * 匹配链接 - */ - private String urlPatterns; - - /** - * xss过滤器 - * @return FilterRegistrationBean - * @author DB - * @since 2023/4/17 9:17 - **/ - @SuppressWarnings({"rawtypes", "unchecked"}) - @Bean - @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") - public FilterRegistrationBean xssFilterRegistration() { - FilterRegistrationBean registration = new FilterRegistrationBean(); - registration.setDispatcherTypes(DispatcherType.REQUEST); - registration.setFilter(new XssFilter()); - registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); - registration.setName("xssFilter"); - registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); - Map initParameters = new HashMap(); - initParameters.put("excludes", excludes); - registration.setInitParameters(initParameters); - return registration; - } - -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/GenerateKeyPairConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/GenerateKeyPairConfig.java deleted file mode 100644 index 505bc59..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/config/GenerateKeyPairConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.cpop.core.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * @author DB - * @Description: 生成密钥对的配置文件 - * @create: 2023-08-04 23:06 - */ -@Data -@Component -@ConfigurationProperties(prefix = "cpop.gateway.rsa-keypair") -public class GenerateKeyPairConfig { - - /** - * 加密方式 - */ - private String algorithm; - - /** - * 初始化大小 - */ - private Integer keySize; - - /** - * 公钥文件 - */ - private String publicKeyFile; - - /** - * 私钥文件 - */ - private String privateKeyFile; - -} - diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/RedisConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/RedisConfig.java index aa100bb..16cd082 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/config/RedisConfig.java +++ b/Cpop-Core/src/main/java/com/cpop/core/config/RedisConfig.java @@ -1,7 +1,7 @@ package com.cpop.core.config; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.FastJson2JsonRedisSerializer; -import com.cpop.core.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -40,7 +40,7 @@ public class RedisConfig extends CachingConfigurerSupport { public RedisConnectionFactory wxOpenRedisConnectionFactory() { RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(redisProperties.getHost(), redisProperties.getPort()); configuration.setDatabase(redisProperties.getDatabase()); - if (StringUtils.isNotBlank(redisProperties.getPassword())) { + if (StrUtil.isNotBlank(redisProperties.getPassword())) { configuration.setPassword(redisProperties.getPassword()); } return new JedisConnectionFactory(configuration); diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/SaTokenConfigure.java b/Cpop-Core/src/main/java/com/cpop/core/config/SaTokenConfigure.java new file mode 100644 index 0000000..7c29477 --- /dev/null +++ b/Cpop-Core/src/main/java/com/cpop/core/config/SaTokenConfigure.java @@ -0,0 +1,136 @@ +package com.cpop.core.config; + +import cn.dev33.satoken.context.SaHolder; +import cn.dev33.satoken.filter.SaServletFilter; +import cn.dev33.satoken.interceptor.SaInterceptor; +import cn.dev33.satoken.jwt.StpLogicJwtForSimple; +import cn.dev33.satoken.stp.StpLogic; +import cn.dev33.satoken.stp.StpUtil; +import com.cpop.core.constant.Constants; +import com.cpop.core.filter.RepeatableFilter; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.util.Arrays; +import java.util.Collections; + +/** + * Sa令牌配置 + * + * @author DB + * @version 1.0.0 + * @since 2023-08-05 8:01 + */ +@Configuration +@RequiredArgsConstructor +public class SaTokenConfigure implements WebMvcConfigurer { + + /** + * jambox配置 + */ + @Autowired(required = false) + private CpopConfig cpopConfig; + + /** + * 获取servlet过滤器 + * + * @return {@link SaServletFilter } + * @author DB + * @since 2024/05/23 + */ + @Bean + public SaServletFilter getSaServletFilter() { + RepeatableFilter repeatableFilter = new RepeatableFilter(); + repeatableFilter + // 指定 拦截路由 与 放行路由 + //.addInclude("/**").addExclude(jamboxConfig.getJwt().getWhiteList().split(",")) + // 认证函数: 每次请求执行 + //.setAuth(obj -> { + // 登录认证 -- 拦截所有路由,并排除/user/doLogin 用于开放登录 + //SaRouter.match("/**", "/user/doLogin", StpUtil::checkLogin); + // 更多拦截处理方式,请参考“路由拦截式鉴权”章节 */ + //}) + // 异常处理函数:每次认证函数发生异常时执行此函数 + //.setError(e -> SaResult.error(e.getMessage())) + // 前置函数:在每次认证函数之前执行(BeforeAuth 不受 includeList 与 excludeList 的限制,所有请求都会进入) + .setBeforeAuth(r -> { + // ---------- 设置一些安全响应头 ---------- + SaHolder.getResponse() + // 服务器名称 + .setServer("Jambox") + // 是否可以在iframe显示视图: DENY=不可以 | SAMEORIGIN=同域下可以 | ALLOW-FROM uri=指定域名下可以 + .setHeader("X-Frame-Options", "SAMEORIGIN") + // 是否启用浏览器默认XSS防护: 0=禁用 | 1=启用 | 1; mode=block 启用, 并在检查到XSS攻击时,停止渲染页面 + .setHeader("X-XSS-Protection", "1; mode=block") + // 禁用浏览器内容嗅探 + .setHeader("X-Content-Type-Options", "nosniff") + ; + }); + return repeatableFilter; + + } + + /** + * 注册 Sa-Token 拦截器,打开注解式鉴权功能 + * + * @param registry 拦截器注册 + * @author DB + * @since 2024/3/20 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + // 注册 Sa-Token 拦截器,打开注解式鉴权功能 + registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())) + .addPathPatterns("/**") + .excludePathPatterns(Arrays.asList(cpopConfig.getJwt().getWhiteList().split(","))); + } + + /** + * Sa-Token 整合 jwt (Simple 简单模式) + * @author DB + * @since 2024/3/20 + * @return StpLogic + */ + @Bean + public StpLogic getStpLogicJwt() { + return new StpLogicJwtForSimple(); + } + + /** + * 配置跨源访问(CORS) + */ + @Bean + public CorsConfigurationSource corsConfigurationSource() { + CorsConfiguration configuration = new CorsConfiguration(); + configuration.setAllowedOrigins(Collections.singletonList("*")); + configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); + configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type")); + configuration.applyPermitDefaultValues(); + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", configuration); + return source; + } + + /** + * 资源映射 + * + * @param registry 注册 + * @author DB + * @since 2023/5/27 13:57 + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + //本地文件上传路径 + registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") + .addResourceLocations("file:" + cpopConfig.getProfile() + "/"); + } + +} diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/ServerConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/ServerConfig.java deleted file mode 100644 index e9ccb30..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/config/ServerConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cpop.core.config; - -import com.cpop.core.utils.ServletUtils; -import jakarta.servlet.http.HttpServletRequest; -import org.springframework.stereotype.Component; - - -/** - * 服务相关配置 - * - * @author DB - */ -@Component -public class ServerConfig { - - /** - * 获取完整的请求路径,包括:域名,端口,上下文访问路径 - * - * @return 服务地址 - */ - public String getUrl() { - HttpServletRequest request = ServletUtils.getRequest(); - return getDomain(request); - } - - public static String getDomain(HttpServletRequest request) { - StringBuffer url = request.getRequestURL(); - String contextPath = request.getServletContext().getContextPath(); - return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/constant/Constants.java b/Cpop-Core/src/main/java/com/cpop/core/constant/Constants.java index 48116a9..5d62755 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/constant/Constants.java +++ b/Cpop-Core/src/main/java/com/cpop/core/constant/Constants.java @@ -213,4 +213,75 @@ public interface Constants { */ String QRCODE_HEADER = "data:image/png;base64,"; + /** + * 默认文件名长度 + */ + Integer DEFAULT_FILE_NAME_LENGTH = 100; + + /** + * 默认大小 50M + */ + Long DEFAULT_MAX_SIZE = 50L * 1024 * 1024; + + /** + * png图像 + */ + String IMAGE_PNG = "image/png"; + + /** + * jpg图像 + */ + String IMAGE_JPG = "image/jpg"; + + /** + * jpeg图像 + */ + String IMAGE_JPEG = "image/jpeg"; + + /** + * bmp图像 + */ + String IMAGE_BMP = "image/bmp"; + + /** + * gif图像 + */ + String IMAGE_GIF = "image/gif"; + + /** + * 映像扩展 + */ + String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"}; + + /** + * flash扩展 + */ + String[] FLASH_EXTENSION = {"swf", "flv"}; + + /** + * 媒体扩展 + */ + String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", + "asf", "rm", "rmvb"}; + + /** + * 视频扩展 + */ + String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"}; + + /** + * 默认允许扩展 + */ + String[] DEFAULT_ALLOWED_EXTENSION = { + // 图片 + "bmp", "gif", "jpg", "jpeg", "png", + // word excel powerpoint + "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", + // 压缩文件 + "rar", "zip", "gz", "bz2", + // 视频格式 + "mp4", "avi", "rmvb", + // pdf + "pdf"}; + } diff --git a/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatableFilter.java b/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatableFilter.java index 4554937..5f65b53 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatableFilter.java +++ b/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatableFilter.java @@ -1,6 +1,10 @@ package com.cpop.core.filter; -import com.cpop.core.utils.StringUtils; +import cn.dev33.satoken.exception.BackResultException; +import cn.dev33.satoken.exception.StopMatchException; +import cn.dev33.satoken.filter.SaServletFilter; +import cn.dev33.satoken.router.SaRouter; +import cn.hutool.core.util.StrUtil; import jakarta.servlet.*; import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.MediaType; @@ -15,17 +19,30 @@ import java.io.IOException; * @author DB */ @Component -public class RepeatableFilter implements Filter { +public class RepeatableFilter extends SaServletFilter { @Override - public void init(FilterConfig filterConfig) throws ServletException { + public void init(FilterConfig filterConfig) { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + try { + this.beforeAuth.run((Object)null); + SaRouter.match(this.includeList).notMatch(this.excludeList).check((r) -> { + this.auth.run((Object)null); + }); + } catch (StopMatchException ignored) { + } catch (Throwable var7) { + String result = var7 instanceof BackResultException ? var7.getMessage() : String.valueOf(this.error.run(var7)); + if (response.getContentType() == null) { + response.setContentType("text/plain; charset=utf-8"); + } + response.getWriter().print(result); + } ServletRequest requestWrapper = null; - if (request instanceof HttpServletRequest && StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) { + if (request instanceof HttpServletRequest && StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) { requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response); } if (null == requestWrapper) { diff --git a/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatedlyRequestWrapper.java b/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatedlyRequestWrapper.java index 31d0f26..827508e 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatedlyRequestWrapper.java +++ b/Cpop-Core/src/main/java/com/cpop/core/filter/RepeatedlyRequestWrapper.java @@ -1,17 +1,16 @@ package com.cpop.core.filter; -import com.cpop.core.utils.http.HttpHelper; import jakarta.servlet.ReadListener; import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletRequest; import jakarta.servlet.ServletResponse; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequestWrapper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; +import java.io.*; import java.nio.charset.StandardCharsets; /** @@ -19,6 +18,7 @@ import java.nio.charset.StandardCharsets; * * @author DB */ +@Slf4j public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper { private final byte[] body; @@ -27,7 +27,38 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); - body = HttpHelper.getBodyString(request).getBytes(StandardCharsets.UTF_8); + body = getBodyString(request).getBytes(StandardCharsets.UTF_8); + } + + /** + * 获取主体字符串 + * + * @param request 请求 + * @return {@link String } + * @author DB + * @since 2024/05/24 + */ + private String getBodyString(ServletRequest request) { + StringBuilder sb = new StringBuilder(); + BufferedReader reader = null; + try (InputStream inputStream = request.getInputStream()) { + reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + String line = ""; + while ((line = reader.readLine()) != null) { + sb.append(line); + } + } catch (IOException e) { + log.warn("getBodyString出现问题!"); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + log.error(ExceptionUtils.getMessage(e)); + } + } + } + return sb.toString(); } @Override diff --git a/Cpop-Core/src/main/java/com/cpop/core/filter/XssFilter.java b/Cpop-Core/src/main/java/com/cpop/core/filter/XssFilter.java deleted file mode 100644 index 0bc0733..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/filter/XssFilter.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.cpop.core.filter; - -import com.cpop.core.utils.StringUtils; -import jakarta.servlet.*; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * 防止XSS攻击的过滤器 - * - * @author DB - */ -public class XssFilter implements Filter { - /** - * 排除链接 - */ - public List excludes = new ArrayList<>(); - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - String tempExcludes = filterConfig.getInitParameter("excludes"); - if (StringUtils.isNotEmpty(tempExcludes)) { - String[] url = tempExcludes.split(","); - for (int i = 0; url != null && i < url.length; i++) { - excludes.add(url[i]); - } - } - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException { - HttpServletRequest req = (HttpServletRequest) request; - HttpServletResponse resp = (HttpServletResponse) response; - if (handleExcludeURL(req, resp)) { - chain.doFilter(request, response); - return; - } - XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); - chain.doFilter(xssRequest, response); - } - - private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response) { - String url = request.getServletPath(); - String method = request.getMethod(); - // GET DELETE 不过滤 - if (method == null || method.matches("GET") || method.matches("DELETE")) { - return true; - } - return StringUtils.matches(url, excludes); - } - - @Override - public void destroy() { - - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/filter/XssHttpServletRequestWrapper.java b/Cpop-Core/src/main/java/com/cpop/core/filter/XssHttpServletRequestWrapper.java deleted file mode 100644 index e88fa75..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/filter/XssHttpServletRequestWrapper.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.cpop.core.filter; - - -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.html.EscapeUtil; -import jakarta.servlet.ReadListener; -import jakarta.servlet.ServletInputStream; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletRequestWrapper; -import org.apache.commons.io.IOUtils; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -/** - * XSS过滤处理 - * - * @author DB - */ -public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { - - /** - * @param request - */ - public XssHttpServletRequestWrapper(HttpServletRequest request) { - super(request); - } - - @Override - public String[] getParameterValues(String name) { - String[] values = super.getParameterValues(name); - if (values != null) { - int length = values.length; - String[] escapseValues = new String[length]; - for (int i = 0; i < length; i++) { - // 防xss攻击和过滤前后空格 - escapseValues[i] = EscapeUtil.clean(values[i]).trim(); - } - return escapseValues; - } - return super.getParameterValues(name); - } - - @Override - public ServletInputStream getInputStream() throws IOException { - // 非json类型,直接返回 - if (!isJsonRequest()) { - return super.getInputStream(); - } - - // 为空,直接返回 - String json = IOUtils.toString(super.getInputStream(), StandardCharsets.UTF_8); - if (StringUtils.isEmpty(json)) { - return super.getInputStream(); - } - - // xss过滤 - json = EscapeUtil.clean(json).trim(); - byte[] jsonBytes = json.getBytes(StandardCharsets.UTF_8); - final ByteArrayInputStream bis = new ByteArrayInputStream(jsonBytes); - return new ServletInputStream() { - @Override - public boolean isFinished() { - return true; - } - - @Override - public boolean isReady() { - return true; - } - - @Override - public int available() throws IOException { - return jsonBytes.length; - } - - @Override - public void setReadListener(ReadListener readListener) { - } - - @Override - public int read() throws IOException { - return bis.read(); - } - }; - } - - /** - * 是否是Json请求 - */ - public boolean isJsonRequest() { - String header = super.getHeader(HttpHeaders.CONTENT_TYPE); - return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/handler/UploadHandler.java b/Cpop-Core/src/main/java/com/cpop/core/handler/UploadHandler.java new file mode 100644 index 0000000..c117753 --- /dev/null +++ b/Cpop-Core/src/main/java/com/cpop/core/handler/UploadHandler.java @@ -0,0 +1,247 @@ +package com.cpop.core.handler; + +import cn.hutool.core.net.NetUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.cpop.core.base.exception.UtilException; +import com.cpop.core.base.exception.file.InvalidExtensionException; +import com.cpop.core.config.CpopConfig; +import com.cpop.core.constant.Constants; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +/** + * 上传文件工具类 + * @author DB + * @version 1.1.0 + * @since 2024-05-23 11:49 + */ +@Component +public class UploadHandler { + + @Autowired + private CpopConfig cpopConfig; + + /** + * 上传文件 + * + * @param file 文件 + * @return {@link String } + * @author DB + * @since 2024/05/23 + */ + public String uploadFile(MultipartFile file) { + //判断文件名长度 + int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length(); + if (fileNameLength > Constants.DEFAULT_FILE_NAME_LENGTH) { + throw new UtilException("文件名过长"); + } + //文件大小校验 + try { + assertAllowed(file, Constants.DEFAULT_ALLOWED_EXTENSION); + } catch (FileSizeLimitExceededException | InvalidExtensionException e) { + throw new UtilException(e); + } + //编码文件名 + String fileName = extractFilename(file); + //获取绝对文件 + String absPath = getAbsoluteFile(cpopConfig.getUploadPath(), fileName).getAbsolutePath(); + try { + //文件传输 + file.transferTo(Paths.get(absPath)); + } catch (IOException e) { + throw new UtilException(e); + } + // 上传并返回新文件名称 + String pathFileName = getPathFileName(cpopConfig.getUploadPath(), fileName); + //强制将http变成https + //String https = serverConfig.getUrl().replace("http:", "https:"); + //String url = https + fileName; + return NetUtil.getLocalHostName() + pathFileName; + } + + /** + * 获取文件名称 + * + * @param fileName 路径名称 + * @return 没有文件路径的名称 + * @author DB + * @since 2024/05/23 + */ + public String getName(String fileName) { + if (fileName == null) { + return null; + } + int lastUnixPos = fileName.lastIndexOf('/'); + int lastWindowsPos = fileName.lastIndexOf('\\'); + int index = Math.max(lastUnixPos, lastWindowsPos); + return fileName.substring(index + 1); + } + + /** + * 获取路径文件名 + * + * @param uploadDir 上传dir + * @param fileName 文件名称 + * @return {@link String } + * @author DB + * @since 2024/05/23 + */ + private String getPathFileName(String uploadDir, String fileName) { + int dirLastIndex = cpopConfig.getProfile().length() + 1; + String currentDir = StringUtils.substring(uploadDir, dirLastIndex); + return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; + } + + /** + * 编码文件名 + * + * @param file 文件 + * @return {@link String } + * @author DB + * @since 2024/05/23 + */ + public String extractFilename(MultipartFile file) { + return StrUtil.format("{}/{}_{}.{}", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")), + FilenameUtils.getBaseName(file.getOriginalFilename()), IdUtil.getSnowflakeNextId(), getExtension(file)); + } + + /** + * 获取绝对文件 + * + * @param uploadDir 上传dir + * @param fileName 文件名称 + * @return {@link File } + * @author DB + * @since 2024/05/23 + */ + public File getAbsoluteFile(String uploadDir, String fileName) { + File desc = new File(uploadDir + File.separator + fileName); + if (!desc.exists()) { + if (!desc.getParentFile().exists()) { + desc.getParentFile().mkdirs(); + } + } + return desc; + } + + /** + * 文件大小校验 + * + * @param file 上传的文件 + * @param allowedExtension 允许扩展 + * @throws FileSizeLimitExceededException 文件大小限制超出异常 + * @throws InvalidExtensionException 无效扩展异常 + * @author DB + * @since 2024/05/23 + */ + private void assertAllowed(MultipartFile file, String[] allowedExtension) throws FileSizeLimitExceededException, InvalidExtensionException { + long size = file.getSize(); + if (size > Constants.DEFAULT_MAX_SIZE) { + throw new FileSizeLimitExceededException("文件过大", size, Constants.DEFAULT_MAX_SIZE / 1024 / 1024); + } + String fileName = file.getOriginalFilename(); + String extension = getExtension(file); + if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) { + if (allowedExtension == Constants.IMAGE_EXTENSION) { + throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, + fileName); + } else if (allowedExtension == Constants.FLASH_EXTENSION) { + throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, + fileName); + } else if (allowedExtension == Constants.MEDIA_EXTENSION) { + throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, + fileName); + } else if (allowedExtension == Constants.VIDEO_EXTENSION) { + throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, + fileName); + } else { + throw new InvalidExtensionException(allowedExtension, extension, fileName); + } + } + } + + /** + * 获取文件名的后缀 + * + * @param file 表单文件 + * @return 后缀名 + * @author DB + * @since 2024/05/23 + */ + private String getExtension(MultipartFile file) { + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + if (StrUtil.isEmpty(extension)) { + extension = getExtension(Objects.requireNonNull(file.getContentType())); + } + return extension; + } + + + /** + * 允许扩展 + * + * @param extension 扩展 + * @param allowedExtension 允许扩展 + * @return boolean + * @author DB + * @since 2024/05/23 + */ + public boolean isAllowedExtension(String extension, String[] allowedExtension) { + for (String str : allowedExtension) { + if (str.equalsIgnoreCase(extension)) { + return true; + } + } + return false; + } + + /** + * 得到扩展 + * + * @param prefix 前缀 + * @return {@link String } + * @author DB + * @since 2024/05/23 + */ + private String getExtension(String prefix) { + return switch (prefix) { + case Constants.IMAGE_PNG -> "png"; + case Constants.IMAGE_JPG -> "jpg"; + case Constants.IMAGE_JPEG -> "jpeg"; + case Constants.IMAGE_BMP -> "bmp"; + case Constants.IMAGE_GIF -> "gif"; + default -> ""; + }; + } + + /** + * 获取内容类型 + * + * @param extension 扩展 + * @return {@link String } + * @author DB + * @since 2024/05/24 + */ + public String getContentType(String extension) { + return switch (extension) { + case "png" -> Constants.IMAGE_PNG; + case "jpg" -> Constants.IMAGE_JPG; + case "jpeg" -> Constants.IMAGE_JPEG; + case "bmp" -> Constants.IMAGE_BMP; + case "gif" -> Constants.IMAGE_GIF; + default -> ""; + }; + } +} diff --git a/Cpop-Core/src/main/java/com/cpop/core/strategy/json/ArrayToStringDeserializer.java b/Cpop-Core/src/main/java/com/cpop/core/strategy/json/ArrayToStringDeserializer.java index 5f33bdf..ef68450 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/strategy/json/ArrayToStringDeserializer.java +++ b/Cpop-Core/src/main/java/com/cpop/core/strategy/json/ArrayToStringDeserializer.java @@ -1,6 +1,6 @@ package com.cpop.core.strategy.json; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -31,7 +31,7 @@ public class ArrayToStringDeserializer extends JsonDeserializer { return ((DoubleNode) treeNode).asText(); } else if (treeNode instanceof ArrayNode) { //字符串数组,会多出两个引号,需要手动去除 - return StringUtils.replace(StringUtils.join((ArrayNode) treeNode, ","), "\"", ""); + return StrUtil.replace(StrUtil.join(",", (ArrayNode) treeNode), "\"", ""); } else if (treeNode instanceof TextNode) { return ((TextNode) treeNode).asText(); } diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/JsonUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/JsonUtils.java deleted file mode 100644 index 539ebda..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/JsonUtils.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.cpop.core.utils; - -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import lombok.extern.slf4j.Slf4j; - -/** - * @author Binary Wang - */ -@Slf4j -public class JsonUtils { - private static final ObjectMapper JSON = new ObjectMapper(); - - static { - JSON.setSerializationInclusion(Include.NON_NULL); - JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE); - } - - public static String toJson(Object obj) { - try { - return JSON.writeValueAsString(obj); - } catch (JsonProcessingException e) { - log.error(e.getMessage()); - } - return null; - } -} - diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/QuartzUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/QuartzUtils.java index 4ce50f0..a69fe3f 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/QuartzUtils.java +++ b/Cpop-Core/src/main/java/com/cpop/core/utils/QuartzUtils.java @@ -1,12 +1,10 @@ package com.cpop.core.utils; -import com.cpop.core.base.exception.UtilException; import org.quartz.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.text.ParseException; -import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Calendar; import java.util.Date; @@ -32,11 +30,7 @@ public class QuartzUtils { */ public String getJobInfo(String name, String group) throws SchedulerException { TriggerKey triggerKey = new TriggerKey(name, group); - Trigger trigger = scheduler.getTrigger(triggerKey); - if (trigger == null) { - throw new UtilException("获取定时任务失败"); - } - CronTrigger cronTrigger = (CronTrigger) trigger; + CronTrigger cronTrigger = (CronTrigger) scheduler.getTrigger(triggerKey); return String.format("time:%s,state:%s", cronTrigger.getCronExpression(), scheduler.getTriggerState(triggerKey).name()); } @@ -53,20 +47,15 @@ public class QuartzUtils { public boolean modifyJob(String name, String group, String time) throws SchedulerException { Date date = null; TriggerKey triggerKey = new TriggerKey(name, group); - Trigger triggerResult = scheduler.getTrigger(triggerKey); - if (triggerResult != null) { - CronTrigger cronTrigger = (CronTrigger) triggerResult; - String oldTime = cronTrigger.getCronExpression(); - if (!oldTime.equalsIgnoreCase(time)) { - CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(time); - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(name, group) - .withSchedule(cronScheduleBuilder).build(); - date = scheduler.rescheduleJob(triggerKey, trigger); - } - return date != null; - } else { - return false; + CronTrigger cronTrigger = (CronTrigger) scheduler.getTrigger(triggerKey); + String oldTime = cronTrigger.getCronExpression(); + if (!oldTime.equalsIgnoreCase(time)) { + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(time); + CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(name, group) + .withSchedule(cronScheduleBuilder).build(); + date = scheduler.rescheduleJob(triggerKey, trigger); } + return date != null; } /** diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/RsaUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/RsaUtils.java deleted file mode 100644 index ac59ab7..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/RsaUtils.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.cpop.core.utils; - -import com.cpop.core.base.exception.UtilException; -import com.cpop.core.config.GenerateKeyPairConfig; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import java.io.File; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.*; -import java.util.Base64; -import java.util.HashMap; -import java.util.Map; - -/** - * @author DB - * @Description: Rsa相关工具类 - * @create 2023-08-04 23:09 - */ -@Component -public class RsaUtils { - - @Autowired - private GenerateKeyPairConfig keyPairConfig; - - // region 私有方法 - - /** - * 生成密钥对 - * @return 返回map集合,其中包含publicKey与privateKey - * @throws NoSuchAlgorithmException - */ - private Map generateKeyPair() throws NoSuchAlgorithmException { - //RSA算法要求有一个可信任的随机数源 - SecureRandom secureRandom = new SecureRandom(); - //为RSA算法创建一个KeyPairGenerator对象 - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyPairConfig.getAlgorithm()); - //利用上面的随机数据源初始化这个KeyPairGenerator对象 - keyPairGenerator.initialize(keyPairConfig.getKeySize(), secureRandom); - //生成密匙对 - KeyPair keyPair = keyPairGenerator.generateKeyPair(); - //得到公钥 - Key publicKey = keyPair.getPublic(); - //得到私钥 - Key privateKey = keyPair.getPrivate(); - Map keyPairMap = new HashMap<>(); - keyPairMap.put("publicKey", publicKey); - keyPairMap.put("privateKey", privateKey); - return keyPairMap; - } - - /** - * 获取文件中获取密钥对象 - * @param fileName 文件名 - * @return 密钥对象 - */ - private Key getKeyFromFile(String fileName) { - Key key = null; - ObjectInputStream ois = null; - try { - ois = new ObjectInputStream(Files.newInputStream(Paths.get(fileName))); - key = (Key) ois.readObject(); - } catch (IOException | ClassNotFoundException e) { - throw new UtilException(e.getMessage()); - } finally { - try { - assert ois != null; - ois.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return key; - } - - /** - * 将密钥对生成到文件中 - */ - private void generateKeyPairToFiles() { - generateKeyPairToFiles(keyPairConfig.getPublicKeyFile(),keyPairConfig.getPrivateKeyFile()); - } - - private void generateKeyPairToFiles(String publicKeyFile, String privateKeyFile) { - ObjectOutputStream oosPublicKey = null; - ObjectOutputStream oosPrivateKey = null; - try { - Map keyPairMap = generateKeyPair(); - Key publicKey = keyPairMap.get("publicKey"); - Key privateKey = keyPairMap.get("privateKey"); - oosPublicKey = new ObjectOutputStream(Files.newOutputStream(Paths.get(publicKeyFile))); - oosPrivateKey = new ObjectOutputStream(Files.newOutputStream(Paths.get(privateKeyFile))); - oosPublicKey.writeObject(publicKey); - oosPrivateKey.writeObject(privateKey); - } catch (NoSuchAlgorithmException | IOException e) { - throw new UtilException(e.getMessage()); - } finally { - try { - //清空缓存,关闭文件输出流 - assert oosPublicKey != null; - oosPublicKey.close(); - assert oosPrivateKey != null; - oosPrivateKey.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - - - /** - * 初始化密钥对文件 - * @return 返回密钥对信息【publicKey(公钥字符串)、、privateKey(私钥字符串)】 - */ - public Map initKeyPair() { - return initKeyPair(keyPairConfig.getPublicKeyFile(),keyPairConfig.getPrivateKeyFile()); - } - - public Map initKeyPair(String publicKeyFile, String privateKeyFile){ - Map keyPairMap = new HashMap<>(); - File publicFile = new File(publicKeyFile); - File privateFile = new File(privateKeyFile); - //判断是否存在公钥和私钥文件 - if (!publicFile.exists() || !privateFile.exists()) { - generateKeyPairToFiles(publicKeyFile, privateKeyFile); - } - ObjectInputStream oisPublic = null; - ObjectInputStream oisPrivate = null; - Key publicKey = null; - Key privateKey = null; - try { - oisPublic = new ObjectInputStream(Files.newInputStream(Paths.get(publicKeyFile))); - oisPrivate = new ObjectInputStream(Files.newInputStream(Paths.get(privateKeyFile))); - publicKey = (Key) oisPublic.readObject(); - privateKey = (Key) oisPrivate.readObject(); - byte[] publicKeyBytes = publicKey.getEncoded(); - byte[] privateKeyBytes = privateKey.getEncoded(); - String publicKeyBase64 = Base64.getEncoder().encodeToString(publicKeyBytes); - String privateKeyBase64 = Base64.getEncoder().encodeToString(privateKeyBytes); - //公钥字符串 - keyPairMap.put("publicKey", publicKeyBase64); - //私钥字符串 - keyPairMap.put("privateKey", privateKeyBase64); - } catch (IOException | ClassNotFoundException e) { - throw new UtilException(e.getMessage()); - } finally { - try { - assert oisPrivate != null; - oisPrivate.close(); - oisPublic.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return keyPairMap; - } - - /** - * 加密方法 - * @param source 源数据 - * @return 加密后的字符串 - */ - public String encrypt(String source, Key publicKey) { - Base64.Encoder encoder = Base64.getEncoder(); - String encryptSource = null; - try { - //得到Cipher对象来实现对源数据的RSA加密 - Cipher cipher = Cipher.getInstance(keyPairConfig.getAlgorithm()); - cipher.init(Cipher.ENCRYPT_MODE, publicKey); - byte[] bytes = source.getBytes(); - //执行加密操作 - encryptSource = encoder.encodeToString(cipher.doFinal(bytes)); - } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | - BadPaddingException e) { - throw new UtilException(e.getMessage()); - } - return encryptSource; - } - - /** - * 加密方法 - * @param source 源数据 - * @return 加密后的字符串 - */ - public String encrypt(String source) { - return encrypt(source, getKeyFromFile(keyPairConfig.getPublicKeyFile())); - } - - /** - * 解密方法 - * @param source 密文 - * @return 解密后的字符串 - */ - public String decrypt(String source) { - return decrypt(source,keyPairConfig.getPrivateKeyFile()); - } - - public String decrypt(String source, String privateKeyFile) { - Key privateKey = getKeyFromFile(privateKeyFile); - Base64.Decoder decoder = Base64.getDecoder(); - String decryptSource = null; - try { - //得到Cipher对象对已用公钥加密的数据进行RSA解密 - Cipher cipher = Cipher.getInstance(keyPairConfig.getAlgorithm()); - cipher.init(Cipher.DECRYPT_MODE, privateKey); - //执行解密操作 - byte[] bytes = decoder.decode(source); - decryptSource = new String(cipher.doFinal(bytes), StandardCharsets.UTF_8); - } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | - IllegalBlockSizeException | BadPaddingException e) { - throw new UtilException(e.getMessage()); - } - return decryptSource; - } - - public String decrypt(String source, Key privateKey) { - Base64.Decoder decoder = Base64.getDecoder(); - String decryptSource = null; - try { - //得到Cipher对象对已用公钥加密的数据进行RSA解密 - Cipher cipher = Cipher.getInstance(keyPairConfig.getAlgorithm()); - cipher.init(Cipher.DECRYPT_MODE, privateKey); - //执行解密操作 - byte[] bytes = decoder.decode(source); - decryptSource = new String(cipher.doFinal(bytes), StandardCharsets.UTF_8); - } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | - IllegalBlockSizeException | BadPaddingException e) { - throw new UtilException(e.getMessage()); - } - return decryptSource; - } - -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/ServletUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/ServletUtils.java index 7be6bd9..3c04f7d 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/ServletUtils.java +++ b/Cpop-Core/src/main/java/com/cpop/core/utils/ServletUtils.java @@ -1,7 +1,9 @@ package com.cpop.core.utils; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HtmlUtil; import com.alibaba.fastjson2.JSONObject; -import com.cpop.core.utils.text.Convert; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpSession; @@ -12,22 +14,36 @@ import org.springframework.web.context.request.ServletRequestAttributes; import java.io.BufferedReader; import java.io.IOException; + /** * 客户端工具类 * * @author DB + * @version 1.1.0 + * @since 2024/05/23 */ public class ServletUtils { /** - * 获取String参数 + * 获取参数 + * + * @param name 参数key + * @return {@link String } + * @author DB + * @since 2024/05/23 */ public static String getParameter(String name) { return getRequest().getParameter(name); } /** - * 获取String参数 + * 获取参数 + * + * @param name 参数key + * @param defaultValue 默认值 + * @return {@link String } + * @author DB + * @since 2024/05/23 */ public static String getParameter(String name, String defaultValue) { return Convert.toStr(getRequest().getParameter(name), defaultValue); @@ -35,10 +51,15 @@ public class ServletUtils { /** * 获取Integer参数 + * + * @param name 参数key + * @return {@link Integer } + * @author DB + * @since 2024/05/23 */ public static Integer getParameterToInt(String name) { String parameter = getRequest().getParameter(name); - if (StringUtils.isBlank(parameter)){ + if (StrUtil.isBlank(parameter)){ //尝试从请求体中获取 BufferedReader reader; try { @@ -64,6 +85,12 @@ public class ServletUtils { /** * 获取Integer参数 + * + * @param name 参数key + * @param defaultValue 默认值 + * @return {@link Integer } + * @author DB + * @since 2024/05/23 */ public static Integer getParameterToInt(String name, Integer defaultValue) { return Convert.toInt(getRequest().getParameter(name), defaultValue); @@ -71,6 +98,11 @@ public class ServletUtils { /** * 获取Boolean参数 + * + * @param name 参数key + * @return {@link Boolean } + * @author DB + * @since 2024/05/23 */ public static Boolean getParameterToBool(String name) { return Convert.toBool(getRequest().getParameter(name)); @@ -78,6 +110,12 @@ public class ServletUtils { /** * 获取Boolean参数 + * + * @param name 参数key + * @param defaultValue 默认值 + * @return {@link Boolean } + * @author DB + * @since 2024/05/23 */ public static Boolean getParameterToBool(String name, Boolean defaultValue) { return Convert.toBool(getRequest().getParameter(name), defaultValue); @@ -85,6 +123,10 @@ public class ServletUtils { /** * 获取request + * + * @return {@link HttpServletRequest } + * @author DB + * @since 2024/05/23 */ public static HttpServletRequest getRequest() { return getRequestAttributes().getRequest(); @@ -92,6 +134,10 @@ public class ServletUtils { /** * 获取response + * + * @return {@link HttpServletResponse } + * @author DB + * @since 2024/05/23 */ public static HttpServletResponse getResponse() { return getRequestAttributes().getResponse(); @@ -99,11 +145,22 @@ public class ServletUtils { /** * 获取session + * + * @return {@link HttpSession } + * @author DB + * @since 2024/05/23 */ public static HttpSession getSession() { return getRequest().getSession(); } + /** + * 获取请求属性 + * + * @return {@link ServletRequestAttributes } + * @author DB + * @since 2024/05/23 + */ public static ServletRequestAttributes getRequestAttributes() { RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); return (ServletRequestAttributes) attributes; @@ -114,9 +171,10 @@ public class ServletUtils { * * @param response 渲染对象 * @param string 待渲染的字符串 - * @return null + * @author DB + * @since 2024/05/23 */ - public static String renderString(HttpServletResponse response, String string) { + public static void renderString(HttpServletResponse response, String string) { try { response.setStatus(200); response.setContentType("application/json"); @@ -125,15 +183,18 @@ public class ServletUtils { } catch (IOException e) { e.printStackTrace(); } - return null; } + /** - * 是否是Ajax异步请求 + * 是ajax请求 * - * @param request + * @param request 请求 + * @return {@link Boolean } + * @author DB + * @since 2024/05/23 */ - public static boolean isAjaxRequest(HttpServletRequest request) { + public static Boolean isAjaxRequest(HttpServletRequest request) { String accept = request.getHeader("accept"); if (accept != null && accept.contains("application/json")) { return true; @@ -145,12 +206,51 @@ public class ServletUtils { } String uri = request.getRequestURI(); - if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { + if (StrUtil.containsAnyIgnoreCase(uri, ".json", ".xml")) { return true; } String ajax = request.getParameter("__ajax"); - return StringUtils.inStringIgnoreCase(ajax, "json", "xml"); + return StrUtil.containsAnyIgnoreCase(ajax, "json", "xml"); + } + + /** + * 获取IP地址 + * + * @param request 请求 + * @return {@link String } + * @author DB + * @since 2024/05/24 + */ + public static String getIpAddr(HttpServletRequest request) + { + if (request == null) + { + return "unknown"; + } + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Forwarded-For"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getHeader("X-Real-IP"); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) + { + ip = request.getRemoteAddr(); + } + return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.removeHtmlTag(ip); } } diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/SpringUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/SpringUtils.java index 268525b..7d33740 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/SpringUtils.java +++ b/Cpop-Core/src/main/java/com/cpop/core/utils/SpringUtils.java @@ -1,11 +1,8 @@ package com.cpop.core.utils; -import com.cpop.core.utils.StringUtils; import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.exception.BaseException; import com.mybatisflex.core.service.IService; import org.springframework.aop.framework.AopContext; -import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; @@ -14,11 +11,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - /** * spring工具类 方便在非spring管理环境中获取bean * @@ -133,8 +125,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC * @return 当前的环境配置 */ public static String getActiveProfile() { - final String[] activeProfiles = getActiveProfiles(); - return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; + return getActiveProfiles()[0]; } /** @@ -153,37 +144,4 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC return entity.replaceAll("", "") + "Service"; } - public List copyProperties(List sources, Class clazz) { - List list = new ArrayList<>(); - if (sources == null || sources.isEmpty()) { - return list; - } - for (E item : sources) { - T t = null; - try { - t = clazz.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { - e.printStackTrace(); - throw new BaseException(e.getMessage()); - } - BeanUtils.copyProperties(item, t); - list.add(t); - } - return list; - } - - /** - * StringToList - * - * @param longs - * @return - */ - public List stringToLongList(String longs) { - - if (StringUtils.isBlank(longs)) { - return null; - } - String[] split = longs.split(","); - return Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList()); - } } diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/SqlUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/SqlUtils.java index 2f2e7e3..7fd130c 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/SqlUtils.java +++ b/Cpop-Core/src/main/java/com/cpop/core/utils/SqlUtils.java @@ -1,5 +1,6 @@ package com.cpop.core.utils; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.UtilException; @@ -53,6 +54,10 @@ public class SqlUtils { /** * 封装分页对象 + * + * @return {@link PageDomain } + * @author DB + * @since 2024/05/23 */ public PageDomain getPageDomain() { PageDomain pageDomain = new PageDomain(); @@ -64,15 +69,27 @@ public class SqlUtils { return pageDomain; } + /** + * 构建页请求 + * + * @return {@link PageDomain } + * @author DB + * @since 2024/05/23 + */ public PageDomain buildPageRequest() { return getPageDomain(); } /** * 检查字符,防止注入绕过 + * + * @param value 价值 + * @return {@link String } + * @author DB + * @since 2024/05/23 */ public String escapeOrderBySql(String value) { - if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) { + if (StrUtil.isNotEmpty(value) && !isValidOrderBySql(value)) { throw new UtilException("参数不符合规范,不能进行查询"); } return value; @@ -80,6 +97,11 @@ public class SqlUtils { /** * 验证 order by 语法是否符合规范 + * + * @param value 价值 + * @return boolean + * @author DB + * @since 2024/05/23 */ public boolean isValidOrderBySql(String value) { return value.matches(SQL_PATTERN); @@ -87,10 +109,14 @@ public class SqlUtils { /** * 设置请求排序数据 + * + * @return {@link String } + * @author DB + * @since 2024/05/23 */ public String startOrderBy() { PageDomain pageDomain = getPageDomain(); - if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) { + if (StrUtil.isNotEmpty(pageDomain.getOrderBy())) { return escapeOrderBySql(pageDomain.getOrderBy()); }else { throw new UtilException("获取排序参数失败"); diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/StringUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/StringUtils.java deleted file mode 100644 index ada7dfb..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/StringUtils.java +++ /dev/null @@ -1,582 +0,0 @@ -package com.cpop.core.utils; - -import com.cpop.core.constant.Constants; -import com.cpop.core.utils.text.StrFormatter; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.util.AntPathMatcher; - -import java.nio.charset.StandardCharsets; -import java.util.*; - -/** - * 字符串工具类 - * - * @author DB - */ -public class StringUtils extends org.apache.commons.lang3.StringUtils { - /** - * 空字符串 - */ - private static final String NULL_STR = ""; - - /** - * 下划线 - */ - private static final char SEPARATOR = '_'; - - /** - * 获取参数不为空值 - * - * @param value defaultValue 要判断的value - * @return value 返回值 - */ - public static T nvl(T value, T defaultValue) { - return value != null ? value : defaultValue; - } - - /** - * * 判断一个Collection是否为空, 包含List,Set,Queue - * - * @param coll 要判断的Collection - * @return true:为空 false:非空 - */ - public static boolean isEmpty(Collection coll) { - return isNull(coll) || coll.isEmpty(); - } - - /** - * * 判断一个Collection是否非空,包含List,Set,Queue - * - * @param coll 要判断的Collection - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Collection coll) { - return !isEmpty(coll); - } - - /** - * * 判断一个对象数组是否为空 - * - * @param objects 要判断的对象数组 - * * @return true:为空 false:非空 - */ - public static boolean isEmpty(Object[] objects) { - return isNull(objects) || (objects.length == 0); - } - - /** - * * 判断一个对象数组是否非空 - * - * @param objects 要判断的对象数组 - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Object[] objects) { - return !isEmpty(objects); - } - - /** - * * 判断一个Map是否为空 - * - * @param map 要判断的Map - * @return true:为空 false:非空 - */ - public static boolean isEmpty(Map map) { - return isNull(map) || map.isEmpty(); - } - - /** - * * 判断一个Map是否为空 - * - * @param map 要判断的Map - * @return true:非空 false:空 - */ - public static boolean isNotEmpty(Map map) { - return !isEmpty(map); - } - - /** - * * 判断一个字符串是否为空串 - * - * @param str String - * @return true:为空 false:非空 - */ - public static boolean isEmpty(String str) { - return isNull(str) || NULL_STR.equals(str.trim()); - } - - /** - * * 判断一个字符串是否为非空串 - * - * @param str String - * @return true:非空串 false:空串 - */ - public static boolean isNotEmpty(String str) { - return !isEmpty(str); - } - - /** - * * 判断一个对象是否为空 - * - * @param object Object - * @return true:为空 false:非空 - */ - public static boolean isNull(Object object) { - return object == null; - } - - /** - * * 判断一个对象是否非空 - * - * @param object Object - * @return true:非空 false:空 - */ - public static boolean isNotNull(Object object) { - return !isNull(object); - } - - /** - * * 判断一个对象是否是数组类型(Java基本型别的数组) - * - * @param object 对象 - * @return true:是数组 false:不是数组 - */ - public static boolean isArray(Object object) { - return isNotNull(object) && object.getClass().isArray(); - } - - /** - * 去空格 - */ - public static String trim(String str) { - return (str == null ? "" : str.trim()); - } - - /** - * 截取字符串 - * - * @param str 字符串 - * @param start 开始 - * @return 结果 - */ - public static String substring(final String str, int start) { - if (str == null) { - return NULL_STR; - } - - if (start < 0) { - start = str.length() + start; - } - - if (start < 0) { - start = 0; - } - if (start > str.length()) { - return NULL_STR; - } - - return str.substring(start); - } - - /** - * 截取字符串 - * - * @param str 字符串 - * @param start 开始 - * @param end 结束 - * @return 结果 - */ - public static String substring(final String str, int start, int end) { - if (str == null) { - return NULL_STR; - } - - if (end < 0) { - end = str.length() + end; - } - if (start < 0) { - start = str.length() + start; - } - - if (end > str.length()) { - end = str.length(); - } - - if (start > end) { - return NULL_STR; - } - - if (start < 0) { - start = 0; - } - if (end < 0) { - end = 0; - } - - return str.substring(start, end); - } - - /** - * 格式化文本, {} 表示占位符
- * 此方法只是简单将占位符 {} 按照顺序替换为参数
- * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
- * 例:
- * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
- * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
- * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- * - * @param template 文本模板,被替换的部分用 {} 表示 - * @param params 参数值 - * @return 格式化后的文本 - */ - public static String format(String template, Object... params) { - if (isEmpty(params) || isEmpty(template)) { - return template; - } - return StrFormatter.format(template, params); - } - - /** - * 是否为http(s)://开头 - * - * @param link 链接 - * @return 结果 - */ - public static boolean isHttp(String link) { - return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS); - } - - /** - * 字符串转set - * - * @param str 字符串 - * @param sep 分隔符 - * @return set集合 - */ - public static Set str2Set(String str, String sep) { - return new HashSet(str2List(str, sep, true, false)); - } - - /** - * 字符串转list - * - * @param str 字符串 - * @param sep 分隔符 - * @param filterBlank 过滤纯空白 - * @param trim 去掉首尾空白 - * @return list集合 - */ - public static List str2List(String str, String sep, boolean filterBlank, boolean trim) { - List list = new ArrayList(); - if (StringUtils.isEmpty(str)) { - return list; - } - - // 过滤空白字符串 - if (filterBlank && StringUtils.isBlank(str)) { - return list; - } - String[] split = str.split(sep); - for (String string : split) { - if (filterBlank && StringUtils.isBlank(string)) { - continue; - } - if (trim) { - string = string.trim(); - } - list.add(string); - } - - return list; - } - - /** - * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写 - * - * @param cs 指定字符串 - * @param searchCharSequences 需要检查的字符串数组 - * @return 是否包含任意一个字符串 - */ - public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) { - if (isEmpty(cs) || isEmpty(searchCharSequences)) { - return false; - } - for (CharSequence testStr : searchCharSequences) { - if (containsIgnoreCase(cs, testStr)) { - return true; - } - } - return false; - } - - /** - * 驼峰转下划线命名 - */ - public static String toUnderScoreCase(String str) { - if (str == null) { - return null; - } - StringBuilder sb = new StringBuilder(); - // 前置字符是否大写 - boolean preCharIsUpperCase = true; - // 当前字符是否大写 - boolean curreCharIsUpperCase = true; - // 下一字符是否大写 - boolean nexteCharIsUpperCase = true; - for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (i > 0) { - preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1)); - } else { - preCharIsUpperCase = false; - } - - curreCharIsUpperCase = Character.isUpperCase(c); - - if (i < (str.length() - 1)) { - nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1)); - } - - if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) { - sb.append(SEPARATOR); - } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) { - sb.append(SEPARATOR); - } - sb.append(Character.toLowerCase(c)); - } - - return sb.toString(); - } - - /** - * 是否包含字符串 - * - * @param str 验证字符串 - * @param strs 字符串组 - * @return 包含返回true - */ - public static boolean inStringIgnoreCase(String str, String... strs) { - if (str != null && strs != null) { - for (String s : strs) { - if (str.equalsIgnoreCase(trim(s))) { - return true; - } - } - } - return false; - } - - /** - * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld - * - * @param name 转换前的下划线大写方式命名的字符串 - * @return 转换后的驼峰式命名的字符串 - */ - public static String convertToCamelCase(String name) { - StringBuilder result = new StringBuilder(); - // 快速检查 - if (name == null || name.isEmpty()) { - // 没必要转换 - return ""; - } else if (!name.contains("_")) { - // 不含下划线,仅将首字母大写 - return name.substring(0, 1).toUpperCase() + name.substring(1); - } - // 用下划线将原始字符串分割 - String[] camels = name.split("_"); - for (String camel : camels) { - // 跳过原始字符串中开头、结尾的下换线或双重下划线 - if (camel.isEmpty()) { - continue; - } - // 首字母大写 - result.append(camel.substring(0, 1).toUpperCase()); - result.append(camel.substring(1).toLowerCase()); - } - return result.toString(); - } - - /** - * 驼峰式命名法 例如:user_name->userName - */ - public static String toCamelCase(String s) { - if (s == null) { - return null; - } - s = s.toLowerCase(); - StringBuilder sb = new StringBuilder(s.length()); - boolean upperCase = false; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - - if (c == SEPARATOR) { - upperCase = true; - } else if (upperCase) { - sb.append(Character.toUpperCase(c)); - upperCase = false; - } else { - sb.append(c); - } - } - return sb.toString(); - } - - /** - * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 - * - * @param str 指定字符串 - * @param strs 需要检查的字符串数组 - * @return 是否匹配 - */ - public static boolean matches(String str, List strs) { - if (isEmpty(str) || isEmpty(strs)) { - return false; - } - for (String pattern : strs) { - if (isMatch(pattern, str)) { - return true; - } - } - return false; - } - - /** - * 判断url是否与规则配置: - * ? 表示单个字符; - * * 表示一层路径内的任意字符串,不可跨层级; - * ** 表示任意层路径; - * - * @param pattern 匹配规则 - * @param url 需要匹配的url - * @return - */ - public static boolean isMatch(String pattern, String url) { - AntPathMatcher matcher = new AntPathMatcher(); - return matcher.match(pattern, url); - } - - @SuppressWarnings("unchecked") - public static T cast(Object obj) { - return (T) obj; - } - - - /** - * 首字母大写(进行字母的ascii编码前移,效率是最高的) - * - * @param fieldName 需要转化的字符串 - */ - public static String getMethodName(String fieldName) { - char[] chars = fieldName.toCharArray(); - chars[0] = toUpperCase(chars[0]); - return String.valueOf(chars); - } - - - /** - * 字符转成大写 - * - * @param c 需要转化的字符 - */ - public static char toUpperCase(char c) { - if (97 <= c && c <= 122) { - c ^= 32; - } - return c; - } - - /** - * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 - * - * @param num 数字对象 - * @param size 字符串指定长度 - * @return 返回数字的字符串格式,该字符串为指定长度。 - */ - public static String padL(final Number num, final int size) - { - return padL(num.toString(), size, '0'); - } - - /** - * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 - * - * @param s 原始字符串 - * @param size 字符串指定长度 - * @param c 用于补齐的字符 - * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。 - */ - public static String padL(final String s, final int size, final char c) - { - final StringBuilder sb = new StringBuilder(size); - if (s != null) - { - final int len = s.length(); - if (s.length() <= size) - { - for (int i = size - len; i > 0; i--) - { - sb.append(c); - } - sb.append(s); - } - else - { - return s.substring(len - size, len); - } - } - else - { - for (int i = size; i > 0; i--) - { - sb.append(c); - } - } - return sb.toString(); - } - - /** - * - * @param aString 要截取的字符串 - * @param startIndex 开始下标 - * @param endIndex 截取长度 - */ - public static String substringByte(String aString,int startIndex,int endIndex) { - byte[] bytes = aString.getBytes(StandardCharsets.UTF_8); - int subLen = endIndex - startIndex; - if (startIndex < 0) { - return "startIndex异常"; - } - if (endIndex > bytes.length) { - return "endIndex异常"; - } - if (subLen <= 0) { - return "startIndex或endIndex异常"; - } - byte[] subBytes = new byte[subLen]; - int i = 0; - while (startIndex < endIndex) { - subBytes[i++] = bytes[startIndex++]; - } - return new String(subBytes, StandardCharsets.UTF_8); - } - - /** - * 字符串是否再匹配项内 - * @author DB - * @since 2024/2/5 - * @param string 字符串 - * @param searchStrings 匹配项 - * @return boolean - */ - public static boolean startWithAny(final CharSequence string, final CharSequence... searchStrings) { - if (isEmpty(string) || ArrayUtils.isEmpty(searchStrings)) { - return false; - } - for (final CharSequence searchString : searchStrings) { - if (StringUtils.startsWith(string, searchString)) { - return true; - } - } - return false; - } - -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/bean/BeanUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/bean/BeanUtils.java deleted file mode 100644 index 579734b..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/bean/BeanUtils.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.cpop.core.utils.bean; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Bean 工具类 - * - * @author DB - */ -public class BeanUtils extends org.springframework.beans.BeanUtils { - - private static final Logger LOGGER = LoggerFactory.getLogger(BeanUtils.class); - /** - * Bean方法名中属性名开始的下标 - */ - private static final int BEAN_METHOD_PROP_INDEX = 3; - - /** - * 匹配getter方法的正则表达式 - */ - private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); - - /** - * 匹配setter方法的正则表达式 - */ - private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); - - /** - * Bean属性复制工具方法。 - * - * @param dest 目标对象 - * @param src 源对象 - */ - public static void copyBeanProp(Object dest, Object src) { - try { - copyProperties(src, dest); - } catch (Exception e) { - LOGGER.error(e.getMessage()); - } - } - - /** - * 实体类转换 - * @param source 资源 - * @param target 目标 - * @param 目标类型 - * @return 转换结果 - */ - public static T sourceToTarget(Object source, Class target){ - if(source == null){ - return null; - } - T targetObject = null; - try { - targetObject = target.newInstance(); - BeanUtils.copyProperties(source, targetObject); - } catch (Exception e) { - LOGGER.error("实体类转换失败: ", e); - } - - return targetObject; - } - - /** - * 获取对象的setter方法。 - * - * @param obj 对象 - * @return 对象的setter方法列表 - */ - public static List getSetterMethods(Object obj) { - // setter方法列表 - List setterMethods = new ArrayList(); - - // 获取所有方法 - Method[] methods = obj.getClass().getMethods(); - - // 查找setter方法 - - for (Method method : methods) { - Matcher m = SET_PATTERN.matcher(method.getName()); - if (m.matches() && (method.getParameterTypes().length == 1)) { - setterMethods.add(method); - } - } - // 返回setter方法列表 - return setterMethods; - } - - /** - * 获取对象的getter方法。 - * - * @param obj 对象 - * @return 对象的getter方法列表 - */ - - public static List getGetterMethods(Object obj) { - // getter方法列表 - List getterMethods = new ArrayList(); - // 获取所有方法 - Method[] methods = obj.getClass().getMethods(); - // 查找getter方法 - for (Method method : methods) { - Matcher m = GET_PATTERN.matcher(method.getName()); - if (m.matches() && (method.getParameterTypes().length == 0)) { - getterMethods.add(method); - } - } - // 返回getter方法列表 - return getterMethods; - } - - /** - * 检查Bean方法名中的属性名是否相等。
- * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 - * - * @param m1 方法名1 - * @param m2 方法名2 - * @return 属性名一样返回true,否则返回false - */ - - public static boolean isMethodPropEquals(String m1, String m2) { - return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX)); - } - - /** - * 对象转换 - * - * @param sourceObject 原Object - * @param destinationClass 转换class - * @param 转换实体类 - * @param 原实体类 - * @return T - */ - public static T mapToClass(E sourceObject, Class destinationClass) { - T targetObject = instantiateClass(destinationClass); - copyProperties(sourceObject, targetObject); - return targetObject; - } - - /** - * List转换 - * - * @param sourceList 原List - * @param destinationClass 转换class - * @param 转换实体类 - * @param 原实体类 - * @return List - */ - public static List mapToList(List sourceList, Class destinationClass) { - List destinationList = new ArrayList<>(sourceList.size()); - for (E sourceObject : sourceList) { - T targetObject = instantiateClass(destinationClass); - copyProperties(sourceObject, targetObject); - destinationList.add(targetObject); - } - return destinationList; - } - - /** - * @param origin - * @param t - * @author LOST.yuan - * @Description map转对象 - * @date 11:52 2022/8/23 - **/ - public static void mapToObj(Map origin, T t) { - Class clazz = t.getClass(); - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) { - field.setAccessible(true); - String fieldName = field.getName(); - Object o = origin.get(fieldName); - if (o == null) { - continue; - } - String value = o.toString(); - try { - field.set(t, value); - } catch (IllegalAccessException e) { - LOGGER.error(e.getMessage()); - } - } - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileTypeUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileTypeUtils.java deleted file mode 100644 index 0f39590..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileTypeUtils.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.cpop.core.utils.file; - -import org.apache.commons.lang3.StringUtils; - -import java.io.File; - -/** - * 文件类型工具类 - * - * @author DB - */ -public class FileTypeUtils { - - public FileTypeUtils() { - } - - private static class FileTypeUtilsInstance { - private static final FileTypeUtils INSTANCE = new FileTypeUtils(); - } - - public static FileTypeUtils getInstance() { - return FileTypeUtilsInstance.INSTANCE; - } - - /** - * 获取文件类型 - * - * @param file 文件名 - * @return 后缀(不含".") - */ - public String getFileType(File file) { - if (null == file) { - return StringUtils.EMPTY; - } - return getFileType(file.getName()); - } - - /** - * 获取文件类型 - * @param fileName 文件名 - * @return 后缀(不含".") - */ - public String getFileType(String fileName) { - int separatorIndex = fileName.lastIndexOf("."); - if (separatorIndex < 0) { - return ""; - } - return fileName.substring(separatorIndex + 1).toLowerCase(); - } - - /** - * 获取文件类型 - * - * @param photoByte 文件字节码 - * @return 后缀(不含".") - */ - public String getFileExtendName(byte[] photoByte) { - String strFileExtendName = "JPG"; - if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) - && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) { - strFileExtendName = "GIF"; - } else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) { - strFileExtendName = "JPG"; - } else if ((photoByte[0] == 66) && (photoByte[1] == 77)) { - strFileExtendName = "BMP"; - } else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) { - strFileExtendName = "PNG"; - } - return strFileExtendName; - } -} \ No newline at end of file diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUploadUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUploadUtils.java deleted file mode 100644 index c0d8d08..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUploadUtils.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.cpop.core.utils.file; - -import com.cpop.core.config.CpopConfig; -import com.cpop.core.constant.Constants; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.base.exception.file.FileNameLengthLimitExceededException; -import com.cpop.core.base.exception.file.FileSizeLimitExceededException; -import com.cpop.core.base.exception.file.InvalidExtensionException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.uuid.Seq; -import org.apache.commons.io.FilenameUtils; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Paths; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.Objects; - -/** - * 文件上传工具类 - * - * @author DB - */ -public class FileUploadUtils { - - public FileUploadUtils() { - } - - private static class FileUploadUtilsInstance { - private static final FileUploadUtils INSTANCE = new FileUploadUtils(); - } - - public static FileUploadUtils getInstance() { - return FileUploadUtilsInstance.INSTANCE; - } - - /** - * 默认大小 50M - */ - public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024; - - /** - * 默认的文件名最大长度 100 - */ - public static final int DEFAULT_FILE_NAME_LENGTH = 100; - - /** - * 默认上传的地址 - */ - private static String defaultBaseDir = SpringUtils.getBean(CpopConfig.class).getProfile(); - - public void setDefaultBaseDir(String defaultBaseDir) { - FileUploadUtils.defaultBaseDir = defaultBaseDir; - } - - public String getDefaultBaseDir() { - return defaultBaseDir; - } - - /** - * 以默认配置进行文件上传 - * - * @param file 上传的文件 - * @return 文件名称 - * @throws Exception - */ - public final String upload(MultipartFile file) throws IOException { - try { - return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); - } catch (Exception e) { - throw new IOException(e.getMessage(), e); - } - } - - /** - * 根据文件路径上传 - * - * @param baseDir 相对应用的基目录 - * @param file 上传的文件 - * @return 文件名称 - * @throws IOException - */ - public final String upload(String baseDir, MultipartFile file) throws IOException { - try { - return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); - } catch (Exception e) { - throw new IOException(e.getMessage(), e); - } - } - - /** - * 文件上传 - * - * @param baseDir 相对应用的基目录 - * @param file 上传的文件 - * @param allowedExtension 上传文件类型 - * @return 返回上传成功的文件名 - * @throws FileSizeLimitExceededException 如果超出最大大小 - * @throws FileNameLengthLimitExceededException 文件名太长 - * @throws IOException 比如读写文件出错时 - * @throws InvalidExtensionException 文件校验异常 - */ - public final String upload(String baseDir, MultipartFile file, String[] allowedExtension) - throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, - InvalidExtensionException { - int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length(); - if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) { - throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH); - } - assertAllowed(file, allowedExtension); - String fileName = extractFilename(file); - String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath(); - file.transferTo(Paths.get(absPath)); - return getPathFileName(baseDir, fileName); - } - - /** - * 编码文件名 - */ - public final String extractFilename(MultipartFile file) { - return StringUtils.format("{}/{}_{}.{}", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")), - FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), getExtension(file)); - } - - public final File getAbsoluteFile(String uploadDir, String fileName) throws IOException { - File desc = new File(uploadDir + File.separator + fileName); - - if (!desc.exists()) { - if (!desc.getParentFile().exists()) { - desc.getParentFile().mkdirs(); - } - } - return desc; - } - - public final String getPathFileName(String uploadDir, String fileName) throws IOException { - int dirLastIndex = SpringUtils.getBean(CpopConfig.class).getProfile().length() + 1; - String currentDir = StringUtils.substring(uploadDir, dirLastIndex); - return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; - } - - /** - * 文件大小校验 - * - * @param file 上传的文件 - * @return - * @throws FileSizeLimitExceededException 如果超出最大大小 - * @throws InvalidExtensionException - */ - public final void assertAllowed(MultipartFile file, String[] allowedExtension) - throws FileSizeLimitExceededException, InvalidExtensionException { - long size = file.getSize(); - if (size > DEFAULT_MAX_SIZE) { - throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024); - } - - String fileName = file.getOriginalFilename(); - String extension = getExtension(file); - if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) { - if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) { - throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension, - fileName); - } else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION) { - throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension, - fileName); - } else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION) { - throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension, - fileName); - } else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION) { - throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension, - fileName); - } else { - throw new InvalidExtensionException(allowedExtension, extension, fileName); - } - } - } - - /** - * 判断MIME类型是否是允许的MIME类型 - * - * @param extension - * @param allowedExtension - * @return - */ - public final boolean isAllowedExtension(String extension, String[] allowedExtension) { - for (String str : allowedExtension) { - if (str.equalsIgnoreCase(extension)) { - return true; - } - } - return false; - } - - /** - * 获取文件名的后缀 - * - * @param file 表单文件 - * @return 后缀名 - */ - public final String getExtension(MultipartFile file) { - String extension = FilenameUtils.getExtension(file.getOriginalFilename()); - if (StringUtils.isEmpty(extension)) { - extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType())); - } - return extension; - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUtils.java deleted file mode 100644 index 8210687..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/file/FileUtils.java +++ /dev/null @@ -1,310 +0,0 @@ -package com.cpop.core.utils.file; - -import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.context.AnalysisContext; -import com.alibaba.excel.read.listener.ReadListener; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.config.CpopConfig; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.uuid.IdUtils; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.poi.ss.formula.functions.T; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.mock.web.MockMultipartFile; -import org.springframework.web.multipart.MultipartFile; - -import java.io.*; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * 文件处理工具类 - * - * @author DB - */ -public class FileUtils { - - private static final Logger LOGGER = LoggerFactory.getLogger(FileUtils.class); - - public FileUtils() { - } - - private static class FileUtilsInstance { - private static final FileUtils INSTANCE = new FileUtils(); - } - - public static FileUtils getInstance() { - return FileUtilsInstance.INSTANCE; - } - - public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; - - /** - * 输出指定文件的byte数组 - * - * @param filePath 文件路径 - * @param os 输出流 - * @return - */ - public void writeBytes(String filePath, OutputStream os) throws IOException { - FileInputStream fis = null; - try { - File file = new File(filePath); - if (!file.exists()) { - throw new FileNotFoundException(filePath); - } - fis = new FileInputStream(file); - byte[] b = new byte[1024]; - int length; - while ((length = fis.read(b)) > 0) { - os.write(b, 0, length); - } - } catch (IOException e) { - throw e; - } finally { - IOUtils.close(os); - IOUtils.close(fis); - } - } - - /** - * 写数据到文件中 - * - * @param data 数据 - * @return 目标文件 - * @throws IOException IO异常 - */ - public String writeImportBytes(byte[] data) throws IOException { - return writeBytes(data, SpringUtils.getBean(CpopConfig.class).getImportPath()); - } - - /** - * 写数据到文件中 - * - * @param data 数据 - * @param uploadDir 目标文件 - * @return 目标文件 - * @throws IOException IO异常 - */ - public String writeBytes(byte[] data, String uploadDir) throws IOException { - FileOutputStream fos = null; - String pathName = ""; - try { - String extension = getFileExtendName(data); - pathName = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + "/" + IdUtils.fastUUID() + "." + extension; - File file = FileUploadUtils.getInstance().getAbsoluteFile(uploadDir, pathName); - fos = new FileOutputStream(file); - fos.write(data); - } finally { - IOUtils.close(fos); - } - return FileUploadUtils.getInstance().getPathFileName(uploadDir, pathName); - } - - /** - * 删除文件 - * - * @param filePath 文件 - * @return - */ - public boolean deleteFile(String filePath) { - boolean flag = false; - File file = new File(filePath); - // 路径为文件且不为空则进行删除 - if (file.isFile() && file.exists()) { - flag = file.delete(); - } - return flag; - } - - /** - * 文件名称验证 - * - * @param filename 文件名称 - * @return true 正常 false 非法 - */ - public boolean isValidFilename(String filename) { - return filename.matches(FILENAME_PATTERN); - } - - /** - * 检查文件是否可下载 - * - * @param resource 需要下载的文件 - * @return true 正常 false 非法 - */ - public boolean checkAllowDownload(String resource) { - // 禁止目录上跳级别 - if (StringUtils.contains(resource, "..")) { - return false; - } - - // 检查允许下载的文件规则 - if (ArrayUtils.contains(MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION, FileTypeUtils.getInstance().getFileType(resource))) { - return true; - } - - // 不在允许下载的文件规则 - return false; - } - - /** - * 下载文件名重新编码 - * - * @param request 请求对象 - * @param fileName 文件名 - * @return 编码后的文件名 - */ - public String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException { - final String agent = request.getHeader("USER-AGENT"); - String filename = fileName; - if (agent.contains("MSIE")) { - // IE浏览器 - filename = URLEncoder.encode(filename, "utf-8"); - filename = filename.replace("+", " "); - } else if (agent.contains("Firefox")) { - // 火狐浏览器 - filename = new String(fileName.getBytes(), "ISO8859-1"); - } else if (agent.contains("Chrome")) { - // google浏览器 - filename = URLEncoder.encode(filename, "utf-8"); - } else { - // 其它浏览器 - filename = URLEncoder.encode(filename, "utf-8"); - } - return filename; - } - - /** - * 下载文件名重新编码 - * - * @param response 响应对象 - * @param realFileName 真实文件名 - */ - public void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException { - String percentEncodedFileName = percentEncode(realFileName); - - StringBuilder contentDispositionValue = new StringBuilder(); - contentDispositionValue.append("attachment; filename=") - .append(percentEncodedFileName) - .append(";") - .append("filename*=") - .append("utf-8''") - .append(percentEncodedFileName); - - response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); - response.setHeader("Content-disposition", contentDispositionValue.toString()); - response.setHeader("download-filename", percentEncodedFileName); - } - - /** - * 百分号编码工具方法 - * - * @param s 需要百分号编码的字符串 - * @return 百分号编码后的字符串 - */ - public String percentEncode(String s) throws UnsupportedEncodingException { - String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString()); - return encode.replaceAll("\\+", "%20"); - } - - /** - * 获取图像后缀 - * - * @param photoByte 图像数据 - * @return 后缀名 - */ - public String getFileExtendName(byte[] photoByte) { - String strFileExtendName = "jpg"; - if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) - && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97)) { - strFileExtendName = "gif"; - } else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70)) { - strFileExtendName = "jpg"; - } else if ((photoByte[0] == 66) && (photoByte[1] == 77)) { - strFileExtendName = "bmp"; - } else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71)) { - strFileExtendName = "png"; - } - return strFileExtendName; - } - - /** - * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png - * - * @param fileName 路径名称 - * @return 没有文件路径的名称 - */ - public String getName(String fileName) { - if (fileName == null) { - return null; - } - int lastUnixPos = fileName.lastIndexOf('/'); - int lastWindowsPos = fileName.lastIndexOf('\\'); - int index = Math.max(lastUnixPos, lastWindowsPos); - return fileName.substring(index + 1); - } - - /** - * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi - * - * @param fileName 路径名称 - * @return 没有文件路径和后缀的名称 - */ - public String getNameNotSuffix(String fileName) { - if (fileName == null) { - return null; - } - return FilenameUtils.getBaseName(fileName); - } - - /** - * @Description: 读取Excel - * @param filePath - * @param list - * @return - * @author DB - * @Date: 2023/7/14 0014 13:53 - */ - public void readExcel(String filePath, List list) { - //excel文件路径 - File file = new File(filePath); - EasyExcel.read(file, T.class, new ReadListener() { - @Override - public void invoke(T t, AnalysisContext analysisContext) { - list.add(t); - } - - @Override - public void doAfterAllAnalysed(AnalysisContext analysisContext) { - LOGGER.info("read finished"); - } - }).sheet("sheet1").doRead(); - } - - /** - * 文件转上传文件格式 - * @author DB - * @since 2023/12/08 - * @param file 文件 - * @return MultipartFile 上传文件 - */ - public MultipartFile getMultipartFile(File file) throws IOException { - FileInputStream fileInputStream = new FileInputStream(file); - return new MockMultipartFile( - "file", - file.getName(), - "text/plain", - fileInputStream); - } - -} - diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/file/MimeTypeUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/file/MimeTypeUtils.java deleted file mode 100644 index 34ac89f..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/file/MimeTypeUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.cpop.core.utils.file; - -/** - * 媒体类型工具类 - * - * @author DB - */ -public class MimeTypeUtils { - public static final String IMAGE_PNG = "image/png"; - - public static final String IMAGE_JPG = "image/jpg"; - - public static final String IMAGE_JPEG = "image/jpeg"; - - public static final String IMAGE_BMP = "image/bmp"; - - public static final String IMAGE_GIF = "image/gif"; - - public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"}; - - public static final String[] FLASH_EXTENSION = {"swf", "flv"}; - - public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", - "asf", "rm", "rmvb"}; - - public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"}; - - public static final String[] DEFAULT_ALLOWED_EXTENSION = { - // 图片 - "bmp", "gif", "jpg", "jpeg", "png", - // word excel powerpoint - "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt", - // 压缩文件 - "rar", "zip", "gz", "bz2", - // 视频格式 - "mp4", "avi", "rmvb", - // pdf - "pdf"}; - - public static String getExtension(String prefix) { - switch (prefix) { - case IMAGE_PNG: - return "png"; - case IMAGE_JPG: - return "jpg"; - case IMAGE_JPEG: - return "jpeg"; - case IMAGE_BMP: - return "bmp"; - case IMAGE_GIF: - return "gif"; - default: - return ""; - } - } -} - diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/html/EscapeUtil.java b/Cpop-Core/src/main/java/com/cpop/core/utils/html/EscapeUtil.java deleted file mode 100644 index a2f1caa..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/html/EscapeUtil.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.cpop.core.utils.html; - -import com.cpop.core.utils.StringUtils; - -/** - * 转义和反转义工具类 - * - * @author DB - */ -public class EscapeUtil { - public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)"; - - private static final char[][] TEXT = new char[64][]; - - static { - for (int i = 0; i < 64; i++) { - TEXT[i] = new char[]{(char) i}; - } - // special HTML characters - // 单引号 - TEXT['\''] = "'".toCharArray(); - // 双引号 - TEXT['"'] = """.toCharArray(); - // &符 - TEXT['&'] = "&".toCharArray(); - // 小于号 - TEXT['<'] = "<".toCharArray(); - // 大于号 - TEXT['>'] = ">".toCharArray(); - } - - /** - * 转义文本中的HTML字符为安全的字符 - * - * @param text 被转义的文本 - * @return 转义后的文本 - */ - public static String escape(String text) { - return encode(text); - } - - /** - * 还原被转义的HTML特殊字符 - * - * @param content 包含转义符的HTML内容 - * @return 转换后的字符串 - */ - public static String unescape(String content) { - return decode(content); - } - - /** - * 清除所有HTML标签,但是不删除标签内的内容 - * - * @param content 文本 - * @return 清除标签后的文本 - */ - public static String clean(String content) { - return new HTMLFilter().filter(content); - } - - /** - * Escape编码 - * - * @param text 被编码的文本 - * @return 编码后的字符 - */ - private static String encode(String text) { - if (StringUtils.isEmpty(text)) { - return StringUtils.EMPTY; - } - - final StringBuilder tmp = new StringBuilder(text.length() * 6); - char c; - for (int i = 0; i < text.length(); i++) { - c = text.charAt(i); - if (c < 256) { - tmp.append("%"); - if (c < 16) { - tmp.append("0"); - } - tmp.append(Integer.toString(c, 16)); - } else { - tmp.append("%u"); - if (c <= 0xfff) { - // issue#I49JU8@Gitee - tmp.append("0"); - } - tmp.append(Integer.toString(c, 16)); - } - } - return tmp.toString(); - } - - /** - * Escape解码 - * - * @param content 被转义的内容 - * @return 解码后的字符串 - */ - public static String decode(String content) { - if (StringUtils.isEmpty(content)) { - return content; - } - - StringBuilder tmp = new StringBuilder(content.length()); - int lastPos = 0, pos = 0; - char ch; - while (lastPos < content.length()) { - pos = content.indexOf("%", lastPos); - if (pos == lastPos) { - if (content.charAt(pos + 1) == 'u') { - ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16); - tmp.append(ch); - lastPos = pos + 6; - } else { - ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16); - tmp.append(ch); - lastPos = pos + 3; - } - } else { - if (pos == -1) { - tmp.append(content.substring(lastPos)); - lastPos = content.length(); - } else { - tmp.append(content.substring(lastPos, pos)); - lastPos = pos; - } - } - } - return tmp.toString(); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/html/HTMLFilter.java b/Cpop-Core/src/main/java/com/cpop/core/utils/html/HTMLFilter.java deleted file mode 100644 index 42e8781..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/html/HTMLFilter.java +++ /dev/null @@ -1,499 +0,0 @@ -package com.cpop.core.utils.html; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * HTML过滤器,用于去除XSS漏洞隐患。 - * - * @author DB - */ -public final class HTMLFilter { - /** - * regex flag union representing /si modifiers in php - **/ - private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; - private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL); - private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI); - private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL); - private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI); - private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI); - private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI); - private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI); - private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI); - private static final Pattern P_ENTITY = Pattern.compile("&#(\\d+);?"); - private static final Pattern P_ENTITY_UNICODE = Pattern.compile("&#x([0-9a-f]+);?"); - private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?"); - private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))"); - private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL); - private static final Pattern P_END_ARROW = Pattern.compile("^>"); - private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)"); - private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)"); - private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)"); - private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)"); - private static final Pattern P_AMP = Pattern.compile("&"); - private static final Pattern P_QUOTE = Pattern.compile("\""); - private static final Pattern P_LEFT_ARROW = Pattern.compile("<"); - private static final Pattern P_RIGHT_ARROW = Pattern.compile(">"); - private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>"); - - // @xxx could grow large... maybe use sesat's ReferenceMap - private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<>(); - private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<>(); - - /** - * set of allowed html elements, along with allowed attributes for each element - **/ - private final Map> vAllowed; - /** - * counts of open tags for each (allowable) html element - **/ - private final Map vTagCounts = new HashMap<>(); - - /** - * html elements which must always be self-closing (e.g. "") - **/ - private final String[] vSelfClosingTags; - /** - * html elements which must always have separate opening and closing tags (e.g. "") - **/ - private final String[] vNeedClosingTags; - /** - * set of disallowed html elements - **/ - private final String[] vDisallowed; - /** - * attributes which should be checked for valid protocols - **/ - private final String[] vProtocolAtts; - /** - * allowed protocols - **/ - private final String[] vAllowedProtocols; - /** - * tags which should be removed if they contain no content (e.g. "" or "") - **/ - private final String[] vRemoveBlanks; - /** - * entities allowed within html markup - **/ - private final String[] vAllowedEntities; - /** - * flag determining whether comments are allowed in input String. - */ - private final boolean stripComment; - private final boolean encodeQuotes; - /** - * flag determining whether to try to make tags when presented with "unbalanced" angle brackets (e.g. "" - * becomes " text "). If set to false, unbalanced angle brackets will be html escaped. - */ - private final boolean alwaysMakeTags; - - /** - * Default constructor. - */ - public HTMLFilter() { - vAllowed = new HashMap<>(); - - final ArrayList a_atts = new ArrayList<>(); - a_atts.add("href"); - a_atts.add("target"); - vAllowed.put("a", a_atts); - - final ArrayList img_atts = new ArrayList<>(); - img_atts.add("src"); - img_atts.add("width"); - img_atts.add("height"); - img_atts.add("alt"); - vAllowed.put("img", img_atts); - - final ArrayList no_atts = new ArrayList<>(); - vAllowed.put("b", no_atts); - vAllowed.put("strong", no_atts); - vAllowed.put("i", no_atts); - vAllowed.put("em", no_atts); - - vSelfClosingTags = new String[]{"img"}; - vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"}; - vDisallowed = new String[]{}; - // no ftp. - vAllowedProtocols = new String[]{"http", "mailto", "https"}; - vProtocolAtts = new String[]{"src", "href"}; - vRemoveBlanks = new String[]{"a", "b", "strong", "i", "em"}; - vAllowedEntities = new String[]{"amp", "gt", "lt", "quot"}; - stripComment = true; - encodeQuotes = true; - alwaysMakeTags = false; - } - - /** - * Map-parameter configurable constructor. - * - * @param conf map containing configuration. keys match field names. - */ - @SuppressWarnings("unchecked") - public HTMLFilter(final Map conf) { - - assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; - assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; - assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags"; - assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed"; - assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols"; - assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts"; - assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks"; - assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities"; - - vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed")); - vSelfClosingTags = (String[]) conf.get("vSelfClosingTags"); - vNeedClosingTags = (String[]) conf.get("vNeedClosingTags"); - vDisallowed = (String[]) conf.get("vDisallowed"); - vAllowedProtocols = (String[]) conf.get("vAllowedProtocols"); - vProtocolAtts = (String[]) conf.get("vProtocolAtts"); - vRemoveBlanks = (String[]) conf.get("vRemoveBlanks"); - vAllowedEntities = (String[]) conf.get("vAllowedEntities"); - stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true; - encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true; - alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; - } - - private void reset() { - vTagCounts.clear(); - } - - // --------------------------------------------------------------- - // my versions of some PHP library functions - public static String chr(final int decimal) { - return String.valueOf((char) decimal); - } - - public static String htmlSpecialChars(final String s) { - String result = s; - result = regexReplace(P_AMP, "&", result); - result = regexReplace(P_QUOTE, """, result); - result = regexReplace(P_LEFT_ARROW, "<", result); - result = regexReplace(P_RIGHT_ARROW, ">", result); - return result; - } - - // --------------------------------------------------------------- - - /** - * given a user submitted input String, filter out any invalid or restricted html. - * - * @param input text (i.e. submitted by a user) than may contain html - * @return "clean" version of input, with only valid, whitelisted html elements allowed - */ - public String filter(final String input) { - reset(); - String s = input; - - s = escapeComments(s); - - s = balanceHTML(s); - - s = checkTags(s); - - s = processRemoveBlanks(s); - - // s = validateEntities(s); - - return s; - } - - public boolean isAlwaysMakeTags() { - return alwaysMakeTags; - } - - public boolean isStripComments() { - return stripComment; - } - - private String escapeComments(final String s) { - final Matcher m = P_COMMENTS.matcher(s); - final StringBuffer buf = new StringBuffer(); - if (m.find()) { - // (.*?) - final String match = m.group(1); - m.appendReplacement(buf, Matcher.quoteReplacement("")); - } - m.appendTail(buf); - - return buf.toString(); - } - - private String balanceHTML(String s) { - if (alwaysMakeTags) { - // - // try and form html - // - s = regexReplace(P_END_ARROW, "", s); - // 不追加结束标签 - s = regexReplace(P_BODY_TO_END, "<$1>", s); - s = regexReplace(P_XML_CONTENT, "$1<$2", s); - - } else { - // - // escape stray brackets - // - s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s); - s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s); - - // - // the last regexp causes '<>' entities to appear - // (we need to do a lookahead assertion so that the last bracket can - // be used in the next pass of the regexp) - // - s = regexReplace(P_BOTH_ARROWS, "", s); - } - - return s; - } - - private String checkTags(String s) { - Matcher m = P_TAGS.matcher(s); - - final StringBuffer buf = new StringBuffer(); - while (m.find()) { - String replaceStr = m.group(1); - replaceStr = processTag(replaceStr); - m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); - } - m.appendTail(buf); - - // these get tallied in processTag - // (remember to reset before subsequent calls to filter method) - final StringBuilder sBuilder = new StringBuilder(buf.toString()); - for (String key : vTagCounts.keySet()) { - for (int ii = 0; ii < vTagCounts.get(key); ii++) { - sBuilder.append(""); - } - } - s = sBuilder.toString(); - - return s; - } - - private String processRemoveBlanks(final String s) { - String result = s; - for (String tag : vRemoveBlanks) { - if (!P_REMOVE_PAIR_BLANKS.containsKey(tag)) { - P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>")); - } - result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); - if (!P_REMOVE_SELF_BLANKS.containsKey(tag)) { - P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); - } - result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); - } - - return result; - } - - private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) { - Matcher m = regex_pattern.matcher(s); - return m.replaceAll(replacement); - } - - private String processTag(final String s) { - // ending tags - Matcher m = P_END_TAG.matcher(s); - if (m.find()) { - final String name = m.group(1).toLowerCase(); - if (allowed(name)) { - if (!inArray(name, vSelfClosingTags)) { - if (vTagCounts.containsKey(name)) { - vTagCounts.put(name, vTagCounts.get(name) - 1); - return ""; - } - } - } - } - - // starting tags - m = P_START_TAG.matcher(s); - if (m.find()) { - final String name = m.group(1).toLowerCase(); - final String body = m.group(2); - String ending = m.group(3); - - // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); - if (allowed(name)) { - final StringBuilder params = new StringBuilder(); - - final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); - final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); - final List paramNames = new ArrayList<>(); - final List paramValues = new ArrayList<>(); - while (m2.find()) { - paramNames.add(m2.group(1)); // ([a-z0-9]+) - paramValues.add(m2.group(3)); // (.*?) - } - while (m3.find()) { - paramNames.add(m3.group(1)); // ([a-z0-9]+) - paramValues.add(m3.group(3)); // ([^\"\\s']+) - } - - String paramName, paramValue; - for (int ii = 0; ii < paramNames.size(); ii++) { - paramName = paramNames.get(ii).toLowerCase(); - paramValue = paramValues.get(ii); - - // debug( "paramName='" + paramName + "'" ); - // debug( "paramValue='" + paramValue + "'" ); - // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); - - if (allowedAttribute(name, paramName)) { - if (inArray(paramName, vProtocolAtts)) { - paramValue = processParamProtocol(paramValue); - } - params.append(' ').append(paramName).append("=\\\"").append(paramValue).append("\""); - } - } - - if (inArray(name, vSelfClosingTags)) { - ending = " /"; - } - - if (inArray(name, vNeedClosingTags)) { - ending = ""; - } - - if (ending == null || ending.length() < 1) { - if (vTagCounts.containsKey(name)) { - vTagCounts.put(name, vTagCounts.get(name) + 1); - } else { - vTagCounts.put(name, 1); - } - } else { - ending = " /"; - } - return "<" + name + params + ending + ">"; - } else { - return ""; - } - } - - // comments - m = P_COMMENT.matcher(s); - if (!stripComment && m.find()) { - return "<" + m.group() + ">"; - } - - return ""; - } - - private String processParamProtocol(String s) { - s = decodeEntities(s); - final Matcher m = P_PROTOCOL.matcher(s); - if (m.find()) { - final String protocol = m.group(1); - if (!inArray(protocol, vAllowedProtocols)) { - // bad protocol, turn into local anchor link instead - s = "#" + s.substring(protocol.length() + 1); - if (s.startsWith("#//")) { - s = "#" + s.substring(3); - } - } - } - - return s; - } - - private String decodeEntities(String s) { - StringBuffer buf = new StringBuffer(); - - Matcher m = P_ENTITY.matcher(s); - while (m.find()) { - final String match = m.group(1); - final int decimal = Integer.decode(match); - m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); - } - m.appendTail(buf); - s = buf.toString(); - - buf = new StringBuffer(); - m = P_ENTITY_UNICODE.matcher(s); - while (m.find()) { - final String match = m.group(1); - final int decimal = Integer.valueOf(match, 16); - m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); - } - m.appendTail(buf); - s = buf.toString(); - - buf = new StringBuffer(); - m = P_ENCODE.matcher(s); - while (m.find()) { - final String match = m.group(1); - final int decimal = Integer.valueOf(match, 16); - m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); - } - m.appendTail(buf); - s = buf.toString(); - - s = validateEntities(s); - return s; - } - - private String validateEntities(final String s) { - StringBuffer buf = new StringBuffer(); - - // validate entities throughout the string - Matcher m = P_VALID_ENTITIES.matcher(s); - while (m.find()) { - final String one = m.group(1); // ([^&;]*) - final String two = m.group(2); // (?=(;|&|$)) - m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); - } - m.appendTail(buf); - - return encodeQuotes(buf.toString()); - } - - private String encodeQuotes(final String s) { - if (encodeQuotes) { - StringBuffer buf = new StringBuffer(); - Matcher m = P_VALID_QUOTES.matcher(s); - while (m.find()) { - final String one = m.group(1); // (>|^) - final String two = m.group(2); // ([^<]+?) - final String three = m.group(3); // (<|$) - // 不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two) - m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three)); - } - m.appendTail(buf); - return buf.toString(); - } else { - return s; - } - } - - private String checkEntity(final String preamble, final String term) { - - return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble; - } - - private boolean isValidEntity(final String entity) { - return inArray(entity, vAllowedEntities); - } - - private static boolean inArray(final String s, final String[] array) { - for (String item : array) { - if (item != null && item.equals(s)) { - return true; - } - } - return false; - } - - private boolean allowed(final String name) { - return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); - } - - private boolean allowedAttribute(final String name, final String paramName) { - return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpHelper.java b/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpHelper.java deleted file mode 100644 index c9120ae..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpHelper.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.cpop.core.utils.http; - -import jakarta.servlet.ServletRequest; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; - -/** - * 通用http工具封装 - * - * @author DB - */ -public class HttpHelper { - private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); - - /** - * 获取请求体信息失败 - * @author DB - * @since 2024/2/1 - * @param request 请求 - * @return String - */ - public static String getBodyString(ServletRequest request) { - StringBuilder sb = new StringBuilder(); - BufferedReader reader = null; - try (InputStream inputStream = request.getInputStream()) { - reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - String line = ""; - while ((line = reader.readLine()) != null) { - sb.append(line); - } - } catch (IOException e) { - LOGGER.warn("getBodyString出现问题!"); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - LOGGER.error(ExceptionUtils.getMessage(e)); - } - } - } - return sb.toString(); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpUtils.java deleted file mode 100644 index e2ff52d..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/http/HttpUtils.java +++ /dev/null @@ -1,376 +0,0 @@ -package com.cpop.core.utils.http; - -import com.cpop.core.constant.Constants; -import com.cpop.core.utils.StringUtils; -import okhttp3.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.ssl.*; -import java.io.*; -import java.net.*; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Map; - -/** - * 通用http发送方法 - * - * @author DB - */ -public class HttpUtils { - private static final Logger log = LoggerFactory.getLogger(HttpUtils.class); - - /** - * 向指定 URL 发送GET方法的请求 - * - * @param url 发送请求的 URL - * @return 所代表远程资源的响应结果 - */ - public static String sendGet(String url) { - return sendGet(url, StringUtils.EMPTY); - } - - /** - * 向指定 URL 发送GET方法的请求 - * - * @param url 发送请求的 URL - * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 - * @return 所代表远程资源的响应结果 - */ - public static String sendGet(String url, String param) { - return sendGet(url, param, Constants.UTF8); - } - - /** - * 向指定 URL 发送GET方法的请求 - * - * @param url 发送请求的 URL - * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 - * @param contentType 编码类型 - * @return 所代表远程资源的响应结果 - */ - public static String sendGet(String url, String param, String contentType) { - StringBuilder result = new StringBuilder(); - BufferedReader in = null; - try { - String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url; - log.info("sendGet - {}", urlNameString); - URL realUrl = new URL(urlNameString); - URLConnection connection = realUrl.openConnection(); - connection.setRequestProperty("accept", "*/*"); - connection.setRequestProperty("connection", "Keep-Alive"); - connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); - connection.connect(); - in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); - String line; - while ((line = in.readLine()) != null) { - result.append(line); - } - log.info("recv - {}", result); - } catch (ConnectException e) { - log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); - } catch (SocketTimeoutException e) { - log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); - } catch (IOException e) { - log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); - } catch (Exception e) { - log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); - } finally { - try { - if (in != null) { - in.close(); - } - } catch (Exception ex) { - log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); - } - } - return result.toString(); - } - - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url) { - BufferedReader in = null; - StringBuilder result = new StringBuilder(); - try { - log.info("sendPost - {}", url); - URL realUrl = new URL(url); - URLConnection conn = realUrl.openConnection(); - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); - conn.setRequestProperty("Accept-Charset", "utf-8"); - conn.setRequestProperty("contentType", "utf-8"); - conn.setDoOutput(true); - conn.setDoInput(true); - in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)); - String line; - while ((line = in.readLine()) != null) { - result.append(line); - } - log.info("rev - {}", result); - } catch (ConnectException e) { - log.error("调用HttpUtils.sendPost ConnectException, url=" + url, e); - } catch (SocketTimeoutException e) { - log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url, e); - } catch (IOException e) { - log.error("调用HttpUtils.sendPost IOException, url=" + url, e); - } catch (Exception e) { - log.error("调用HttpsUtil.sendPost Exception, url=" + url, e); - } finally { - try { - if (in != null) { - in.close(); - } - } catch (IOException ex) { - log.error("调用in.close Exception, url=" + url, ex); - } - } - return result.toString(); - } - - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url, String param) { - PrintWriter out = null; - BufferedReader in = null; - StringBuilder result = new StringBuilder(); - try { - log.info("sendPost - {}", url); - URL realUrl = new URL(url); - URLConnection conn = realUrl.openConnection(); - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); - conn.setRequestProperty("Accept-Charset", "utf-8"); - conn.setRequestProperty("contentType", "utf-8"); - conn.setDoOutput(true); - conn.setDoInput(true); - out = new PrintWriter(conn.getOutputStream()); - out.print(param); - out.flush(); - in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)); - String line; - while ((line = in.readLine()) != null) { - result.append(line); - } - log.info("recv - {}", result); - } catch (ConnectException e) { - log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); - } catch (SocketTimeoutException e) { - log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e); - } catch (IOException e) { - log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e); - } catch (Exception e) { - log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e); - } finally { - try { - if (out != null) { - out.close(); - } - if (in != null) { - in.close(); - } - } catch (IOException ex) { - log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); - } - } - return result.toString(); - } - - /** - * 向指定 URL 发送POST方法的请求 - * - * @param url 发送请求的 URL - * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 - * @return 所代表远程资源的响应结果 - */ - public static String sendPost(String url, String param, File file) throws IOException { - URL urlObj = new URL(url); - //连接 - HttpURLConnection con = (HttpURLConnection) urlObj.openConnection(); - String result = null; - con.setDoInput(true); - con.setDoOutput(true); - // post方式不能使用缓存 - con.setUseCaches(false); - // 设置请求头信息 - con.setRequestProperty("Connection", "Keep-Alive"); - con.setRequestProperty("Charset", "UTF-8"); - // 设置边界 - String BOUNDARY = "----------" + System.currentTimeMillis(); - con.setRequestProperty("Content-Type", - "multipart/form-data; boundary=" - + BOUNDARY); - // 请求正文信息 - // 第一部分: - StringBuilder sb = new StringBuilder(); - // 必须多两道线 - sb.append("--"); - sb.append(BOUNDARY); - sb.append("\r\n"); - sb.append("Content-Disposition: form-data;name=\"media\";filelength=\"").append(file.length()).append("\";filename=\"").append(file.getName()).append("\"\r\n"); - sb.append("Content-Type:application/octet-stream\r\n\r\n"); - byte[] head = sb.toString().getBytes(StandardCharsets.UTF_8); - // 获得输出流 - OutputStream out = new DataOutputStream(con.getOutputStream()); - // 输出表头 - out.write(head); - // 文件正文部分 - // 把文件已流文件的方式 推入到url中 - DataInputStream in = new DataInputStream(Files.newInputStream(file.toPath())); - int bytes = 0; - byte[] bufferOut = new byte[1024]; - while ((bytes = in.read(bufferOut)) != -1) { - out.write(bufferOut, 0, bytes); - } - in.close(); - // 结尾部分 - // 定义最后数据分隔线 - byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes(StandardCharsets.UTF_8); - out.write(foot); - out.flush(); - out.close(); - StringBuilder buffer = new StringBuilder(); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()))) { - // 定义BufferedReader输入流来读取URL的响应 - String line = null; - while ((line = reader.readLine()) != null) { - buffer.append(line); - } - result = buffer.toString(); - } catch (IOException e) { - System.out.println("发送POST请求出现异常!" + e); - e.printStackTrace(); - } - return result; - } - - public static String sendSSLPost(String url, String param) { - StringBuilder result = new StringBuilder(); - String urlNameString = url + "?" + param; - try { - log.info("sendSSLPost - {}", urlNameString); - SSLContext sc = SSLContext.getInstance("SSL"); - sc.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom()); - URL console = new URL(urlNameString); - HttpsURLConnection conn = (HttpsURLConnection) console.openConnection(); - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); - conn.setRequestProperty("Accept-Charset", "utf-8"); - conn.setRequestProperty("contentType", "utf-8"); - conn.setDoOutput(true); - conn.setDoInput(true); - - conn.setSSLSocketFactory(sc.getSocketFactory()); - conn.setHostnameVerifier(new TrustAnyHostnameVerifier()); - conn.connect(); - InputStream is = conn.getInputStream(); - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String ret = ""; - while ((ret = br.readLine()) != null) { - if (!"".equals(ret.trim())) { - result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8)); - } - } - log.info("recv - {}", result); - conn.disconnect(); - br.close(); - } catch (ConnectException e) { - log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e); - } catch (SocketTimeoutException e) { - log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e); - } catch (IOException e) { - log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e); - } catch (Exception e) { - log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e); - } - return result.toString(); - } - - private static class TrustAnyTrustManager implements X509TrustManager { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) { - } - - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) { - } - - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[]{}; - } - } - - private static class TrustAnyHostnameVerifier implements HostnameVerifier { - @Override - public boolean verify(String hostname, SSLSession session) { - return true; - } - } - - /** - * 获取请求路径参数 - * @param url 请求路径 - */ - public static Map getQueryParams(String url) { - try { - Map params = new HashMap(); - for (String param : url.split("&")) { - String[] pair = param.split("="); - String key = URLDecoder.decode(pair[0], "UTF-8"); - String value = ""; - if (pair.length > 1) { - value = URLDecoder.decode(pair[1], "UTF-8"); - } - params.put(key, value); - } - return params; - } catch (UnsupportedEncodingException ex) { - throw new AssertionError(ex); - } - } - - /** - * okhttpPost请求 - * @param url 地址 - * @param jsonBody 请求体 - */ - public static Response sendOkHttpPost(String url,String jsonBody) throws IOException { - OkHttpClient client = new OkHttpClient().newBuilder().build(); - MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8"); - RequestBody body = RequestBody.Companion.create(jsonBody, mediaType); - Request request = new Request - .Builder() - .url(url) - .post(body) - .addHeader("Content-Type", "application/json") - .build(); - return client.newCall(request).execute(); - } - - /** - * okhttpGet请求 - * @param url 地址 - */ - public static Response sendOkHttpGet(String url) throws IOException { - OkHttpClient client = new OkHttpClient().newBuilder().build(); - Request request = new Request.Builder().url(url).get().build(); - return client.newCall(request).execute(); - } - -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/ip/AddressUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/ip/AddressUtils.java deleted file mode 100644 index 581490c..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/ip/AddressUtils.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.cpop.core.utils.ip; - -import com.alibaba.fastjson2.JSONObject; -import com.cpop.core.constant.Constants; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.http.HttpUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; - -/** - * 获取地址类 - * - * @author DB - */ -public class AddressUtils { - private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); - - // IP地址查询 - public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; - - @Value("${jambox.address-enabled}") - private static Boolean isAddressEnabled; - - // 未知地址 - public static final String UN_KNOW = "XX XX"; - - public static String getRealAddressByIp(String ip) { - // 内网不查询 - if (IpUtils.internalIp(ip)) { - return "内网IP"; - } - if (isAddressEnabled) { - try { - String rspStr = HttpUtils.sendGet(IP_URL, "ip=" + ip + "&json=true", Constants.GBK); - if (StringUtils.isEmpty(rspStr)) { - log.error("获取地理位置异常 {}", ip); - return UN_KNOW; - } - JSONObject obj = JSONObject.parseObject(rspStr); - String region = obj.getString("pro"); - String city = obj.getString("city"); - return String.format("%s %s", region, city); - } catch (Exception e) { - log.error("获取地理位置异常 {}", ip); - } - } - return UN_KNOW; - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/ip/IpUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/ip/IpUtils.java deleted file mode 100644 index bbb261e..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/ip/IpUtils.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.cpop.core.utils.ip; - -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.html.EscapeUtil; -import jakarta.servlet.http.HttpServletRequest; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * 获取IP方法 - * - * @author DB - */ -public class IpUtils -{ - public static String getIpAddr(HttpServletRequest request) - { - if (request == null) - { - return "unknown"; - } - String ip = request.getHeader("x-forwarded-for"); - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Forwarded-For"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("WL-Proxy-Client-IP"); - } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Real-IP"); - } - - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getRemoteAddr(); - } - return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : EscapeUtil.clean(ip); - } - - public static boolean internalIp(String ip) - { - byte[] addr = textToNumericFormatV4(ip); - return internalIp(addr) || "127.0.0.1".equals(ip); - } - - private static boolean internalIp(byte[] addr) - { - if (StringUtils.isNull(addr) || addr.length < 2) - { - return true; - } - final byte b0 = addr[0]; - final byte b1 = addr[1]; - // 10.x.x.x/8 - final byte SECTION_1 = 0x0A; - // 172.16.x.x/12 - final byte SECTION_2 = (byte) 0xAC; - final byte SECTION_3 = (byte) 0x10; - final byte SECTION_4 = (byte) 0x1F; - // 192.168.x.x/16 - final byte SECTION_5 = (byte) 0xC0; - final byte SECTION_6 = (byte) 0xA8; - switch (b0) - { - case SECTION_1: - return true; - case SECTION_2: - if (b1 >= SECTION_3 && b1 <= SECTION_4) - { - return true; - } - case SECTION_5: - switch (b1) - { - case SECTION_6: - return true; - } - default: - return false; - } - } - - /** - * 将IPv4地址转换成字节 - * - * @param text IPv4地址 - * @return byte 字节 - */ - public static byte[] textToNumericFormatV4(String text) - { - if (text.length() == 0) - { - return null; - } - - byte[] bytes = new byte[4]; - String[] elements = text.split("\\.", -1); - try - { - long l; - int i; - switch (elements.length) - { - case 1: - l = Long.parseLong(elements[0]); - if ((l < 0L) || (l > 4294967295L)) { - return null; - } - bytes[0] = (byte) (int) (l >> 24 & 0xFF); - bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF); - bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 2: - l = Integer.parseInt(elements[0]); - if ((l < 0L) || (l > 255L)) { - return null; - } - bytes[0] = (byte) (int) (l & 0xFF); - l = Integer.parseInt(elements[1]); - if ((l < 0L) || (l > 16777215L)) { - return null; - } - bytes[1] = (byte) (int) (l >> 16 & 0xFF); - bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 3: - for (i = 0; i < 2; ++i) - { - l = Integer.parseInt(elements[i]); - if ((l < 0L) || (l > 255L)) { - return null; - } - bytes[i] = (byte) (int) (l & 0xFF); - } - l = Integer.parseInt(elements[2]); - if ((l < 0L) || (l > 65535L)) { - return null; - } - bytes[2] = (byte) (int) (l >> 8 & 0xFF); - bytes[3] = (byte) (int) (l & 0xFF); - break; - case 4: - for (i = 0; i < 4; ++i) - { - l = Integer.parseInt(elements[i]); - if ((l < 0L) || (l > 255L)) { - return null; - } - bytes[i] = (byte) (int) (l & 0xFF); - } - break; - default: - return null; - } - } - catch (NumberFormatException e) - { - return null; - } - return bytes; - } - - public static String getHostIp() - { - try - { - return InetAddress.getLocalHost().getHostAddress(); - } - catch (UnknownHostException e) - { - } - return "127.0.0.1"; - } - - public static String getHostName() - { - try - { - return InetAddress.getLocalHost().getHostName(); - } - catch (UnknownHostException e) - { - } - return "未知"; - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/text/CharsetKit.java b/Cpop-Core/src/main/java/com/cpop/core/utils/text/CharsetKit.java deleted file mode 100644 index 588ad61..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/text/CharsetKit.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.cpop.core.utils.text; - -import com.cpop.core.utils.StringUtils; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; - -/** - * 字符集工具类 - * - * @author DB - */ -public class CharsetKit { - /** - * ISO-8859-1 - */ - public static final String ISO_8859_1 = "ISO-8859-1"; - /** - * UTF-8 - */ - public static final String UTF_8 = "UTF-8"; - /** - * GBK - */ - public static final String GBK = "GBK"; - - /** - * ISO-8859-1 - */ - public static final Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1; - /** - * UTF-8 - */ - public static final Charset CHARSET_UTF_8 = StandardCharsets.UTF_8; - /** - * GBK - */ - public static final Charset CHARSET_GBK = Charset.forName(GBK); - - /** - * 转换为Charset对象 - * - * @param charset 字符集,为空则返回默认字符集 - * @return Charset - */ - public static Charset charset(String charset) { - return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset); - } - - /** - * 转换字符串的字符集编码 - * - * @param source 字符串 - * @param srcCharset 源字符集,默认ISO-8859-1 - * @param destCharset 目标字符集,默认UTF-8 - * @return 转换后的字符集 - */ - public static String convert(String source, String srcCharset, String destCharset) { - return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset)); - } - - /** - * 转换字符串的字符集编码 - * - * @param source 字符串 - * @param srcCharset 源字符集,默认ISO-8859-1 - * @param destCharset 目标字符集,默认UTF-8 - * @return 转换后的字符集 - */ - public static String convert(String source, Charset srcCharset, Charset destCharset) { - if (null == srcCharset) { - srcCharset = StandardCharsets.ISO_8859_1; - } - - if (null == destCharset) { - destCharset = StandardCharsets.UTF_8; - } - - if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) { - return source; - } - return new String(source.getBytes(srcCharset), destCharset); - } - - /** - * @return 系统字符集编码 - */ - public static String systemCharset() { - return Charset.defaultCharset().name(); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/text/Convert.java b/Cpop-Core/src/main/java/com/cpop/core/utils/text/Convert.java deleted file mode 100644 index fe41375..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/text/Convert.java +++ /dev/null @@ -1,854 +0,0 @@ -package com.cpop.core.utils.text; - -import com.cpop.core.utils.StringUtils; -import org.apache.commons.lang3.ArrayUtils; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.text.NumberFormat; -import java.util.Set; - -/** - * 类型转换器 - * - * @author DB - */ -public class Convert { - /** - * 转换为字符串
- * 如果给定的值为null,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static String toStr(Object value, String defaultValue) { - if (null == value) { - return defaultValue; - } - if (value instanceof String) { - return (String) value; - } - return value.toString(); - } - - /** - * 转换为字符串
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static String toStr(Object value) { - return toStr(value, null); - } - - /** - * 转换为字符
- * 如果给定的值为null,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Character toChar(Object value, Character defaultValue) { - if (null == value) { - return defaultValue; - } - if (value instanceof Character) { - return (Character) value; - } - - final String valueStr = toStr(value, null); - return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0); - } - - /** - * 转换为字符
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Character toChar(Object value) { - return toChar(value, null); - } - - /** - * 转换为byte
- * 如果给定的值为null,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Byte toByte(Object value, Byte defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Byte) { - return (Byte) value; - } - if (value instanceof Number) { - return ((Number) value).byteValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return Byte.parseByte(valueStr); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为byte
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Byte toByte(Object value) { - return toByte(value, null); - } - - /** - * 转换为Short
- * 如果给定的值为null,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Short toShort(Object value, Short defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Short) { - return (Short) value; - } - if (value instanceof Number) { - return ((Number) value).shortValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return Short.parseShort(valueStr.trim()); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为Short
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Short toShort(Object value) { - return toShort(value, null); - } - - /** - * 转换为Number
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Number toNumber(Object value, Number defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Number) { - return (Number) value; - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return NumberFormat.getInstance().parse(valueStr); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为Number
- * 如果给定的值为空,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Number toNumber(Object value) { - return toNumber(value, null); - } - - /** - * 转换为int
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Integer toInt(Object value, Integer defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Integer) { - return (Integer) value; - } - if (value instanceof Number) { - return ((Number) value).intValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return Integer.parseInt(valueStr.trim()); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为int
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Integer toInt(Object value) { - return toInt(value, null); - } - - /** - * 转换为Integer数组
- * - * @param str 被转换的值 - * @return 结果 - */ - public static Integer[] toIntArray(String str) { - return toIntArray(",", str); - } - - /** - * 转换为Long数组
- * - * @param str 被转换的值 - * @return 结果 - */ - public static Long[] toLongArray(String str) { - return toLongArray(",", str); - } - - /** - * 转换为Integer数组
- * - * @param split 分隔符 - * @param split 被转换的值 - * @return 结果 - */ - public static Integer[] toIntArray(String split, String str) { - if (StringUtils.isEmpty(str)) { - return new Integer[]{}; - } - String[] arr = str.split(split); - final Integer[] ints = new Integer[arr.length]; - for (int i = 0; i < arr.length; i++) { - final Integer v = toInt(arr[i], 0); - ints[i] = v; - } - return ints; - } - - /** - * 转换为Long数组
- * - * @param split 分隔符 - * @param str 被转换的值 - * @return 结果 - */ - public static Long[] toLongArray(String split, String str) { - if (StringUtils.isEmpty(str)) { - return new Long[]{}; - } - String[] arr = str.split(split); - final Long[] longs = new Long[arr.length]; - for (int i = 0; i < arr.length; i++) { - final Long v = toLong(arr[i], null); - longs[i] = v; - } - return longs; - } - - /** - * 转换为String数组
- * - * @param str 被转换的值 - * @return 结果 - */ - public static String[] toStrArray(String str) { - return toStrArray(",", str); - } - - /** - * 转换为String数组
- * - * @param split 分隔符 - * @param split 被转换的值 - * @return 结果 - */ - public static String[] toStrArray(String split, String str) { - return str.split(split); - } - - /** - * 转换为long
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Long toLong(Object value, Long defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Long) { - return (Long) value; - } - if (value instanceof Number) { - return ((Number) value).longValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - // 支持科学计数法 - return new BigDecimal(valueStr.trim()).longValue(); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为long
- * 如果给定的值为null,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Long toLong(Object value) { - return toLong(value, null); - } - - /** - * 转换为double
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Double toDouble(Object value, Double defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Double) { - return (Double) value; - } - if (value instanceof Number) { - return ((Number) value).doubleValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - // 支持科学计数法 - return new BigDecimal(valueStr.trim()).doubleValue(); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为double
- * 如果给定的值为空,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Double toDouble(Object value) { - return toDouble(value, null); - } - - /** - * 转换为Float
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Float toFloat(Object value, Float defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Float) { - return (Float) value; - } - if (value instanceof Number) { - return ((Number) value).floatValue(); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return Float.parseFloat(valueStr.trim()); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为Float
- * 如果给定的值为空,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Float toFloat(Object value) { - return toFloat(value, null); - } - - /** - * 转换为boolean
- * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static Boolean toBool(Object value, Boolean defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof Boolean) { - return (Boolean) value; - } - String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - valueStr = valueStr.trim().toLowerCase(); - switch (valueStr) { - case "true": - return true; - case "false": - return false; - case "yes": - return true; - case "ok": - return true; - case "no": - return false; - case "1": - return true; - case "0": - return false; - default: - return defaultValue; - } - } - - /** - * 转换为boolean
- * 如果给定的值为空,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static Boolean toBool(Object value) { - return toBool(value, null); - } - - /** - * 转换为Enum对象
- * 如果给定的值为空,或者转换失败,返回默认值
- * - * @param clazz Enum的Class - * @param value 值 - * @param defaultValue 默认值 - * @return Enum - */ - public static > E toEnum(Class clazz, Object value, E defaultValue) { - if (value == null) { - return defaultValue; - } - if (clazz.isAssignableFrom(value.getClass())) { - @SuppressWarnings("unchecked") - E myE = (E) value; - return myE; - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return Enum.valueOf(clazz, valueStr); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为Enum对象
- * 如果给定的值为空,或者转换失败,返回默认值null
- * - * @param clazz Enum的Class - * @param value 值 - * @return Enum - */ - public static > E toEnum(Class clazz, Object value) { - return toEnum(clazz, value, null); - } - - /** - * 转换为BigInteger
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static BigInteger toBigInteger(Object value, BigInteger defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof BigInteger) { - return (BigInteger) value; - } - if (value instanceof Long) { - return BigInteger.valueOf((Long) value); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return new BigInteger(valueStr); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为BigInteger
- * 如果给定的值为空,或者转换失败,返回默认值null
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static BigInteger toBigInteger(Object value) { - return toBigInteger(value, null); - } - - /** - * 转换为BigDecimal
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @param defaultValue 转换错误时的默认值 - * @return 结果 - */ - public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) { - if (value == null) { - return defaultValue; - } - if (value instanceof BigDecimal) { - return (BigDecimal) value; - } - if (value instanceof Long) { - return new BigDecimal((Long) value); - } - if (value instanceof Double) { - return new BigDecimal((Double) value); - } - if (value instanceof Integer) { - return new BigDecimal((Integer) value); - } - final String valueStr = toStr(value, null); - if (StringUtils.isEmpty(valueStr)) { - return defaultValue; - } - try { - return new BigDecimal(valueStr); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * 转换为BigDecimal
- * 如果给定的值为空,或者转换失败,返回默认值
- * 转换失败不会报错 - * - * @param value 被转换的值 - * @return 结果 - */ - public static BigDecimal toBigDecimal(Object value) { - return toBigDecimal(value, null); - } - - /** - * 将对象转为字符串
- * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * - * @param obj 对象 - * @return 字符串 - */ - public static String utf8Str(Object obj) { - return str(obj, CharsetKit.CHARSET_UTF_8); - } - - /** - * 将对象转为字符串
- * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * - * @param obj 对象 - * @param charsetName 字符集 - * @return 字符串 - */ - public static String str(Object obj, String charsetName) { - return str(obj, Charset.forName(charsetName)); - } - - /** - * 将对象转为字符串
- * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法 - * - * @param obj 对象 - * @param charset 字符集 - * @return 字符串 - */ - public static String str(Object obj, Charset charset) { - if (null == obj) { - return null; - } - - if (obj instanceof String) { - return (String) obj; - } else if (obj instanceof byte[]) { - return str((byte[]) obj, charset); - } else if (obj instanceof Byte[]) { - byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); - return str(bytes, charset); - } else if (obj instanceof ByteBuffer) { - return str((ByteBuffer) obj, charset); - } - return obj.toString(); - } - - /** - * 将byte数组转为字符串 - * - * @param bytes byte数组 - * @param charset 字符集 - * @return 字符串 - */ - public static String str(byte[] bytes, String charset) { - return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset)); - } - - /** - * 解码字节码 - * - * @param data 字符串 - * @param charset 字符集,如果此字段为空,则解码的结果取决于平台 - * @return 解码后的字符串 - */ - public static String str(byte[] data, Charset charset) { - if (data == null) { - return null; - } - - if (null == charset) { - return new String(data); - } - return new String(data, charset); - } - - /** - * 将编码的byteBuffer数据转换为字符串 - * - * @param data 数据 - * @param charset 字符集,如果为空使用当前系统字符集 - * @return 字符串 - */ - public static String str(ByteBuffer data, String charset) { - if (data == null) { - return null; - } - - return str(data, Charset.forName(charset)); - } - - /** - * 将编码的byteBuffer数据转换为字符串 - * - * @param data 数据 - * @param charset 字符集,如果为空使用当前系统字符集 - * @return 字符串 - */ - public static String str(ByteBuffer data, Charset charset) { - if (null == charset) { - charset = Charset.defaultCharset(); - } - return charset.decode(data).toString(); - } - - // ----------------------------------------------------------------------- 全角半角转换 - - /** - * 半角转全角 - * - * @param input String. - * @return 全角字符串. - */ - public static String toSBC(String input) { - return toSBC(input, null); - } - - /** - * 半角转全角 - * - * @param input String - * @param notConvertSet 不替换的字符集合 - * @return 全角字符串. - */ - public static String toSBC(String input, Set notConvertSet) { - char c[] = input.toCharArray(); - for (int i = 0; i < c.length; i++) { - if (null != notConvertSet && notConvertSet.contains(c[i])) { - // 跳过不替换的字符 - continue; - } - - if (c[i] == ' ') { - c[i] = '\u3000'; - } else if (c[i] < '\177') { - c[i] = (char) (c[i] + 65248); - - } - } - return new String(c); - } - - /** - * 全角转半角 - * - * @param input String. - * @return 半角字符串 - */ - public static String toDBC(String input) { - return toDBC(input, null); - } - - /** - * 替换全角为半角 - * - * @param text 文本 - * @param notConvertSet 不替换的字符集合 - * @return 替换后的字符 - */ - public static String toDBC(String text, Set notConvertSet) { - char c[] = text.toCharArray(); - for (int i = 0; i < c.length; i++) { - if (null != notConvertSet && notConvertSet.contains(c[i])) { - // 跳过不替换的字符 - continue; - } - - if (c[i] == '\u3000') { - c[i] = ' '; - } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') { - c[i] = (char) (c[i] - 65248); - } - } - String returnString = new String(c); - - return returnString; - } - - /** - * 数字金额大写转换 先写个完整的然后将如零拾替换成零 - * - * @param n 数字 - * @return 中文大写数字 - */ - public static String digitUppercase(double n) { - String[] fraction = {"角", "分"}; - String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; - String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}}; - - String head = n < 0 ? "负" : ""; - n = Math.abs(n); - - String s = ""; - for (int i = 0; i < fraction.length; i++) { - s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", ""); - } - if (s.length() < 1) { - s = "整"; - } - int integerPart = (int) Math.floor(n); - - for (int i = 0; i < unit[0].length && integerPart > 0; i++) { - String p = ""; - for (int j = 0; j < unit[1].length && n > 0; j++) { - p = digit[integerPart % 10] + unit[1][j] + p; - integerPart = integerPart / 10; - } - s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s; - } - return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整"); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/text/StrFormatter.java b/Cpop-Core/src/main/java/com/cpop/core/utils/text/StrFormatter.java deleted file mode 100644 index a968e5f..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/text/StrFormatter.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cpop.core.utils.text; - -import com.cpop.core.utils.StringUtils; - -/** - * 字符串格式化 - * - * @author DB - */ -public class StrFormatter { - public static final String EMPTY_JSON = "{}"; - public static final char C_BACKSLASH = '\\'; - public static final char C_DELIM_START = '{'; - - public static final char C_DELIM_END = '}'; - - /** - * 格式化字符串
- * 此方法只是简单将占位符 {} 按照顺序替换为参数
- * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可
- * 例:
- * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
- * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
- * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- * - * @param strPattern 字符串模板 - * @param argArray 参数列表 - * @return 结果 - */ - public static String format(final String strPattern, final Object... argArray) { - if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) { - return strPattern; - } - final int strPatternLength = strPattern.length(); - - // 初始化定义好的长度以获得更好的性能 - StringBuilder sbuf = new StringBuilder(strPatternLength + 50); - - int handledPosition = 0; - int delimIndex;// 占位符所在位置 - for (int argIndex = 0; argIndex < argArray.length; argIndex++) { - delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition); - if (delimIndex == -1) { - if (handledPosition == 0) { - return strPattern; - } else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果 - sbuf.append(strPattern, handledPosition, strPatternLength); - return sbuf.toString(); - } - } else { - if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) { - if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) { - // 转义符之前还有一个转义符,占位符依旧有效 - sbuf.append(strPattern, handledPosition, delimIndex - 1); - sbuf.append(Convert.utf8Str(argArray[argIndex])); - handledPosition = delimIndex + 2; - } else { - // 占位符被转义 - argIndex--; - sbuf.append(strPattern, handledPosition, delimIndex - 1); - sbuf.append(C_DELIM_START); - handledPosition = delimIndex + 1; - } - } else { - // 正常占位符 - sbuf.append(strPattern, handledPosition, delimIndex); - sbuf.append(Convert.utf8Str(argArray[argIndex])); - handledPosition = delimIndex + 2; - } - } - } - // 加入最后一个占位符后所有的字符 - sbuf.append(strPattern, handledPosition, strPattern.length()); - - return sbuf.toString(); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/IdUtils.java b/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/IdUtils.java deleted file mode 100644 index 7e65734..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/IdUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cpop.core.utils.uuid; - -/** - * ID生成器工具类 - * - * @author DB - */ -public class IdUtils { - /** - * 获取随机UUID - * - * @return 随机UUID - */ - public static String randomUUID() { - return UUID.randomUUID().toString(); - } - - /** - * 简化的UUID,去掉了横线 - * - * @return 简化的UUID,去掉了横线 - */ - public static String simpleUUID() { - return UUID.randomUUID().toString(true); - } - - /** - * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID - * - * @return 随机UUID - */ - public static String fastUUID() { - return UUID.fastUUID().toString(); - } - - /** - * 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID - * - * @return 简化的UUID,去掉了横线 - */ - public static String fastSimpleUUID() { - return UUID.fastUUID().toString(true); - } -} diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/Seq.java b/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/Seq.java deleted file mode 100644 index f3c7e9d..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/Seq.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.cpop.core.utils.uuid; - -import com.cpop.core.utils.StringUtils; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author DB 序列生成类 - */ -public class Seq { - /** - * 通用序列类型 - */ - public static final String commSeqType = "COMMON"; - - /** - * 上传序列类型 - */ - public static final String uploadSeqType = "UPLOAD"; - - /** - * 通用接口序列数 - */ - private static AtomicInteger commSeq = new AtomicInteger(1); - - /** - * 上传接口序列数 - */ - private static AtomicInteger uploadSeq = new AtomicInteger(1); - - /** - * 机器标识 - */ - private static final String machineCode = "A"; - - /** - * 获取通用序列号 - * - * @return 序列值 - */ - public static String getId() { - return getId(commSeqType); - } - - /** - * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串 - * - * @return 序列值 - */ - public static String getId(String type) { - AtomicInteger atomicInt = commSeq; - if (uploadSeqType.equals(type)) { - atomicInt = uploadSeq; - } - return getId(atomicInt, 3); - } - - /** - * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串 - * - * @param atomicInt 序列数 - * @param length 数值长度 - * @return 序列值 - */ - public static String getId(AtomicInteger atomicInt, int length) { - String result = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmmss")); - result += machineCode; - result += getSeq(atomicInt, length); - return result; - } - - /** - * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数 - * - * @return 序列值 - */ - private synchronized static String getSeq(AtomicInteger atomicInt, int length) { - // 先取值再+1 - int value = atomicInt.getAndIncrement(); - - // 如果更新后值>=10 的 (length)幂次方则重置为1 - int maxSeq = (int) Math.pow(10, length); - if (atomicInt.get() >= maxSeq) { - atomicInt.set(1); - } - // 转字符串,用0左补齐 - return StringUtils.padL(value, length); - } -} - diff --git a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/UUID.java b/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/UUID.java deleted file mode 100644 index 672018e..0000000 --- a/Cpop-Core/src/main/java/com/cpop/core/utils/uuid/UUID.java +++ /dev/null @@ -1,447 +0,0 @@ -package com.cpop.core.utils.uuid; - -import com.cpop.core.base.exception.UtilException; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.util.Random; -import java.util.concurrent.ThreadLocalRandom; - -/** - * 提供通用唯一识别码(universally unique identifier)(UUID)实现 - * - * @author DB - */ -public final class UUID implements java.io.Serializable, Comparable { - private static final long serialVersionUID = -1185015143654744140L; - - /** - * SecureRandom 的单例 - */ - private static class Holder { - static final SecureRandom numberGenerator = getSecureRandom(); - } - - /** - * 此UUID的最高64有效位 - */ - private final long mostSigBits; - - /** - * 此UUID的最低64有效位 - */ - private final long leastSigBits; - - /** - * 私有构造 - * - * @param data 数据 - */ - private UUID(byte[] data) { - long msb = 0; - long lsb = 0; - assert data.length == 16 : "data must be 16 bytes in length"; - for (int i = 0; i < 8; i++) { - msb = (msb << 8) | (data[i] & 0xff); - } - for (int i = 8; i < 16; i++) { - lsb = (lsb << 8) | (data[i] & 0xff); - } - this.mostSigBits = msb; - this.leastSigBits = lsb; - } - - /** - * 使用指定的数据构造新的 UUID。 - * - * @param mostSigBits 用于 {@code UUID} 的最高有效 64 位 - * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位 - */ - public UUID(long mostSigBits, long leastSigBits) { - this.mostSigBits = mostSigBits; - this.leastSigBits = leastSigBits; - } - - /** - * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。 - * - * @return 随机生成的 {@code UUID} - */ - public static UUID fastUUID() { - return randomUUID(false); - } - - /** - * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 - * - * @return 随机生成的 {@code UUID} - */ - public static UUID randomUUID() { - return randomUUID(true); - } - - /** - * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。 - * - * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能 - * @return 随机生成的 {@code UUID} - */ - public static UUID randomUUID(boolean isSecure) { - final Random ng = isSecure ? Holder.numberGenerator : getRandom(); - - byte[] randomBytes = new byte[16]; - ng.nextBytes(randomBytes); - //clear version - randomBytes[6] &= 0x0f; - //set to version 4 - randomBytes[6] |= 0x40; - //clear variant - randomBytes[8] &= 0x3f; - //set to IETF variant - randomBytes[8] |= 0x80; - return new UUID(randomBytes); - } - - /** - * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。 - * - * @param name 用于构造 UUID 的字节数组。 - * @return 根据指定数组生成的 {@code UUID} - */ - public static UUID nameUUIDFromBytes(byte[] name) { - MessageDigest md; - try { - md = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException nsae) { - throw new InternalError("MD5 not supported"); - } - byte[] md5Bytes = md.digest(name); - //clear version - md5Bytes[6] &= 0x0f; - //set to version 3 - md5Bytes[6] |= 0x30; - //clear variant - md5Bytes[8] &= 0x3f; - //set to IETF variant - md5Bytes[8] |= 0x80; - return new UUID(md5Bytes); - } - - /** - * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。 - * - * @param name 指定 {@code UUID} 字符串 - * @return 具有指定值的 {@code UUID} - * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常 - */ - public static UUID fromString(String name) { - String[] components = name.split("-"); - if (components.length != 5) { - throw new IllegalArgumentException("Invalid UUID string: " + name); - } - for (int i = 0; i < 5; i++) { - components[i] = "0x" + components[i]; - } - - long mostSigBits = Long.decode(components[0]).longValue(); - mostSigBits <<= 16; - mostSigBits |= Long.decode(components[1]).longValue(); - mostSigBits <<= 16; - mostSigBits |= Long.decode(components[2]).longValue(); - - long leastSigBits = Long.decode(components[3]).longValue(); - leastSigBits <<= 48; - leastSigBits |= Long.decode(components[4]).longValue(); - - return new UUID(mostSigBits, leastSigBits); - } - - /** - * 返回此 UUID 的 128 位值中的最低有效 64 位。 - * - * @return 此 UUID 的 128 位值中的最低有效 64 位。 - */ - public long getLeastSignificantBits() { - return leastSigBits; - } - - /** - * 返回此 UUID 的 128 位值中的最高有效 64 位。 - * - * @return 此 UUID 的 128 位值中最高有效 64 位。 - */ - public long getMostSignificantBits() { - return mostSigBits; - } - - /** - * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。 - *

- * 版本号具有以下含意: - *

    - *
  • 1 基于时间的 UUID - *
  • 2 DCE 安全 UUID - *
  • 3 基于名称的 UUID - *
  • 4 随机生成的 UUID - *
- * - * @return 此 {@code UUID} 的版本号 - */ - public int version() { - // Version is bits masked by 0x000000000000F000 in MS long - return (int) ((mostSigBits >> 12) & 0x0f); - } - - /** - * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。 - *

- * 变体号具有以下含意: - *

    - *
  • 0 为 NCS 向后兼容保留 - *
  • 2 IETF RFC 4122(Leach-Salz), 用于此类 - *
  • 6 保留,微软向后兼容 - *
  • 7 保留供以后定义使用 - *
- * - * @return 此 {@code UUID} 相关联的变体号 - */ - public int variant() { - // This field is composed of a varying number of bits. - // 0 - - Reserved for NCS backward compatibility - // 1 0 - The IETF aka Leach-Salz variant (used by this class) - // 1 1 0 Reserved, Microsoft backward compatibility - // 1 1 1 Reserved for future definition. - return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63)); - } - - /** - * 与此 UUID 相关联的时间戳值。 - * - *

- * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。
- * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。 - * - *

- * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。
- * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 - * - * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。 - */ - public long timestamp() throws UnsupportedOperationException { - checkTimeBase(); - return (mostSigBits & 0x0FFFL) << 48 - | ((mostSigBits >> 16) & 0x0FFFFL) << 32 - | mostSigBits >>> 32; - } - - /** - * 与此 UUID 相关联的时钟序列值。 - * - *

- * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。 - *

- * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出 - * UnsupportedOperationException。 - * - * @return 此 {@code UUID} 的时钟序列 - * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 - */ - public int clockSequence() throws UnsupportedOperationException { - checkTimeBase(); - return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48); - } - - /** - * 与此 UUID 相关的节点值。 - * - *

- * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。 - *

- * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。
- * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。 - * - * @return 此 {@code UUID} 的节点值 - * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1 - */ - public long node() throws UnsupportedOperationException { - checkTimeBase(); - return leastSigBits & 0x0000FFFFFFFFFFFFL; - } - - /** - * 返回此{@code UUID} 的字符串表现形式。 - * - *

- * UUID 的字符串表示形式由此 BNF 描述: - * - *

-     * {@code
-     * UUID                   = ----
-     * time_low               = 4*
-     * time_mid               = 2*
-     * time_high_and_version  = 2*
-     * variant_and_sequence   = 2*
-     * node                   = 6*
-     * hexOctet               = 
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * 
- * - * - * - * @return 此{@code UUID} 的字符串表现形式 - * @see #toString(boolean) - */ - @Override - public String toString() { - return toString(false); - } - - /** - * 返回此{@code UUID} 的字符串表现形式。 - * - *

- * UUID 的字符串表示形式由此 BNF 描述: - * - *

-     * {@code
-     * UUID                   = ----
-     * time_low               = 4*
-     * time_mid               = 2*
-     * time_high_and_version  = 2*
-     * variant_and_sequence   = 2*
-     * node                   = 6*
-     * hexOctet               = 
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * 
- * - * - * - * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串 - * @return 此{@code UUID} 的字符串表现形式 - */ - public String toString(boolean isSimple) { - final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36); - // time_low - builder.append(digits(mostSigBits >> 32, 8)); - if (!isSimple) { - builder.append('-'); - } - // time_mid - builder.append(digits(mostSigBits >> 16, 4)); - if (!isSimple) { - builder.append('-'); - } - // time_high_and_version - builder.append(digits(mostSigBits, 4)); - if (!isSimple) { - builder.append('-'); - } - // variant_and_sequence - builder.append(digits(leastSigBits >> 48, 4)); - if (!isSimple) { - builder.append('-'); - } - // node - builder.append(digits(leastSigBits, 12)); - - return builder.toString(); - } - - /** - * 返回此 UUID 的哈希码。 - * - * @return UUID 的哈希码值。 - */ - @Override - public int hashCode() { - long hilo = mostSigBits ^ leastSigBits; - return ((int) (hilo >> 32)) ^ (int) hilo; - } - - /** - * 将此对象与指定对象比较。 - *

- * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。 - * - * @param obj 要与之比较的对象 - * @return 如果对象相同,则返回 {@code true};否则返回 {@code false} - */ - @Override - public boolean equals(Object obj) { - if ((null == obj) || (obj.getClass() != UUID.class)) { - return false; - } - UUID id = (UUID) obj; - return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits); - } - - // Comparison Operations - - /** - * 将此 UUID 与指定的 UUID 比较。 - * - *

- * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。 - * - * @param val 与此 UUID 比较的 UUID - * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。 - */ - @Override - public int compareTo(UUID val) { - // The ordering is intentionally set up so that the UUIDs - // can simply be numerically compared as two numbers - return (this.mostSigBits < val.mostSigBits ? -1 : - (this.mostSigBits > val.mostSigBits ? 1 : - (Long.compare(this.leastSigBits, val.leastSigBits)))); - } - - // ------------------------------------------------------------------------------------------------------------------- - // Private method start - - /** - * 返回指定数字对应的hex值 - * - * @param val 值 - * @param digits 位 - * @return 值 - */ - private static String digits(long val, int digits) { - long hi = 1L << (digits * 4); - return Long.toHexString(hi | (val & (hi - 1))).substring(1); - } - - /** - * 检查是否为time-based版本UUID - */ - private void checkTimeBase() { - if (version() != 1) { - throw new UnsupportedOperationException("Not a time-based UUID"); - } - } - - /** - * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG) - * - * @return {@link SecureRandom} - */ - public static SecureRandom getSecureRandom() { - try { - return SecureRandom.getInstance("SHA1PRNG"); - } catch (NoSuchAlgorithmException e) { - throw new UtilException(e); - } - } - - /** - * 获取随机数生成器对象
- * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。 - * - * @return {@link ThreadLocalRandom} - */ - public static ThreadLocalRandom getRandom() { - return ThreadLocalRandom.current(); - } -} diff --git a/Cpop-Generator/pom.xml b/Cpop-Generator/pom.xml index 7b39335..f73ae1d 100644 --- a/Cpop-Generator/pom.xml +++ b/Cpop-Generator/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-Generator diff --git a/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java b/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java index f862248..438ccc5 100644 --- a/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java +++ b/Cpop-Generator/src/main/java/com/cpop/generator/CpopGenerator.java @@ -1,6 +1,6 @@ package com.cpop.generator; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.BaseEntity; import com.cpop.core.base.entity.BaseInsertListener; import com.cpop.core.base.entity.BaseUpdateListener; @@ -87,7 +87,7 @@ public class CpopGenerator { System.out.println("请输入表名,多个英文逗号分割:"); if (scanner.hasNext()) { String ipt = scanner.next(); - if (StringUtils.isNotBlank(ipt)) { + if (StrUtil.isNotBlank(ipt)) { return ipt; } } diff --git a/Cpop-Jambox/Cpop-Jambox-Web/pom.xml b/Cpop-Jambox/Cpop-Jambox-Web/pom.xml deleted file mode 100644 index c647f87..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - com.cpop - Cpop-Union - 1.1.0 - ../../pom.xml - - Cpop-Jambox-Web - Cpop-Jambox-Web - 果酱盒子-Web - jar - - - - com.cpop - Cpop-Jambox - - - - com.mysql - mysql-connector-j - runtime - - - - - Cpop-Oam-Web - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/java/com/cpop/jambox/web/CpopJamboxWebApplication.java b/Cpop-Jambox/Cpop-Jambox-Web/src/main/java/com/cpop/jambox/web/CpopJamboxWebApplication.java deleted file mode 100644 index 30ac1a7..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/java/com/cpop/jambox/web/CpopJamboxWebApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.cpop.jambox.web; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableAsync; - -/** - * @author DB - */ -@SpringBootApplication(scanBasePackages = {"com.cpop.**"}) -@MapperScan("com.cpop.**.mapper") -@EnableAsync -public class CpopJamboxWebApplication { - - public static void main(String[] args) { - SpringApplication.run(CpopJamboxWebApplication.class, args); - } - -} diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-dev.yml b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-dev.yml deleted file mode 100644 index 6140f6a..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-dev.yml +++ /dev/null @@ -1,80 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: E:/Cpop/uploadPath - jwt: - #白名单 - whiteList: /login,/miniLogin,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey - # 公钥文件 - privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey - -# DataSource Config -spring: - application: - name: Cpop-Jambox-Dev - datasource: - url: jdbc:mysql://localhost:3306/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: root - #redis配置 - redis: - #地址 - host: localhost - #端口 - port: 6379 - #数据库 - database: 0 - #密码 - password: - #连接超时 - timeout: 5000 - lettuce: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - data: - mongodb: - host: localhost - port: 27017 - database: cpop-union - -server: - port: 9421 - servlet: - context-path: /Cpop-Jambox - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: PuPu-OAM开发API - description: PuPu-OAM开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #jambox - jambox: - group-name: Jambox - api-rule: package - api-rule-resources: - - com.cpop.jambox \ No newline at end of file diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-prod.yml b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-prod.yml deleted file mode 100644 index c21ae0a..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-prod.yml +++ /dev/null @@ -1,60 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: /root/jambox-union/jambox-oam/uploadPath/upload - jwt: - #白名单 - whiteList: /login,/getCaptcha,/profile/** - #拦截 - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: /root/jambox-union/jambox-oam/script/secretKey/publicKey - # 公钥文件 - privateKeyFile: /root/jambox-union/jambox-oam/script/secretKey/privateKey - -# DataSource Config -spring: - application: - name: Cpop-Jambox-Prod - datasource: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - #redis配置 - redis: - #地址 - host: 106.52.49.102 - #端口 - port: 6333 - #数据库 - database: 5 - #密码 - password: Jambox.123* - #连接超时 - timeout: 5000 - lettuce: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - data: - mongodb: - host: localhost - port: 27017 - database: rock-blade - -server: - port: 9421 - servlet: - context-path: /Cpop-Jambox - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl \ No newline at end of file diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-test.yml b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-test.yml deleted file mode 100644 index b2b1ff2..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application-test.yml +++ /dev/null @@ -1,81 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: /root/jambox-union/jambox-oam/uploadPath/upload - jwt: - #白名单 - whiteList: /login,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources - #拦截 - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: /root/jambox-union/jambox-oam/script/secretKey/publicKey - # 公钥文件 - privateKeyFile: /root/jambox-union/jambox-oam/script/secretKey/privateKey - -# DataSource Config -spring: - application: - name: Cpop-Jambox-Test - datasource: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - #redis配置 - redis: - #地址 - host: 106.52.49.102 - #端口 - port: 6333 - #数据库 - database: 5 - #密码 - password: Jambox.123* - #连接超时 - timeout: 5000 - lettuce: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - data: - mongodb: - host: localhost - port: 27017 - database: rock-blade - -server: - port: 9421 - servlet: - context-path: /Cpop-Jambox - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: Cpop-Jambox开发API - description: Cpop-Jambox开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #jambox - jambox: - group-name: Jambox - api-rule: package - api-rule-resources: - - com.cpop.jambox \ No newline at end of file diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application.yml b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application.yml deleted file mode 100644 index c0f7d4e..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/application.yml +++ /dev/null @@ -1,118 +0,0 @@ -# 项目相关配置 -cpop: - # 名称 - name: Cpop-Jambox - # 版本 - version: 1.0.0 - #JWT - jwt: - #密钥 - secret: abcdefghijklmnopqrstuvwxyz - #过期时间 - expire: 604800 - #token头 - header: Authorization - #拦截 - gateway: - rsa-keypair: - # 加密方式 - algorithm: RSA - # 初始化大小 - keySize: 2048 - -#Spring -spring: - mvc: - pathmatch: - matching-strategy: ant_path_matcher - servlet: - multipart: - #文件最大传输 - max-file-size: 1024MB - max-request-size: 300MB - profiles: - active: dev,jambox,api,sdk - datasource: - type: com.zaxxer.hikari.HikariDataSource - driver-class-name: com.mysql.cj.jdbc.Driver - #hikari数据源特性配置 - hikari: - #最大连接数,默认值10. - maximum-pool-size: 10 - #最小空闲连接,默认值10. - minimum-idle: 10 - #连接超时时间(毫秒),默认值30秒. - connection-timeout: 30000 - #空闲连接超时时间,默认值600000(10分钟),只有空闲连接数大于最大连接数且空闲时间超过该值,才会被释放;如果大于等于 max-lifetime 且 max-lifetime>0,则会被重置为0. - idle-timeout: 600000 - #连接最大存活时间,默认值30分钟.设置应该比mysql设置的超时时间短 - max-lifetime: 3000000 - #连接测试查询 - connection-test-query: select 1 - messages: - #i18n - basename: static/i18n/messages - encoding: UTF-8 - cacheDuration: 3600 - quartz: - job-store-type: jdbc - jdbc: - initialize-schema: embedded - #定时任务启动开关,true-开 false-关 - auto-startup: true - #延迟1秒启动定时任务 - startup-delay: 1s - #启动时更新己存在的Job - overwrite-existing-jobs: true - properties: - org: - quartz: - scheduler: - instanceName: CpopJamboxScheduler - instanceId: AUTO - jobStore: - class: org.springframework.scheduling.quartz.LocalDataSourceJobStore - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - tablePrefix: QRTZ_ - isClustered: false - misfireThreshold: 12000 - clusterCheckinInterval: 15000 - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 1 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true - -#Mybatis-Flex -mybatis-flex: - global-config: - key-config: - key-type: generator - value: snowFlakeId - # 逻辑删除数据存在标记值 默认值:0 - normal-value-of-logic-delete: 0 - # 逻辑删除数据删除标记值 默认值:0 - deleted-value-of-logic-delete: 1 - # 全局逻辑删除默认字段 - logic-delete-column: is_delete - -# 线程池配置参数 -task: - pool: - # 设置核心线程数 - corePoolSize: 10 - # 设置最大线程数 - maxPoolSize: 20 - # 设置空闲线程存活时间(秒 - keepAliveSeconds: 300 - # 设置队列容量 - queueCapacity: 100 - # 设置线程名称前缀 - threadNamePrefix: "Cpop-Jambox-AsyncNotify-" - # 设置线程池等待终止时间(秒) - awaitTerminationSeconds: 60 - -logging: - level: - #swagger日志 - springfox: error \ No newline at end of file diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages.properties b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages.properties deleted file mode 100644 index e69de29..0000000 diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_en_US.properties b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_en_US.properties deleted file mode 100644 index 306c74f..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_en_US.properties +++ /dev/null @@ -1,4 +0,0 @@ -#\u767B\u5F55\u4FE1\u606F -#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F -i18n_baseInfo_success=Success -i18n_baseInfo_failed=Failed diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_zh_CN.properties b/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_zh_CN.properties deleted file mode 100644 index bdbe86b..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/main/resources/static/i18n/messages_zh_CN.properties +++ /dev/null @@ -1,4 +0,0 @@ -#\u767B\u5F55\u4FE1\u606F -#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F -i18n_baseInfo_success=\u6210\u529F -i18n_baseInfo_failed=\u5931\u8D25 diff --git a/Cpop-Jambox/Cpop-Jambox-Web/src/test/java/com/cpop/jambox/web/CpopJamboxWebApplicationTests.java b/Cpop-Jambox/Cpop-Jambox-Web/src/test/java/com/cpop/jambox/web/CpopJamboxWebApplicationTests.java deleted file mode 100644 index 279c186..0000000 --- a/Cpop-Jambox/Cpop-Jambox-Web/src/test/java/com/cpop/jambox/web/CpopJamboxWebApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.cpop.jambox.web; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class CpopJamboxWebApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/Cpop-Jambox/pom.xml b/Cpop-Jambox/pom.xml deleted file mode 100644 index 261185e..0000000 --- a/Cpop-Jambox/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - com.cpop - Cpop-Union - 1.1.0 - ../pom.xml - - Cpop-Jambox - Cpop-Jambox - 果酱 - - - - - com.cpop - Cpop-Core - - - - com.cpop - Cpop-System - - - - com.cpop - Cpop-Pay - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - diff --git a/Cpop-Jambox/sql/Jambox.sql b/Cpop-Jambox/sql/Jambox.sql deleted file mode 100644 index fbbac2b..0000000 --- a/Cpop-Jambox/sql/Jambox.sql +++ /dev/null @@ -1,93 +0,0 @@ -/* - Navicat Premium Data Transfer - - Source Server : Localhost - Source Server Type : MySQL - Source Server Version : 80032 - Source Host : localhost:3306 - Source Schema : cpop-union - - Target Server Type : MySQL - Target Server Version : 80032 - File Encoding : 65001 - - Date: 15/09/2023 15:04:20 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for pp_j_brand --- ---------------------------- -DROP TABLE IF EXISTS `cp_j_brand`; -CREATE TABLE `cp_j_brand` ( - `id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `brand_cloud_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '云函数id', - `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌名', - `background_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '背景地址', - `consultant_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '顾问名', - `open_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'openId', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `create_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人id', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `update_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人id', - `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0否1是)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '品牌表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for pp_j_brand_staff --- ---------------------------- -DROP TABLE IF EXISTS `cp_j_brand_staff`; -CREATE TABLE `cp_j_brand_staff` ( - `id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `brand_staff_cloud_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '云id', - `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名', - `phone_number` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `position` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份(定位)', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `create_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人id', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `update_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人id', - `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0否1是)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '品牌管理员表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for pp_j_brand_staff_mid_campus --- ---------------------------- -DROP TABLE IF EXISTS `cp_j_brand_staff_mid_campus`; -CREATE TABLE `cp_j_brand_staff_mid_campus` ( - `brand_staff_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '品牌管理员id', - `brand_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌id', - `campus_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '校区id', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `create_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人id', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `update_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人id' -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员-品牌-校区表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for pp_j_campus --- ---------------------------- -DROP TABLE IF EXISTS `cp_j_campus`; -CREATE TABLE `cp_j_campus` ( - `id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `campus_cloud_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '云校区id', - `brand_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌id', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '校区名', - `responsible_person` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人', - `responsible_person_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人手机号', - `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址', - `open_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'openId', - `expire` datetime(0) NULL DEFAULT NULL COMMENT '到期时间', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `create_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人id', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `update_user_id` varchar(48) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人id', - `is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0否1是)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '校区表' ROW_FORMAT = Dynamic; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/Cpop-Jambox/sql/website.sql b/Cpop-Jambox/sql/website.sql deleted file mode 100644 index a9039bc..0000000 --- a/Cpop-Jambox/sql/website.sql +++ /dev/null @@ -1,174 +0,0 @@ -SET NAMES utf8mb4; --- --- Set default database --- -USE cpop_test; - -DROP TABLE IF EXISTS `cp_j_web_product`; -DROP TABLE IF EXISTS `cp_j_web_navigation`; -DROP TABLE IF EXISTS `cp_j_web_development`; -DROP TABLE IF EXISTS `cp_j_web_cooperation_type`; -DROP TABLE IF EXISTS `cp_j_web_cooperation`; -DROP TABLE IF EXISTS `cp_j_web_company_intro`; -DROP TABLE IF EXISTS `cp_j_web_business_intro`; -DROP TABLE IF EXISTS `cp_j_web_business_data`; - --- --- Create table `cp_j_web_product` --- -CREATE TABLE cp_j_web_product ( - id VARCHAR(48) NOT NULL, - product_name VARCHAR(255) DEFAULT NULL COMMENT '产品名称', - img_url TEXT DEFAULT NULL COMMENT '图片', - intro TEXT DEFAULT NULL COMMENT '产品介绍', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 核心产品表'; - --- --- Create table `cp_j_web_navigation` --- -CREATE TABLE cp_j_web_navigation ( - id VARCHAR(48) NOT NULL, - navigation_name VARCHAR(50) DEFAULT NULL COMMENT '导航栏名称', - path VARCHAR(50) DEFAULT NULL COMMENT '路径', - parent_id INT DEFAULT NULL COMMENT '父级ID', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 导航栏表'; - - --- --- Create table `cp_j_web_development` --- -CREATE TABLE cp_j_web_development ( - id VARCHAR(48) NOT NULL, - title VARCHAR(100) DEFAULT NULL COMMENT '标题', - img_url TEXT DEFAULT NULL COMMENT '图片', - link VARCHAR(255) DEFAULT NULL COMMENT '跳转链接', - publish_time DATETIME DEFAULT NULL COMMENT '发布时间', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 发展历程表'; - --- --- Create table `cp_j_web_cooperation_type` --- -CREATE TABLE cp_j_web_cooperation_type ( - id VARCHAR(48) NOT NULL, - type_name VARCHAR(255) DEFAULT NULL COMMENT '种类名称', - sort INT DEFAULT NULL COMMENT '排序', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 合作类别表'; - --- --- Create table `cp_j_web_cooperation` --- -CREATE TABLE cp_j_web_cooperation ( - id VARCHAR(48) NOT NULL, - img_url TEXT DEFAULT NULL COMMENT '图片', - type_id VARCHAR(48) DEFAULT NULL COMMENT '合作类别id', - sort INT DEFAULT NULL COMMENT '排序', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 合作平台表'; - --- --- Create table `cp_j_web_company_intro` --- -CREATE TABLE cp_j_web_company_intro ( - id VARCHAR(48) NOT NULL, - title VARCHAR(255) DEFAULT NULL COMMENT '标题', - content VARCHAR(255) DEFAULT NULL COMMENT '内容', - img_one TEXT DEFAULT NULL COMMENT '图片一', - img_two TEXT DEFAULT NULL COMMENT '图片二', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 公司简介表'; - --- --- Create table `cp_j_web_business_intro` --- -CREATE TABLE cp_j_web_business_intro ( - id VARCHAR(48) NOT NULL, - intro TEXT DEFAULT NULL COMMENT '业务介绍', - img_url TEXT DEFAULT NULL COMMENT '图片', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 业务介绍表'; - --- --- Create table `cp_j_web_business_data` --- -CREATE TABLE cp_j_web_business_data ( - id VARCHAR(48) NOT NULL, - data_name VARCHAR(50) DEFAULT NULL COMMENT '数据名称', - data VARCHAR(50) DEFAULT NULL COMMENT '数据', - create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - create_user_id VARCHAR(48) DEFAULT NULL COMMENT '创建人id', - update_time DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - update_user_id VARCHAR(48) DEFAULT NULL COMMENT '更新人id', - is_delete TINYINT DEFAULT NULL COMMENT '逻辑删除(0否1是)', - PRIMARY KEY (id) -) -ENGINE = INNODB, -CHARACTER SET utf8mb4, -COLLATE utf8mb4_general_ci, -COMMENT = '果酱模块化官网 业务数据表'; \ No newline at end of file diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java deleted file mode 100644 index 2915d15..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/CardTemplateUnionBo.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.cpop.jambox.business.bo; - -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-16 16:29 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "CardTemplateUnionBo对象", description = "课卡模板统一入口") -public class CardTemplateUnionBo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 旧课卡模板id - */ - @ApiModelProperty(value = "旧课卡模板id") - private String oldTemplateId; - - /** - * 云品牌id - */ - @ApiModelProperty(value = "云品牌id") - private String brandCloudId; - - /** - * 云校区id - */ - @ApiModelProperty(value = "云校区id") - private String storeCloudId; - - /** - * 模板名 - */ - @NotBlank(message = "模板名不能为空") - @ApiModelProperty(value = "模板名",required = true) - private String name; - - /** - * 有效日期数 - */ - @ApiModelProperty(value = "有效日期数") - private Integer validDay; - - /** - * 结束日期 - */ - @ApiModelProperty(value = "结束日期") - private LocalDate endDate; - - /** - * 价格 - */ - @NotNull(message = "价格不能为空") - @ApiModelProperty(value = "价格") - private BigDecimal price; - - /** - * 课时 - */ - @ApiModelProperty("课时") - private Integer classNumber; - - /** - * 周预约数 - */ - @ApiModelProperty(value = "周预约数") - private Integer weekAppointment; - - /** - * 日预约数 - */ - @ApiModelProperty(value = "日预约数") - private Integer dayAppointment; - - /** - * 缓冲天数 - */ - @ApiModelProperty(value = "缓冲天数") - private Integer bufferDay; - - /** - * 模板类型(0:课时卡,1:时限卡,2:储值卡) - */ - @ApiModelProperty(value = "模板类型(0:课时卡,1:时限卡,2:储值卡)") - private Integer templateType; - - /** - * 使用范围 - */ - @ApiModelProperty(value = "使用范围(旧Type字段)") - private String scopeUse; - - /** - * 支付类型(0:微信支付;1:先学后付次付;2:旧放心学合约支付;3:数字人民币支付;4:线下支付;5:先学后付月付;) - */ - @NotEmpty(message = "支付类型不能为空") - @ApiModelProperty(value = "支付类型(0:微信支付;1:先学后付次付;2:旧放心学合约支付;3:数字人民币支付;4:线下支付;5:先学后付月付;)") - private List payType; - - /** - * 是否是会员(0否1是) - */ - @ApiModelProperty(value = "是否是会员(0否1是)") - private Boolean isMember; - - /** - * 是否是引流卡 - */ - @ApiModelProperty(value = "是否是引流卡(0否1是)") - private Boolean isDrainage; - /** - * 先学后付支付 - */ - @ApiModelProperty("先学后付支付(次付)") - private LearnNowPayLaterPlanBo learnNowPayLaterPay; - - /** - * 先学后付支付 - */ - @ApiModelProperty("先学后付(月付)") - private LearnNowPayLaterPlanBo learnNowPayLaterMonthPay; - - /** - * 放心学旧合同 - */ - @ApiModelProperty("放心学旧合同") - private EasyLearnOldContractBo easyLearnOldContract; - - /** - * 放心学数币 - */ - @ApiModelProperty("放心学数币") - private EasyLearnDigitalCurrencyBo easyLearnDigitalCurrency; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnDigitalCurrencyBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnDigitalCurrencyBo.java deleted file mode 100644 index edfdfe7..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnDigitalCurrencyBo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-19 9:44 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnDigitalCurrencyBo对象", description = "放心学数币参数") -public class EasyLearnDigitalCurrencyBo { - - /** - * 是否是数币活动 - */ - private Boolean isActivity; - - /** - * 活动码 - */ - private String activityCode; - - /** - * 活动描述 - */ - private String activityDesc; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnOldContractBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnOldContractBo.java deleted file mode 100644 index eb1f145..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnOldContractBo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-19 9:36 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnOldContractBo对象", description = "放心学旧合同参数") -public class EasyLearnOldContractBo { - - /** - * 期数 - */ - @ApiModelProperty("期数") - private Integer stageNum; - - /** - * 押金 - */ - @ApiModelProperty("押金") - private BigDecimal deposit; - - /** - * 首期缓冲天数 - */ - @ApiModelProperty("首期缓冲天数") - private Integer firstBufferDay; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnPageBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnPageBo.java deleted file mode 100644 index 426ec7a..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnPageBo.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cpop.jambox.business.bo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; -import org.springframework.format.annotation.DateTimeFormat; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-15 9:26 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnPageBo对象", description = "放心学分页查询参数") -public class EasyLearnPageBo { - - /** - * 结束日期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd") - @ApiModelProperty(value = "结束日期") - private LocalDate endDate; - - /** - * 开始日期 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd") - @ApiModelProperty(value = "开始日期") - private LocalDate startDate; - - /** - * 顾问 - */ - @ApiModelProperty(value = "顾问") - private String staffName; - - /** - * 品牌与校区模糊查询 - */ - @ApiModelProperty(value = "品牌与校区模糊查询") - private String brandOrStore; - - /** - * 订单类型(0:先学后付;1:月付;2:微信支付;3:数币支付;4:机构会员) - */ - @NotNull(message = "类型不能为空") - @ApiModelProperty(value = "类型(0:先学后付;1:月付;2:微信支付;3:数币支付;4:机构会员)",required = true) - private Integer orderType; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnifiedPayBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnifiedPayBo.java deleted file mode 100644 index 4a82c9e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnifiedPayBo.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-09 9:15 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnUnifiedPayBo对象", description = "统一支付参数") -public class EasyLearnUnifiedPayBo { - - /** - * 品牌或校区id - */ - @NotBlank(message = "云品牌或云校区id不能为空") - @ApiModelProperty(value = "云品牌或云校区id",required = true) - private String brandOrStoreCloudId; - - /** - * 联合支付外部订单id - */ - @NotBlank(message = "联合支付外部订单id不能为空") - @ApiModelProperty(value = "联合支付外部订单id",required = true) - private String unionPayOutOrderId; - - /** - * 客户名 - */ - @NotBlank(message = "客户名不能为空") - @ApiModelProperty(value = "客户名",required = true) - private String customerName; - - /** - * 客户电话 - */ - @NotBlank(message = "客户电话不能为空") - @ApiModelProperty(value = "客户电话",required = true) - private String customerPhone; - - /** - * 总金额 - */ - @NotNull(message = "总金额不能为空") - @ApiModelProperty(value = "总金额",required = true) - private BigDecimal totalAmount; - - /** - * 总支付金额 - */ - @NotNull(message = "总支付金额不能为空") - @ApiModelProperty(value = "总支付金额",required = true) - private BigDecimal totalPayAmount; - - /** - * 订单类型 - */ - @NotNull(message = "联合支付类型不能为空") - @ApiModelProperty(value = "联合支付类型(PREPAYMENT:预付;REPAYMENT:还款;MEMBER:会员)",required = true) - private String easyLearnUnionPay; - - /** - * 分账比率 - */ - @ApiModelProperty(value = "分账比率(不传不分帐)") - private Double rate; - - /** - * openId - */ - @NotBlank(message = "openId不能为空") - @ApiModelProperty(value = "openId", required = true) - private String openId; - - /** - * 订单名 - */ - @ApiModelProperty("订单内容(课卡名/商品名)") - private String orderContent; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnionPayBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnionPayBo.java deleted file mode 100644 index 979089c..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/EasyLearnUnionPayBo.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-28 15:44 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnUnionPayBo对象", description = "统一支付参数") -public class EasyLearnUnionPayBo { - - /** - * 品牌或校区id - */ - @NotBlank(message = "云品牌或云校区id不能为空") - @ApiModelProperty(value = "云品牌或云校区id",required = true) - private String brandOrStoreCloudId; - - /** - * 联合支付外部订单id - */ - @NotBlank(message = "联合支付外部订单id不能为空") - @ApiModelProperty(value = "联合支付外部订单id",required = true) - private String unionPayOutOrderId; - - /** - * 客户名 - */ - @NotBlank(message = "客户名不能为空") - @ApiModelProperty(value = "客户名",required = true) - private String customerName; - - /** - * 客户电话 - */ - @NotBlank(message = "客户电话不能为空") - @ApiModelProperty(value = "客户电话",required = true) - private String customerPhone; - - /** - * 总金额 - */ - @NotNull(message = "总金额不能为空") - @ApiModelProperty(value = "总金额",required = true) - private BigDecimal totalAmount; - - /** - * 总支付金额 - */ - @NotNull(message = "总支付金额不能为空") - @ApiModelProperty(value = "总支付金额",required = true) - private BigDecimal totalPayAmount; - - /** - * 订单类型 - */ - @NotBlank(message = "联合支付类型不能为空") - @ApiModelProperty(value = "联合支付类型(WX_PAY:微信支付;PREPAYMENT:预付;REPAYMENT:还款;MEMBER:会员)",required = true) - private String easyLearnUnionPay; - - /** - * 分账比率 - */ - @ApiModelProperty(value = "分账比率(不传不分帐)") - private Double rate; - - /** - * openId - */ - @NotBlank(message = "openId不能为空") - @ApiModelProperty(value = "openId", required = true) - private String openId; - - /** - * 订单名 - */ - @ApiModelProperty("订单内容(课卡名/商品名)") - private String orderContent; - - /** - * 顾问 - */ - @ApiModelProperty("顾问") - private String counselor; - - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterOncePayDto.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterOncePayDto.java deleted file mode 100644 index 8d4f1a5..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterOncePayDto.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-08 9:23 - */ -@Data -@ApiModel(value = "先学后付次付") -public class LearnNowPayLaterOncePayDto { - - /** - * 支付分计划名称 - */ - @NotBlank(message = "支付分计划名称不能为空") - @ApiModelProperty(value = "支付分计划名称", required = true) - private String planName; - - /** - * 支付分计划有效期(单位天) - */ - @NotNull(message = "支付分计划有效期不能为空") - @ApiModelProperty(value = "支付分计划有效期(单位天)", required = true) - private Integer planDuration; - - /** - * 支付分计划扣费次数 - */ - @NotNull(message = "支付分计划扣费次数不能为空") - @ApiModelProperty(value = "支付分计划扣费次数", required = true) - private Integer deductionQuantity; - - /** - * 支付分计划原总金额(单位分) - */ - @NotNull(message = "支付分计划原总金额不能为空") - @ApiModelProperty(value = "支付分计划原总金额(单位分)", required = true) - private Integer totalOriginalPrice; - - public void setTotalOriginalPrice(String totalOriginalPrice) { - double price = Double.parseDouble(totalOriginalPrice) * 100; - this.totalOriginalPrice = (int) price; - } - - /** - * 支付分计划实际扣费总金额(单位分) - */ - @NotNull(message = "支付分计划实际扣费总金额不能为空") - @ApiModelProperty(value = "支付分计划实际扣费总金额(单位分)", required = true) - private Integer totalActualPrice; - - public void setTotalActualPrice(String totalActualPrice) { - double price = Double.parseDouble(totalActualPrice) * 100; - this.totalActualPrice = (int) price; - } - - - /** - * 支付分计划明细列表 - */ - @NotEmpty(message = "支付分计划明细列表不能为空") - @ApiModelProperty(value = "支付分计划明细列表", required = true) - private List planDetailList; - - @Data - public static class PlanDetail { - /** - * 计划明细原支付金额(单位分) - */ - @NotNull(message = "计划明细原支付金额不能为空") - @ApiModelProperty(value = "计划明细原支付金额(单位分)",required = true) - private Integer originalPrice; - - public void setOriginalPrice(String originalPrice) { - double price = Double.parseDouble(originalPrice) * 100; - this.originalPrice = (int) price; - } - - /** - * 计划明细优惠说明 - */ - @NotBlank(message = "计划明细优惠说明不能为空") - @ApiModelProperty(value = "计划明细优惠说明",required = true) - private String planDiscountDescription; - - /** - * 计划明细实际支付金额(单位分) - */ - @NotNull(message = "计划明细实际支付金额不能为空") - @ApiModelProperty(value = "计划明细实际支付金额(单位分)",required = true) - private Integer actualPrice; - - public void setActualPrice(String actualPrice) { - double price = Double.parseDouble(actualPrice) * 100; - this.actualPrice = (int) price; - } - - /** - * 计划明细名称 - */ - @NotBlank(message = "计划明细名称不能为空") - @ApiModelProperty(value = "计划明细名称",required = true) - private String planDetailName; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanBo.java deleted file mode 100644 index 4a3c4c6..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanBo.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-05 16:13 - */ -@Data -@ApiModel("先学后付计划") -public class LearnNowPayLaterPlanBo { - - /** - * 支付分计划名称 - */ - @ApiModelProperty("支付分计划名称") - private String planName; - - /** - * 支付分计划有效期(单位天) - */ - @ApiModelProperty("支付分计划有效期(单位天)") - private Integer planDuration; - - /** - * 支付分计划扣费次数 - */ - @ApiModelProperty("支付分计划扣费次数") - private Integer deductionQuantity; - - - /** - * 支付分计划原总金额(单位分) - */ - @ApiModelProperty("支付分计划原总金额") - private Integer totalOriginalPrice; - - public void setTotalOriginalPrice(BigDecimal totalOriginalPrice) { - this.totalOriginalPrice = totalOriginalPrice.scaleByPowerOfTen(2).intValue(); - } - - /** - * 支付分计划实际扣费总金额(单位分) - */ - @ApiModelProperty("支付分计划实际扣费总金额(单位分)") - private Integer totalActualPrice; - - public void setTotalActualPrice(BigDecimal totalActualPrice) { - this.totalActualPrice = totalActualPrice.scaleByPowerOfTen(2).intValue(); - } - - /** - * 支付分计划明细列表 - */ - @ApiModelProperty("支付分计划明细列表") - private List planDetailList; - - /** - * 课次 - */ - @ApiModelProperty("支付分计划原总金额") - private String classHour; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanDetailBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanDetailBo.java deleted file mode 100644 index 890ec70..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterPlanDetailBo.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-08 9:54 - */ -@Data -@ApiModel(value = "先学后付计划详情") -public class LearnNowPayLaterPlanDetailBo { - - /** - * 计划明细优惠说明 - */ - @ApiModelProperty("计划明细优惠说明") - private String planDiscountDescription; - - /** - * 计划明细原支付金额(单位分) - */ - @ApiModelProperty("计划明细原支付金额(单位分)") - private Integer originalPrice; - - public void setOriginalPrice(BigDecimal originalPrice) { - this.originalPrice = originalPrice.scaleByPowerOfTen(2).intValue(); - } - - /** - * 计划明细实际支付金额(单位分) - */ - @ApiModelProperty("计划明细实际支付金额(单位分)") - private Long actualPrice; - - public void setActualPrice(BigDecimal actualPrice) { - this.actualPrice = actualPrice.scaleByPowerOfTen(2).longValue(); - } - - /** - * 计划明细名称 - */ - @ApiModelProperty("计划明细名称") - private String planDetailName; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterServiceOrderBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterServiceOrderBo.java deleted file mode 100644 index e7c365c..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterServiceOrderBo.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-20 12:33 - */ -@Data -@ApiModel(value = "先学后付用户核销") -public class LearnNowPayLaterServiceOrderBo { - - /** - * 支付分订单在商户侧的订单号,必须和创建签约计划时传入的该笔订单对应的商户侧计划明细使用订单号(merchant\_plan\_detail\_no)一致 - */ - @NotBlank(message = "待创建服务订单对应的用户的签约计划不能为空") - @ApiModelProperty(value = "待创建服务订单对应的用户的签约计划",required = true) - private String signPlanId; - - /** - * 待创建服务订单对应的用户的签约计划详情序号 - */ - @NotNull(message = "planDetailNo不能为空") - @ApiModelProperty(value = "待创建服务订单对应的用户的签约计划详情序号",required = true) - private Integer planDetailNo; - - /** - * 服务商公众号下的用户标识 - */ - @NotBlank(message = "openid不能为空") - @ApiModelProperty(value = "服务商公众号下的用户标识",required = true) - private String openid; - - /** - * 卡号 - */ - @NotBlank(message = "cardNo不能为空") - @ApiModelProperty(value = "卡号",required = true) - private String cardNo; - - /** - * 课程信息 - */ - @NotBlank(message = "课程信息不能为空") - @ApiModelProperty(value = "课程信息",required = true) - private String serviceIntroduction; - - /** - * 核销金额 - */ - @NotNull(message = "核销金额不能为空") - @ApiModelProperty(value = "核销金额",required = true) - private Integer price; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterStopUserSignPlansBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterStopUserSignPlansBo.java deleted file mode 100644 index 8170ef5..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterStopUserSignPlansBo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-20 15:01 - */ -@Data -@ApiModel(value = "停止用户签约计划") -public class LearnNowPayLaterStopUserSignPlansBo { - - /** - * 签约计划id - */ - @NotBlank(message = "签约计划id不能为空") - @ApiModelProperty(value = "签约计划id",required = true) - private String signPlanId; - - /** - * 取消理由 - */ - @NotBlank(message = "取消理由不能为空") - @ApiModelProperty(value = "取消理由",required = true) - private String stopReason; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterUserSignPlansBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterUserSignPlansBo.java deleted file mode 100644 index a676a58..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/LearnNowPayLaterUserSignPlansBo.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-19 22:40 - */ -@Data -@ApiModel(value = "先学后付用户签约计划") -public class LearnNowPayLaterUserSignPlansBo { - - /** - * 支付分id - */ - @NotBlank(message = "支付分id不能为空") - @ApiModelProperty(value = "支付分id",required = true) - private String id; - - /** - * 云校区id - */ - @NotBlank(message = "云校区id不能为空") - @ApiModelProperty(value = "云校区id",required = true) - private String storeCloudId; - - /** - * 子商户下用户openid - */ - @NotBlank(message = "子商户下用户openid不能为空") - @ApiModelProperty(value = "子商户下用户openid",required = true) - private String subOpenId; - - /** - * 支付分计划名称 - */ - @NotBlank(message = "支付分计划名称不能为空") - @ApiModelProperty(value = "支付分计划名称",required = true) - private String planName; - - /** - * 客户名 - */ - @NotBlank(message = "客户名不能为空") - @ApiModelProperty(value = "客户名",required = true) - private String customerName; - - /** - * 客户手机号 - */ - @NotBlank(message = "客户手机号不能为空") - @ApiModelProperty(value = "客户手机号", required = true) - private String customerPhone; - - /** - * 模板id - */ - @ApiModelProperty(value = "模板id") - private String templateId; - - /** - * 旧模板id - */ - @ApiModelProperty(value = "旧模板id") - private String oldTemplateId; - - /** - * 顾问名 - */ - @ApiModelProperty(value = "顾问名") - private String counselor; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java deleted file mode 100644 index 3f934d5..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/OncePlaceOrderBo.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-21 17:15 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "OncePlaceOrderBo对象", description = "一次性支付参数") -public class OncePlaceOrderBo { - - /** - * 品牌id - */ - @NotBlank(message = "品牌id不能为空") - @ApiModelProperty(value = "品牌id",required = true) - private String brandCloudId; - - /** - * 校区id - */ - @NotBlank(message = "校区id不能为空") - @ApiModelProperty(value = "校区id",required = true) - private String storeCloudId; - - /** - * 客户名 - */ - @NotBlank(message = "客户名不能为空") - @ApiModelProperty(value = "客户名",required = true) - private String customerName; - - /** - * 客户电话 - */ - @NotBlank(message = "客户电话不能为空") - @ApiModelProperty(value = "客户电话",required = true) - private String customerPhone; - - /** - * 云id - */ - @NotBlank(message = "云订单id不能为空") - @ApiModelProperty(value = "云订单id",required = true) - private String orderCloudId; - - /** - * 总金额 - */ - @NotNull(message = "总金额不能为空") - @ApiModelProperty(value = "总金额",required = true) - private BigDecimal totalAmount; - - /** - * 总支付金额 - */ - @NotNull(message = "总支付金额不能为空") - @ApiModelProperty(value = "总支付金额",required = true) - private BigDecimal totalPayAmount; - - /** - * openId - */ - @ApiModelProperty("openId") - private String openId; - - /** - * 订单名 - */ - @ApiModelProperty("订单内容(课卡名/商品名)") - private String orderContent; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/PlugBo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/PlugBo.java deleted file mode 100644 index ed8f2bc..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/PlugBo.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.cpop.jambox.business.bo; - -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-05 12:47 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "PlugBo对象", description = "插件请求参数") -public class PlugBo { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 插件名 - */ - @NotBlank(message = "插件名不能为空") - @ApiModelProperty(value = "插件名",required = true) - private String name; - - /** - * 插件标签 - */ - @NotBlank(message = "插件标签不能为空") - @ApiModelProperty(value = "插件标签",required = true) - private String plugTag; - - /** - * 插件图标地址 - */ - @ApiModelProperty("插件图标地址") - private String picUrl; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空") - @ApiModelProperty(value = "排序",required = true) - private Integer orderNo; - - /** - * 备注 - */ - @ApiModelProperty(value = "备注") - private String remark; - - /** - * 状态(0:禁用;1:使用) - */ - @NotNull(message = "状态不能为空") - @ApiModelProperty(value = "状态",required = true) - private Integer status; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/UnionPayDto.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/UnionPayDto.java deleted file mode 100644 index e217902..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/bo/UnionPayDto.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cpop.jambox.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-08 9:20 - */ -@Data -@ApiModel(value = "联合支付") -public class UnionPayDto { - - /** - * 先学后付次付 - */ - @ApiModelProperty("先学后付次付") - private LearnNowPayLaterOncePayDto learnNowPayLaterOncePayDto; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessDataController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessDataController.java deleted file mode 100644 index 6e18389..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessDataController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.BusinessData; -import com.cpop.jambox.business.service.BusinessDataService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 业务数据表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 业务数据表接口") -@RequestMapping("/backstage/businessData") -public class BackstageBusinessDataController { - - @Autowired - private BusinessDataService businessDataService; - - /** - * 添加果酱模块化官网 业务数据表。 - * - * @param businessData 果酱模块化官网 业务数据表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 业务数据表") - public R save(@RequestBody @ApiParam("果酱模块化官网 业务数据表") BusinessData businessData) { - businessDataService.save(businessData); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 业务数据表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 业务数据表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 业务数据表主键") Serializable id) { - businessDataService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 业务数据表。 - * - * @param businessData 果酱模块化官网 业务数据表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 业务数据表") - public R update(@RequestBody @ApiParam("果酱模块化官网 业务数据表主键") BusinessData businessData) { - businessDataService.updateById(businessData); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 业务数据表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 业务数据表") - public R> list() { - return R.ok(businessDataService.list()); - } - - /** - * 根据果酱模块化官网 业务数据表主键获取详细信息。 - * - * @param id 果酱模块化官网 业务数据表主键 - * @return 果酱模块化官网 业务数据表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 业务数据表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 业务数据表主键") Serializable id) { - return R.ok(businessDataService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 业务数据表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 业务数据表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(businessDataService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessIntroController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessIntroController.java deleted file mode 100644 index f051132..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageBusinessIntroController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.BusinessIntro; -import com.cpop.jambox.business.service.BusinessIntroService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 业务介绍表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 业务介绍表接口") -@RequestMapping("/backstage/businessIntro") -public class BackstageBusinessIntroController { - - @Autowired - private BusinessIntroService businessIntroService; - - /** - * 添加果酱模块化官网 业务介绍表。 - * - * @param businessIntro 果酱模块化官网 业务介绍表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 业务介绍表") - public R save(@RequestBody @ApiParam("果酱模块化官网 业务介绍表") BusinessIntro businessIntro) { - businessIntroService.save(businessIntro); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 业务介绍表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 业务介绍表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 业务介绍表主键") Serializable id) { - businessIntroService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 业务介绍表。 - * - * @param businessIntro 果酱模块化官网 业务介绍表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 业务介绍表") - public R update(@RequestBody @ApiParam("果酱模块化官网 业务介绍表主键") BusinessIntro businessIntro) { - businessIntroService.updateById(businessIntro); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 业务介绍表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 业务介绍表") - public R> list() { - return R.ok(businessIntroService.list()); - } - - /** - * 根据果酱模块化官网 业务介绍表主键获取详细信息。 - * - * @param id 果酱模块化官网 业务介绍表主键 - * @return 果酱模块化官网 业务介绍表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 业务介绍表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 业务介绍表主键") Serializable id) { - return R.ok(businessIntroService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 业务介绍表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 业务介绍表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(businessIntroService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCompanyIntroController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCompanyIntroController.java deleted file mode 100644 index a63fd5d..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCompanyIntroController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.CompanyIntro; -import com.cpop.jambox.business.service.CompanyIntroService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 公司简介表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 公司简介表接口") -@RequestMapping("/backstage/companyIntro") -public class BackstageCompanyIntroController { - - @Autowired - private CompanyIntroService companyIntroService; - - /** - * 添加果酱模块化官网 公司简介表。 - * - * @param companyIntro 果酱模块化官网 公司简介表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 公司简介表") - public R save(@RequestBody @ApiParam("果酱模块化官网 公司简介表") CompanyIntro companyIntro) { - companyIntroService.save(companyIntro); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 公司简介表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 公司简介表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 公司简介表主键") Serializable id) { - companyIntroService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 公司简介表。 - * - * @param companyIntro 果酱模块化官网 公司简介表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 公司简介表") - public R update(@RequestBody @ApiParam("果酱模块化官网 公司简介表主键") CompanyIntro companyIntro) { - companyIntroService.updateById(companyIntro); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 公司简介表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 公司简介表") - public R> list() { - return R.ok(companyIntroService.list()); - } - - /** - * 根据果酱模块化官网 公司简介表主键获取详细信息。 - * - * @param id 果酱模块化官网 公司简介表主键 - * @return 果酱模块化官网 公司简介表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 公司简介表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 公司简介表主键") Serializable id) { - return R.ok(companyIntroService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 公司简介表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 公司简介表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(companyIntroService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationController.java deleted file mode 100644 index 6759a53..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.Cooperation; -import com.cpop.jambox.business.service.CooperationService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 合作平台表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 合作平台表接口") -@RequestMapping("/backstage/cooperation") -public class BackstageCooperationController { - - @Autowired - private CooperationService cooperationService; - - /** - * 添加果酱模块化官网 合作平台表。 - * - * @param cooperation 果酱模块化官网 合作平台表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 合作平台表") - public R save(@RequestBody @ApiParam("果酱模块化官网 合作平台表") Cooperation cooperation) { - cooperationService.save(cooperation); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 合作平台表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 合作平台表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 合作平台表主键") Serializable id) { - cooperationService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 合作平台表。 - * - * @param cooperation 果酱模块化官网 合作平台表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 合作平台表") - public R update(@RequestBody @ApiParam("果酱模块化官网 合作平台表主键") Cooperation cooperation) { - cooperationService.updateById(cooperation); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 合作平台表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 合作平台表") - public R> list() { - return R.ok(cooperationService.selectTypeNameList()); - } - - /** - * 根据果酱模块化官网 合作平台表主键获取详细信息。 - * - * @param id 果酱模块化官网 合作平台表主键 - * @return 果酱模块化官网 合作平台表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 合作平台表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 合作平台表主键") Serializable id) { - return R.ok(cooperationService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 15:42 - * @param: [typeId] - * @return: com.cpop.core.base.entity.R> - **/ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 合作平台表") - public R> page(@ApiParam("平台类型") String typeId) { - Page cooperationPage = cooperationService.getPage(typeId); - return R.ok(cooperationPage); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationTypeController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationTypeController.java deleted file mode 100644 index fb1e00c..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageCooperationTypeController.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.vo.CooperationTypeVo; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.CooperationType; -import com.cpop.jambox.business.service.CooperationTypeService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 合作类别表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 合作类别表接口") -@RequestMapping("/backstage/cooperationType") -public class BackstageCooperationTypeController { - - @Autowired - private CooperationTypeService cooperationTypeService; - - /** - * 添加果酱模块化官网 合作类别表。 - * - * @param cooperationType 果酱模块化官网 合作类别表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 合作类别表") - public R save(@RequestBody @ApiParam("果酱模块化官网 合作类别表") CooperationType cooperationType) { - cooperationTypeService.save(cooperationType); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 合作类别表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 合作类别表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 合作类别表主键") Serializable id) { - cooperationTypeService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 合作类别表。 - * - * @param cooperationType 果酱模块化官网 合作类别表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 合作类别表") - public R update(@RequestBody @ApiParam("果酱模块化官网 合作类别表主键") CooperationType cooperationType) { - cooperationTypeService.updateById(cooperationType); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 合作类别表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 合作类别表") - public R> list() { - List cooperationTypeVoList = cooperationTypeService.getList(); - return R.ok(cooperationTypeVoList); - } - - /** - * 根据果酱模块化官网 合作类别表主键获取详细信息。 - * - * @param id 果酱模块化官网 合作类别表主键 - * @return 果酱模块化官网 合作类别表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 合作类别表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 合作类别表主键") Serializable id) { - return R.ok(cooperationTypeService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 合作类别表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 合作类别表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(cooperationTypeService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageDevelopmentController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageDevelopmentController.java deleted file mode 100644 index 2464b18..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageDevelopmentController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.mybatisflex.core.paginate.Page; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.Development; -import com.cpop.jambox.business.service.DevelopmentService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.time.LocalDate; -import java.util.List; - -/** - * 果酱模块化官网 发展历程表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 发展历程表接口") -@RequestMapping("/backstage/development") -public class BackstageDevelopmentController { - - @Autowired - private DevelopmentService developmentService; - - /** - * 添加果酱模块化官网 发展历程表。 - * - * @param development 果酱模块化官网 发展历程表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 发展历程表") - public R save(@RequestBody @ApiParam("果酱模块化官网 发展历程表") Development development) { - developmentService.save(development); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 发展历程表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 发展历程表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 发展历程表主键") Serializable id) { - developmentService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 发展历程表。 - * - * @param development 果酱模块化官网 发展历程表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 发展历程表") - public R update(@RequestBody @ApiParam("果酱模块化官网 发展历程表主键") Development development) { - developmentService.updateById(development); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 发展历程表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 发展历程表") - public R> list() { - return R.ok(developmentService.list()); - } - - /** - * 根据果酱模块化官网 发展历程表主键获取详细信息。 - * - * @param id 果酱模块化官网 发展历程表主键 - * @return 果酱模块化官网 发展历程表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 发展历程表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 发展历程表主键") Serializable id) { - return R.ok(developmentService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 发展历程表。 - * - * @author: Yxz - * @date: 2024/1/24 14:41 - * @param: [title, startDate, endDate] - * @return: com.cpop.core.base.entity.R> - **/ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 发展历程表") - public R> page(@ApiParam("标题") String title, - @RequestParam(value = "startDate",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startDate, - @RequestParam(value = "endDate",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate) { - Page developmentPage = developmentService.selectPage(title,startDate,endDate); - return R.ok(developmentPage); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageEasyLearnController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageEasyLearnController.java deleted file mode 100644 index eb88985..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageEasyLearnController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.alibaba.excel.EasyExcel; -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.bo.*; -import com.cpop.jambox.business.dto.EasyLearnPageDto; -import com.cpop.jambox.business.service.EasyLearnOrderService; -import com.cpop.jambox.business.vo.EasyLearnPageVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URLEncoder; - -/** - * 果酱-放心学订单表 控制层。 - * - * @author DB - * @since 2023-12-14 - */ -@RestController -@Api(tags = "果酱-放心学订单表接口") -@RequestMapping("/backstage/easyLearn") -public class BackstageEasyLearnController { - - @Autowired - private EasyLearnOrderService easyLearnOrderService; - - - /** - * 获取放心学分页 - * @author DB - * @since 2023/12/15 - * @param bo 查询参数 - * @return R> - */ - @ApiOperation("查询放心学分页") - @GetMapping("/getEasyLearnPage") - public R> getEasyLearnPage(@Validated EasyLearnPageBo bo) { - Page page = easyLearnOrderService.getEasyLearnPage(bo); - return R.ok(page); - } - - /** - * 导出放心学数据 - * @author DB - * @since 2023/12/15 - * @param response 响应 - * @param bo 请求参数 - */ - @GetMapping("/getEasyLearnXml") - @ApiOperation("导出放心学数据") - public void getEasyLearnXml(HttpServletResponse response, @ApiParam("分页查询条件") @Validated EasyLearnPageBo bo) throws IOException { - // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setCharacterEncoding("utf-8"); - // 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系 - String fileFullName = "放心学"; - switch (bo.getOrderType()) { - case 0: - fileFullName = fileFullName + " 先学后付-次付 "; - break; - case 1: - fileFullName = fileFullName + " 先学后付-月付 "; - break; - case 2: - fileFullName = fileFullName + " 微信支付 "; - break; - case 3: - fileFullName = fileFullName + " 数字人民币 "; - break; - case 4: - fileFullName = fileFullName + " 机构会员 "; - break; - default: - } - String fileName = URLEncoder.encode(fileFullName + "数据", "UTF-8").replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - EasyExcel.write(response.getOutputStream(), EasyLearnPageDto.class).sheet("记录").doWrite(easyLearnOrderService.getEasyLearnXml(bo)); - } - - /** - * 一次性支付下单 - * @author DB - * @since 2023/10/23 12:15 - * @param bo 下单请求对象 - * @return com.cpop.core.base.entity.R - */ - @PostMapping("/oncePlaceOrder") - @ApiOperation("一次性支付下单") - public R oncePlaceOrder(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) { - return R.ok(easyLearnOrderService.oncePlaceOrder(bo)); - } - - /** - * 放心学统一支付 - * @author DB - * @since 2023/12/28 - * @param bo 请求参数 - * @return R - */ - @Deprecated - @PostMapping("/unionPay") - @ApiOperation("放心学统一支付") - public R unionPay(@RequestBody @Validated EasyLearnUnionPayBo bo) { - return R.ok(easyLearnOrderService.unionPay(bo)); - } - - /** - * 放心学统一支付 - * @author DB - * @since 2024/1/9 - * @param bo 请求参数 - * @return R - */ - @PostMapping("/unifiedPay") - @ApiOperation("放心学统一支付(测试)") - public R unifiedPay(@RequestBody @Validated @ApiParam("放心学统一支付") EasyLearnUnifiedPayBo bo) { - return R.ok(easyLearnOrderService.unifiedPay(bo)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageNavigationController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageNavigationController.java deleted file mode 100644 index 19870d2..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageNavigationController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.vo.NavigationVo; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.jambox.business.entity.website.Navigation; -import com.cpop.jambox.business.service.NavigationService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 导航栏表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 导航栏表接口") -@RequestMapping("/backstage/navigation") -public class BackstageNavigationController { - - @Autowired - private NavigationService navigationService; - - /** - * 添加果酱模块化官网 导航栏表。 - * - * @param navigation 果酱模块化官网 导航栏表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 导航栏表") - public R save(@RequestBody @ApiParam("果酱模块化官网 导航栏表") Navigation navigation) { - navigationService.save(navigation); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 导航栏表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 导航栏表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 导航栏表主键") Serializable id) { - navigationService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 导航栏表。 - * - * @param navigation 果酱模块化官网 导航栏表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 导航栏表") - public R update(@RequestBody @ApiParam("果酱模块化官网 导航栏表主键") Navigation navigation) { - navigationService.updateById(navigation); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 导航栏表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 导航栏表") - public R> list() { - List navigationVoList = navigationService.getList(); - return R.ok(navigationVoList); - } - - /** - * 根据果酱模块化官网 导航栏表主键获取详细信息。 - * - * @param id 果酱模块化官网 导航栏表主键 - * @return 果酱模块化官网 导航栏表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 导航栏表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 导航栏表主键") Serializable id) { - return R.ok(navigationService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 导航栏表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 导航栏表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(navigationService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageWebProductController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageWebProductController.java deleted file mode 100644 index faeb109..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/BackstageWebProductController.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.entity.website.WebProduct; -import com.cpop.jambox.business.service.WebProductService; -import com.mybatisflex.core.paginate.Page; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.io.Serializable; -import java.util.List; - -/** - * 果酱模块化官网 核心产品表 控制层。 - * - * @author Yxz - * @since 2024-01-19 - */ -@RestController -@Api(tags = "果酱模块化官网 核心产品表接口") -@RequestMapping("/backstage/webProduct") -public class BackstageWebProductController { - - @Autowired - private WebProductService productService; - - /** - * 添加果酱模块化官网 核心产品表。 - * - * @param product 果酱模块化官网 核心产品表 - * @return {@code true} 添加成功,{@code false} 添加失败 - */ - @PostMapping("/save") - @ApiOperation("保存果酱模块化官网 核心产品表") - public R save(@RequestBody @ApiParam("果酱模块化官网 核心产品表") WebProduct product) { - productService.save(product); - return R.ok(); - } - - /** - * 根据主键删除果酱模块化官网 核心产品表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/remove/{id}") - @ApiOperation("根据主键果酱模块化官网 核心产品表") - public R remove(@PathVariable @ApiParam("果酱模块化官网 核心产品表主键") Serializable id) { - productService.removeById(id); - return R.ok(); - } - - /** - * 根据主键更新果酱模块化官网 核心产品表。 - * - * @param product 果酱模块化官网 核心产品表 - * @return {@code true} 更新成功,{@code false} 更新失败 - */ - @PutMapping("/update") - @ApiOperation("根据主键更新果酱模块化官网 核心产品表") - public R update(@RequestBody @ApiParam("果酱模块化官网 核心产品表主键") WebProduct product) { - productService.updateById(product); - return R.ok(); - } - - /** - * 查询所有果酱模块化官网 核心产品表。 - * - * @return 所有数据 - */ - @GetMapping("/list") - @ApiOperation("查询所有果酱模块化官网 核心产品表") - public R> list() { - return R.ok(productService.list()); - } - - /** - * 根据果酱模块化官网 核心产品表主键获取详细信息。 - * - * @param id 果酱模块化官网 核心产品表主键 - * @return 果酱模块化官网 核心产品表详情 - */ - @GetMapping("/getInfo/{id}") - @ApiOperation("根据主键获取果酱模块化官网 核心产品表") - public R getInfo(@PathVariable @ApiParam("果酱模块化官网 核心产品表主键") Serializable id) { - return R.ok(productService.getById(id)); - } - - /** - * 分页查询果酱模块化官网 核心产品表。 - * - * @param page 分页对象 - * @return 分页对象 - */ - @GetMapping("/page") - @ApiOperation("分页查询果酱模块化官网 核心产品表") - public R> page(@ApiParam("分页信息") Page page) { - return R.ok(productService.page(page)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java deleted file mode 100644 index 74a9ac9..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/backstage/EasyLearnController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.cpop.jambox.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.bo.EasyLearnUnionPayBo; -import com.cpop.jambox.business.bo.OncePlaceOrderBo; -import com.cpop.jambox.business.service.EasyLearnOrderService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * 果酱-放心学订单表 控制层。 - * - * @author DB - * @since 2023-12-14 - */ -@RestController -@Api(tags = "果酱-放心学订单表接口") -@RequestMapping("/easyLearn") -@Deprecated -public class EasyLearnController { - - @Autowired - private EasyLearnOrderService easyLearnOrderService; - - /** - * 一次性支付下单 - * @author DB - * @since 2023/10/23 12:15 - * @param bo 下单请求对象 - * @return com.cpop.core.base.entity.R - */ - @PostMapping("/oncePlaceOrder") - @ApiOperation("一次性支付下单") - public R oncePlaceOrder(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) { - return R.ok(easyLearnOrderService.oncePlaceOrder(bo)); - } - - /** - * 放心学统一支付 - * @author DB - * @since 2023/12/28 - * @param bo 请求参数 - * @return R - */ - @Deprecated - @PostMapping("/unionPay") - @ApiOperation("放心学统一支付") - public R unionPay(@RequestBody @Validated EasyLearnUnionPayBo bo) { - return R.ok(easyLearnOrderService.unionPay(bo)); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/CallBackEasyLearnController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/CallBackEasyLearnController.java deleted file mode 100644 index cdff91e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/CallBackEasyLearnController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.cpop.jambox.business.controller.callback; - -import com.cpop.jambox.business.service.EasyLearnOrderService; -import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-20 0:22 - */ -@RestController -@Api(tags = "果酱-放心学回调接口") -@RequestMapping("/callback/easyLearn") -public class CallBackEasyLearnController { - - @Autowired - private EasyLearnOrderService easyLearnOrderService; - - /** - * 用户签约成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 返回参数 - */ - @ApiOperation("放心学先学后付支付分回调通知") - @PostMapping("/learnNowPayLaterUserSignPlanNotify") - public String learnNowPayLaterUserSignPlanNotifyUrl(@RequestBody String notifyData) { - easyLearnOrderService.learnNowPayLaterUserSignPlanNotify(notifyData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * 支付分用户核销成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 返回参数 - */ - @ApiOperation("支付分用户核销成功回调") - @PostMapping("/userServiceOrderSuccess") - public String userServiceOrderSuccess(@RequestBody String notifyData) { - easyLearnOrderService.userServiceOrderSuccess(notifyData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * 微信支付订单通知 - * @author DB - * @since 2023/12/21 - * @param xmlData 数据 - * @return java.lang.String - */ - @ApiOperation("微信支付订单通知") - @PostMapping("/notify/oncePay") - public String oncePayResult(@RequestBody String xmlData){ - easyLearnOrderService.oncePayResult(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * 微信支付联合支付订单通知 - * @param xmlData 数据 - * @return java.lang.String - */ - @ApiOperation("微信支付联合支付订单通知") - @PostMapping("/notify/unionPay") - public String unionPay(@RequestBody String xmlData){ - easyLearnOrderService.unionPayResult(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * 微信支付联合支付普通订单通知 - * @return java.lang.String - */ - @ApiOperation("微信支付联合支付普通订单通知") - @PostMapping("/notify/normalUnionPay") - public String normalUnionPay(HttpServletRequest request, HttpServletResponse response){ - return easyLearnOrderService.normalUnionPay(request,response); - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java deleted file mode 100644 index a3af840..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/callback/EasyLearnCallBackController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.cpop.jambox.business.controller.callback; - -import com.cpop.jambox.business.service.EasyLearnOrderService; -import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; -import io.swagger.annotations.Api; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-21 16:06 - */ -@RestController -@Api(tags = "果酱-放心学回调接口") -@RequestMapping("/easyLearn/callback") -@Deprecated -public class EasyLearnCallBackController { - - @Autowired - private EasyLearnOrderService easyLearnOrderService; - - /** - * 微信支付订单通知 - * @author DB - * @since 2023/12/21 - * @param xmlData 数据 - * @return java.lang.String - */ - @PostMapping("/notify/oncePay") - public String oncePayResult(@RequestBody String xmlData){ - easyLearnOrderService.oncePayResult(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * 微信支付联合支付订单通知 - * @param xmlData 数据 - * @return java.lang.String - */ - @PostMapping("/notify/unionPay") - public String unionPay(@RequestBody String xmlData){ - easyLearnOrderService.unionPayResult(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniCardTemplateController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniCardTemplateController.java deleted file mode 100644 index 140e397..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniCardTemplateController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.cpop.jambox.business.controller.mini; - -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.bo.CardTemplateUnionBo; -import com.cpop.jambox.business.entity.CardTemplate; -import com.cpop.jambox.business.service.CardTemplateExtendService; -import com.cpop.jambox.business.service.CardTemplateService; -import com.cpop.jambox.business.vo.CardTemplateInfoVo; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import static com.cpop.jambox.business.entity.table.CardTemplateExtendTableDef.CARD_TEMPLATE_EXTEND; -import static com.cpop.jambox.business.entity.table.CardTemplateTableDef.CARD_TEMPLATE; - -/** - * 果酱-课卡模板 控制层。 - * - * @author DB - * @since 2023-09-27 - */ -@RestController -@Api(tags = "果酱-课卡模板接口") -@RequestMapping("/mini/cardTemplate") -public class MiniCardTemplateController { - - @Autowired - private CardTemplateService cardTemplateService; - - /** - * 添加课卡模板(整合) - * @author DB - * @since 2023/10/07 9:59 - * @param bo 请求参数 - */ - //@SimpleSignatureCheck - @ApiOperation(value = "添加课卡模板(整合)") - @PostMapping("/insertCardTemplateUnion") - public R insertCardTemplateUnion(@RequestBody @Validated CardTemplateUnionBo bo) { - cardTemplateService.insertCardTemplateUnion(bo); - return R.ok(); - } - - /** - * 修改课卡模板(整合) - * @author DB - * @since 2023/10/07 9:59 - * @param bo 请求参数 - */ - //@SimpleSignatureCheck - @ApiOperation(value = "修改课卡模板(整合)") - @PutMapping("/updateCardTemplateUnion") - public R updateCardTemplateUnion(@RequestBody @Validated CardTemplateUnionBo bo) { - cardTemplateService.updateCardTemplateUnion(bo); - return R.ok(); - } - - /** - * 删除课卡模板 - * @author DB - * @since 2024/1/19 - * @param oldId 旧主键id - * @return R - */ - @Deprecated - @ApiOperation(value = "删除课卡模板") - @DeleteMapping("/removeCardTemplateById/{oldId}") - public R removeCardTemplateById(@PathVariable String oldId) { - CardTemplate cardTemplate = cardTemplateService.queryChain().where(CARD_TEMPLATE.OLD_TEMPLATE_ID.eq(oldId)).one(); - cardTemplateService.updateChain() - .where(CARD_TEMPLATE.OLD_TEMPLATE_ID.eq(oldId)) - .remove(); - SpringUtils.getBean(CardTemplateExtendService.class).updateChain() - .where(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(cardTemplate.getId())) - .remove(); - return R.ok(); - } - - /** - * 获取模板信息 - * @author DB - * @since 2024/1/22 - * @param id 主键 - * @return R - */ - @ApiOperation(value = "获取模板信息") - @GetMapping("/getCardTemplateInfo") - public R getCardTemplateInfo(@ApiParam("id") @RequestParam(value = "id", required = false) String id, - @ApiParam("旧模板id") @RequestParam(value = "oldTemplateId", required = false) String oldTemplateId) { - CardTemplateInfoVo vo = cardTemplateService.getCardTemplateInfo(id, oldTemplateId); - return R.ok(vo); - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniEasyLearnController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniEasyLearnController.java deleted file mode 100644 index 7b0e475..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/mini/MiniEasyLearnController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.cpop.jambox.business.controller.mini; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.bo.LearnNowPayLaterServiceOrderBo; -import com.cpop.jambox.business.bo.LearnNowPayLaterStopUserSignPlansBo; -import com.cpop.jambox.business.bo.LearnNowPayLaterUserSignPlansBo; -import com.cpop.jambox.business.service.CardTemplateService; -import com.cpop.jambox.business.service.EasyLearnOrderService; -import com.cpop.jambox.business.vo.LearnNowPayLaterPlanVo; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanResult; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreUserSignPlanResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-18 22:58 - */ -@RestController -@Api(tags = "果酱小程序-放心学接口") -@RequestMapping("/mini/easyLearn") -public class MiniEasyLearnController { - - @Autowired - private CardTemplateService cardTemplateService; - - @Autowired - private EasyLearnOrderService easyLearnOrderService; - - /** - * 获取支付分计划 - * @author DB - * @since 2024/1/18 - * @param oldTemplateId 旧模板id - * @param isMonth 是否月付 - * @return R - */ - @ApiOperation("获取支付分计划") - @GetMapping("/getWxPayScorePlan") - public R getWxPayScorePlan(@ApiParam(value = "旧模板id") @RequestParam(value = "oldTemplateId", required = false) String oldTemplateId, - @ApiParam(value = "模板id") @RequestParam(value = "templateId", required = false) String templateId, - @ApiParam(value = "是否月付(0否1是)", required = true) @RequestParam("isMonth") Boolean isMonth) { - LearnNowPayLaterPlanVo vo = cardTemplateService.getWxPayScorePlan(oldTemplateId, templateId, isMonth); - return R.ok(vo); - } - - /** - * 获取支付分计划 - * - * @param bo 请求参数 - * @return R - * @author DB - * @since 2024/1/18 - */ - @ApiOperation("创建用户签约计划") - @PostMapping("/createUserSignPlans") - public R createUserSignPlans(@RequestBody @Validated LearnNowPayLaterUserSignPlansBo bo) { - WxPartnerPayScoreUserSignPlanResult result = easyLearnOrderService.createUserSignPlans(bo); - return R.ok(result); - } - - /** - * 创建用户服务订单(核销) - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - */ - @ApiOperation("创建用户服务订单(核销)") - @PostMapping("/createServiceOrder") - public R createServiceOrder(@RequestBody @Validated LearnNowPayLaterServiceOrderBo bo) { - WxPartnerPayScoreSignPlanResult result = easyLearnOrderService.createServiceOrder(bo); - return R.ok(result); - } - - /** - * 取消用户签约计划 - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - * @return R - */ - @ApiOperation("取消用户签约计划") - @PostMapping("/stopUserSignPlans") - public R stopUserSignPlans(@RequestBody @Validated LearnNowPayLaterStopUserSignPlansBo bo){ - easyLearnOrderService.stopUserSignPlans(bo); - return R.ok(); - } - - /** - * 发送数币手机验证码 - * @author DB - * @since 2024/1/29 - * @param phone 手机 - * @return R - */ - @ApiOperation("发送数币手机验证码") - @GetMapping("/sendEcppMsmCode/{phone}") - public R sendEcppMsmCode(@PathVariable String phone) { - easyLearnOrderService.sendEcppMsmCode(phone); - return R.ok(); - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/website/WebsiteController.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/website/WebsiteController.java deleted file mode 100644 index baabac3..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/controller/website/WebsiteController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.cpop.jambox.business.controller.website; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.service.*; -import com.mybatisflex.core.query.QueryWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -@RestController -@Api(tags = "果酱官网接口") -@RequestMapping("/website") -public class WebsiteController { - - @Autowired - private NavigationService navigationService; - @Autowired - private BusinessDataService businessDataService; - @Autowired - private WebProductService productService; - @Autowired - private WebsiteService websiteService; - - /** - * @description:获取导航栏 - * @author: Yxz - * @date: 2024/1/19 17:37 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取导航栏") - @GetMapping("/getNavigationList") - public R getNavigationList(){ - return R.ok(navigationService.list()); - } - - - /** - * @description: 获取公司简介 - * @author: Yxz - * @date: 2024/1/19 17:37 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取公司简介") - @GetMapping("/getCompanyIntro") - public R getCompanyIntro(){ - return R.ok(websiteService.getCompanyIntro()); - } - - /** - * @description: 获取公司业务数据 - * @author: Yxz - * @date: 2024/1/19 17:38 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取公司业务数据") - @GetMapping("/getBusinessData") - public R getBusinessData(){ - return R.ok(businessDataService.list()); - } - - /** - * @description: 获取公司业务介绍 - * @author: Yxz - * @date: 2024/1/19 17:38 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取公司业务介绍") - @GetMapping("/getBusinessIntro") - public R getBusinessIntro(){ - return R.ok(websiteService.getBusinessIntro()); - } - - /** - * 获取核心产品列表 - * - * @author: Yxz - * @date: 2024/1/21 18:01 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取核心产品列表") - @GetMapping("/getProductList") - public R getProductList(){ - return R.ok(productService.list(QueryWrapper.create().orderBy("create_time"))); - } - - /** - * @description: 获取合作平台 - * @author: Yxz - * @date: 2024/1/19 17:38 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取合作平台") - @GetMapping("/getCooperationPlatform") - public R getCooperationPlatform(){ - return R.ok(websiteService.getCooperationPlatform()); - } - - /** - * 获取发展历程 - * - * @author: Yxz - * @date: 2024/1/21 11:55 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @ApiOperation("获取发展历程") - @GetMapping("/getDevelopmentCourse") - public R getDevelopmentCourse(){ - return websiteService.getDevelopmentCourse(); - } - - - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/dto/EasyLearnPageDto.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/dto/EasyLearnPageDto.java deleted file mode 100644 index bd78a32..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/dto/EasyLearnPageDto.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.cpop.jambox.business.dto; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-15 16:14 - */ -@Data -public class EasyLearnPageDto { - - /** - * 品牌名 - */ - @ExcelProperty(value = "品牌") - private String brandName; - /** - * 校区名 - */ - @ExcelProperty(value = "校区") - private String storeName; - /** - * 客户名 - */ - @ExcelProperty(value = "学员姓名") - private String customerName; - /** - * 客户电话 - */ - @ExcelProperty(value = "学员电话") - private String customerPhone; - /** - * 课卡名 - */ - @ExcelProperty(value = "课卡名") - private String productName; - /** - * 期数 - */ - @ExcelProperty(value = "期数") - private Long periodNumber; - /** - * 签约金额 - */ - @ExcelProperty(value = "签约金额") - private BigDecimal totalAmount; - /** - * 支付金额 - */ - @ExcelProperty(value = "已付金额") - private BigDecimal totalPayAmount; - - /** - * 顾问 - */ - @ExcelProperty(value = "顾问") - private String staffName; - /** - * 签约时间 - */ - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ExcelProperty(value = "签约时间") - private LocalDateTime createTime; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandExtend.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandExtend.java deleted file mode 100644 index 5308caf..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/BrandExtend.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱品牌拓展表 实体类。 - * - * @author DB - * @since 2023-10-25 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_brand_extend", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class BrandExtend extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 系统品牌id - */ - private String brandId; - - /** - * 云函数id - */ - private String brandCloudId; - - /** - * 是否删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplate.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplate.java deleted file mode 100644 index 890f36b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplate.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Date; -import java.time.LocalDate; - -/** - * 果酱-课卡模板 实体类。 - * - * @author DB - * @since 2023-09-27 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_card_template", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class CardTemplate extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 旧模板id - */ - private String oldTemplateId; - - /** - * 品牌id - */ - private String brandId; - - /** - * 校区id - */ - private String storeId; - - /** - * 是否使用(0否1是) - */ - private Boolean status; - - /** - * 模板名 - */ - private String name; - - /** - * 有效日期数 - */ - private Integer validDay; - - /** - * 结束日期 - */ - private LocalDate endDate; - - /** - * 价格 - */ - private BigDecimal price; - - /** - * 课时 - */ - private Integer classNumber; - - /** - * 周预约数 - */ - private Integer weekAppointment; - - /** - * 日预约数 - */ - private Integer dayAppointment; - - /** - * 缓冲天数 - */ - private Integer bufferDay; - - /** - * 模板类型(0:课时卡,1:时限卡,2:储值卡) - */ - private Integer templateType; - - /** - * 使用范围 - */ - private String scopeUse; - - /** - * 太阳码 - */ - private String qrCode; - - /** - * 是否是会员(0否1是) - */ - private Boolean isMember; - - /** - * 是否是引流卡 - */ - private Boolean isDrainage; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplateExtend.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplateExtend.java deleted file mode 100644 index fcc457f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/CardTemplateExtend.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模板拓展表 实体类。 - * - * @author DB - * @since 2024-01-17 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_card_template_extend", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class CardTemplateExtend extends BaseEntity implements Serializable { - - /** - * 模板id - */ - @Id - private String templateId; - - /** - * 支付类型(0:微信支付;1:先学后付次付;2:旧放心学合约支付;3:数字人民币支付;4:线下支付;5:先学后付月付 - */ - @Id - private Integer payType; - - /** - * 拓展id - */ - private String extendId; - - /** - * 拓展参数1 - */ - private String extendParamOne; - - /** - * 拓展参数2 - */ - private String extendParamTwo; - - /** - * 拓展参数3 - */ - private String extendParamThree; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java deleted file mode 100644 index 966bff7..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrder.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 果酱-放心学订单表 实体类。 - * - * @author DB - * @since 2023-12-14 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_easy_learn_order", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class EasyLearnOrder extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 购买的商品信息 - */ - private String orderContent; - - /** - * 支付状态(0:未支付;1已支付) - */ - private Integer orderStatus; - - /** - * 联合支付外部订单id - */ - private String unionPayOutOrderId; - - /** - * 云id - */ - private String orderCloudId; - - /** - * 外部订单号 - */ - private String outOrderNo; - - /** - * 品牌id - */ - private String brandId; - - /** - * 校区id - */ - private String storeId; - - /** - * 客户名 - */ - private String customerName; - - /** - * 客户电话 - */ - private String customerPhone; - - /** - * 产品/课卡id - */ - private String productId; - - /** - * 总金额 - */ - private BigDecimal totalAmount; - - /** - * 总支付金额 - */ - private BigDecimal totalPayAmount; - - /** - * 订单类型(0:先学后付;1:月付;2:微信支付;3:数币支付;4:机构会员) - */ - private Integer orderType; - - /** - * 分账比例 - */ - private Double rate; - - /** - * 模板id - */ - private String templateId; - - /** - * 顾问 - */ - private String counselor; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderDetail.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderDetail.java deleted file mode 100644 index 3e0bcdf..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderDetail.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱-放心学订单详情表 实体类。 - * - * @author DB - * @since 2023-12-14 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_easy_learn_order_detail", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class EasyLearnOrderDetail extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 放心学订单id - */ - @Id - private String orderId; - - /** - * 外部订单号 - */ - private String outOrderNo; - - /** - * 期号 - */ - private Integer periodNo; - - /** - * 金额 - */ - private BigDecimal amount; - - /** - * 实际支付金额 - */ - private BigDecimal actualPrice; - - /** - * 详情描述 - */ - private String detailDesc; - - /** - * 计划详情名称 - */ - private String detailName; - - /** - * 【计划明细状态】 计划明细状态 - * 可选取值: - * NOT_USED: 本计划详情还未使用 - * USING: 本计划详情使用中,已有对应的服务订单 - * USED: 本计划详情已使用,对应的服务订单已完成支付 - * SIGN_PLAN_DETAIL_CANCEL: 本计划详情已取消使用,对应的服务订单已取消 - */ - private Integer detailStatus; - - /** - * 支付时间 - */ - private LocalDateTime payTime; - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderExtend.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderExtend.java deleted file mode 100644 index 767650a..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/EasyLearnOrderExtend.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Date; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱-放心学-订单拓展 实体类。 - * - * @author DB - * @since 2023-12-14 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_easy_learn_order_extend", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class EasyLearnOrderExtend extends BaseEntity implements Serializable { - - /** - * 放心学订单id - */ - @Id - private String orderId; - - /** - * 【目前用户进行到的计划详情序号】 序号从1开始,顺序按照创建计划时传入的计划详情顺序,0代表无任何详情开始使用 - */ - private Integer goingDetailNo; - - /** - * 计划id(系统内部计划id) - */ - private String planId; - - /** - * 签约计划id - */ - private String signPlanId; - - /** - * 下期还款日 - */ - private Date nextRepaymentDate; - - /** - * 下期还款金额 - */ - private BigDecimal nextRepaymentAmount; - - /** - * 子商户id - */ - private String subMchId; - - /** - * 【计划签约状态】 计划签约状态 - * 可选取值: - * UNSIGNED: 用户未签约 - * SIGNED: 用户已签约 - * SIGN_PLAN_CANCEL: 签约计划已取消 - * COMPLETE: 签约计划的所有计划详情已经全部完成 - * EXPIRE: 签约计划已过期 - */ - private Integer extendStatus; - - /** - * 【签约计划取消类型】 签约计划取消类型 - * 可选取值: - * NOT_CANCEL: 用户已签约协议未取消 - * USER: 用户取消已签约的协议 - * MERCHANT: 商户取消已签约的协议 - * REVOKE_SERVICE: 用户解除服务授权时取消服务下的已签约协议 - */ - private Integer extendCancelType; - - /** - * 取消时间 - */ - private LocalDateTime cancelTime; - - /** - * 取消原因 - */ - private String cancelReason; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Plug.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Plug.java deleted file mode 100644 index 02cafdd..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/Plug.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱-插件 实体类。 - * - * @author DB - * @since 2024-01-05 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_plug", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Plug extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 插件名 - */ - private String name; - - /** - * 插件标签 - */ - private String plugTag; - - /** - * 插件图标地址 - */ - private String picUrl; - - /** - * 排序 - */ - private Integer orderNo; - - /** - * 备注 - */ - private String remark; - - /** - * 状态(0:禁用;1:使用) - */ - private Integer status; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreActive.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreActive.java deleted file mode 100644 index b72ba15..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreActive.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.sql.Date; -import java.time.LocalDate; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 校区活跃数表 实体类。 - * - * @author DB - * @since 2024-04-12 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_store_active", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class StoreActive extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 品牌名 - */ - private String brandName; - - /** - * 品牌云id - */ - private String brandCloudId; - - /** - * 校区名 - */ - private String storeName; - - /** - * 校区云id - */ - private String storeCloudId; - - /** - * 日期 - */ - private LocalDate activeDate; - - /** - * 活跃数 - */ - private Integer activeNum; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreExtend.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreExtend.java deleted file mode 100644 index ccb552b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StoreExtend.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱校区拓展表 实体类。 - * - * @author DB - * @since 2023-10-26 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_store_extend", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class StoreExtend extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 校区/店铺id - */ - private String storeId; - - /** - * 云校区id - */ - private String storeCloudId; - - - - - - /** - * 是否删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StorePlug.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StorePlug.java deleted file mode 100644 index c19d58f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/StorePlug.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.cpop.jambox.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 校区-插件记录表 实体类。 - * - * @author DB - * @since 2023-12-29 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_store_plug", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class StorePlug extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 校区id - */ - private String storeId; - - /** - * 插件标记 - */ - private String plugTag; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java deleted file mode 100644 index 4af94b2..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessData.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 业务数据表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_business_data", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class BusinessData extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 数据名称 - */ - private String dataName; - - /** - * 数据 - */ - private String data; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessIntro.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessIntro.java deleted file mode 100644 index 9592395..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/BusinessIntro.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 业务介绍表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_business_intro", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class BusinessIntro extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 业务介绍 - */ - private String intro; - - /** - * 图片 - */ - private String imgUrl; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CompanyIntro.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CompanyIntro.java deleted file mode 100644 index f6f89de..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CompanyIntro.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 公司简介表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_company_intro", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class CompanyIntro extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 标题 - */ - private String title; - - /** - * 内容 - */ - private String content; - - /** - * 图片一 - */ - private String imgOne; - - /** - * 图片二 - */ - private String imgTwo; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Cooperation.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Cooperation.java deleted file mode 100644 index f86720a..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Cooperation.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 合作平台表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_cooperation", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Cooperation extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 图片 - */ - private String imgUrl; - - /** - * 合作类别id - */ - private String typeId; - - /** - * 排序 - */ - private Integer sort; - - - /** - * 种类名称 - **/ - @Column(ignore = true) - private String typeName; - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CooperationType.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CooperationType.java deleted file mode 100644 index 63419b2..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/CooperationType.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 合作类别表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_cooperation_type", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class CooperationType extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 种类名称 - */ - private String typeName; - - - /** - * 排序 - */ - private Integer sort; - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Development.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Development.java deleted file mode 100644 index 5c1d05e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Development.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDate; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; -import org.joda.time.DateTime; - -/** - * 果酱模块化官网 发展历程表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_development", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Development extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 标题 - */ - private String title; - - /** - * 图片 - */ - private String imgUrl; - - /** - * 跳转链接 - */ - private String link; - - /** - * 发布时间 - */ - private LocalDate publishTime; - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/WebProduct.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/WebProduct.java deleted file mode 100644 index e81b443..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/WebProduct.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.cpop.jambox.business.entity.website; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 果酱模块化官网 核心产品表 实体类。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_j_web_product", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class WebProduct extends BaseEntity implements Serializable { - - @Id - private String id; - - /** - * 产品名称 - */ - private String productName; - - /** - * 图片 - */ - private String imgUrl; - - /** - * 产品介绍 - */ - private String intro; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Integer isDelete; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandExtendMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandExtendMapper.java deleted file mode 100644 index 3c8fa39..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BrandExtendMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.BrandExtend; - -/** - * 果酱品牌拓展表 映射层。 - * - * @author DB - * @since 2023-10-25 - */ -public interface BrandExtendMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessDataMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessDataMapper.java deleted file mode 100644 index 27c7894..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessDataMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.BusinessData; - -/** - * 果酱模块化官网 业务数据表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface BusinessDataMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessIntroMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessIntroMapper.java deleted file mode 100644 index 7945a72..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/BusinessIntroMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.BusinessIntro; - -/** - * 果酱模块化官网 业务介绍表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface BusinessIntroMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateExtendMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateExtendMapper.java deleted file mode 100644 index 0a08f9f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateExtendMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.CardTemplateExtend; - -/** - * 果酱模板拓展表 映射层。 - * - * @author DB - * @since 2024-01-17 - */ -public interface CardTemplateExtendMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateMapper.java deleted file mode 100644 index 64268f8..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CardTemplateMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.CardTemplate; - -/** - * 果酱-课卡模板 映射层。 - * - * @author DB - * @since 2023-09-27 - */ -public interface CardTemplateMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CompanyIntroMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CompanyIntroMapper.java deleted file mode 100644 index 40475df..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CompanyIntroMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.CompanyIntro; - -/** - * 果酱模块化官网 公司简介表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CompanyIntroMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationMapper.java deleted file mode 100644 index f451291..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.Cooperation; - -/** - * 果酱模块化官网 合作平台表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CooperationMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationTypeMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationTypeMapper.java deleted file mode 100644 index 79b7ad6..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/CooperationTypeMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.CooperationType; - -/** - * 果酱模块化官网 合作类别表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CooperationTypeMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/DevelopmentMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/DevelopmentMapper.java deleted file mode 100644 index f265d0b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/DevelopmentMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.Development; - -import java.util.List; - -/** - * 果酱模块化官网 发展历程表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface DevelopmentMapper extends BaseMapper { - - /** - * 去重查找发布时间点 - * - * @author: Yxz - * @date: 2024/1/21 12:21 - * @param: [] - * @return: java.util.List - **/ - List selectDistinctPublishTime(); - - /** - * 根据发布时间点查找文章 - * - * @author: Yxz - * @date: 2024/1/21 14:32 - * @param: [] - * @return: java.util.List - **/ - List selectDevelopmentByPublishTime(String publishTime); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderDetailMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderDetailMapper.java deleted file mode 100644 index 04774e1..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderDetailMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.EasyLearnOrderDetail; - -/** - * 果酱-放心学订单详情表 映射层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderDetailMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderExtendMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderExtendMapper.java deleted file mode 100644 index ed84eba..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderExtendMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.EasyLearnOrderExtend; - -/** - * 果酱-放心学-订单拓展 映射层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderExtendMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderMapper.java deleted file mode 100644 index 11f75b8..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/EasyLearnOrderMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.cpop.jambox.business.entity.EasyLearnOrder; -import com.mybatisflex.core.BaseMapper; - -/** - * 果酱-放心学订单表 映射层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/PlugMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/PlugMapper.java deleted file mode 100644 index 7466663..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/PlugMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.Plug; - -/** - * 果酱-插件 映射层。 - * - * @author DB - * @since 2024-01-05 - */ -public interface PlugMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreActiveMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreActiveMapper.java deleted file mode 100644 index f8c09e1..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreActiveMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.StoreActive; - -/** - * 校区活跃数表 映射层。 - * - * @author DB - * @since 2024-04-12 - */ -public interface StoreActiveMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreExtendMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreExtendMapper.java deleted file mode 100644 index cdcb8fd..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StoreExtendMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.cpop.jambox.business.entity.StoreExtend; -import com.mybatisflex.core.BaseMapper; - -/** - * 果酱校区拓展表 映射层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface StoreExtendMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StorePlugMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StorePlugMapper.java deleted file mode 100644 index 52cc995..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/StorePlugMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.StorePlug; - -/** - * 校区-插件记录表 映射层。 - * - * @author DB - * @since 2023-12-29 - */ -public interface StorePlugMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/WebProductMapper.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/WebProductMapper.java deleted file mode 100644 index 81830c2..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/WebProductMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.mapper; - -import com.cpop.jambox.business.entity.website.WebProduct; -import com.mybatisflex.core.BaseMapper; - -/** - * 果酱模块化官网 核心产品表 映射层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface WebProductMapper extends BaseMapper { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandExtendService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandExtendService.java deleted file mode 100644 index 8fd39c0..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BrandExtendService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.BrandExtend; - -/** - * 果酱品牌拓展表 服务层。 - * - * @author DB - * @since 2023-10-25 - */ -public interface BrandExtendService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessDataService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessDataService.java deleted file mode 100644 index 4243c6e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessDataService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.BusinessData; - -/** - * 果酱模块化官网 业务数据表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface BusinessDataService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessIntroService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessIntroService.java deleted file mode 100644 index 7f17619..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/BusinessIntroService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.BusinessIntro; - -/** - * 果酱模块化官网 业务介绍表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface BusinessIntroService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateExtendService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateExtendService.java deleted file mode 100644 index 2021c53..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateExtendService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.CardTemplateExtend; - -/** - * 果酱模板拓展表 服务层。 - * - * @author DB - * @since 2024-01-17 - */ -public interface CardTemplateExtendService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java deleted file mode 100644 index dc3a79c..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CardTemplateService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.bo.CardTemplateUnionBo; -import com.cpop.jambox.business.entity.CardTemplate; -import com.cpop.jambox.business.vo.CardTemplateInfoVo; -import com.cpop.jambox.business.vo.LearnNowPayLaterPlanDetailVo; -import com.cpop.jambox.business.vo.LearnNowPayLaterPlanVo; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.service.IService; - -/** - * 果酱-课卡模板 服务层。 - * - * @author DB - * @since 2023-09-27 - */ -public interface CardTemplateService extends IService { - - /** - * @descriptions 旧品牌信息 - * @author DB - * @date 2023/11/13 12:39 - * @param oldTemplateId 旧模板id - * @param brandId 品牌id - * @return: com.cpop.jambox.business.entity.CardTemplate - */ - Row getOldTemplateInfo(String oldTemplateId, String brandId); - - /** - * 添加课卡模板(整合) - * @author DB - * @since 2024/1/16 - * @param bo 请求参数 - * @return String 旧模板id - */ - void insertCardTemplateUnion(CardTemplateUnionBo bo); - - /** - * 修改课卡模板(整合) - * @author DB - * @since 2024/1/18 - * @param bo 请求参数 - */ - void updateCardTemplateUnion(CardTemplateUnionBo bo); - - /** - * 获取支付分计划 - * @author DB - * @since 2024/1/18 - * @param oldTemplateId 旧模板id - * @param isMonth 是否月付 - * @return LearnNowPayLaterPlanDetailVo - */ - LearnNowPayLaterPlanVo getWxPayScorePlan(String oldTemplateId,String templateId, Boolean isMonth); - - /** - * 获取模板信息 - * @author DB - * @since 2024/1/22 - * @param id 主键 - */ - CardTemplateInfoVo getCardTemplateInfo(String id,String oldTemplateId); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CompanyIntroService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CompanyIntroService.java deleted file mode 100644 index 7e53b49..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CompanyIntroService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.CompanyIntro; - -/** - * 果酱模块化官网 公司简介表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CompanyIntroService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationService.java deleted file mode 100644 index 2f5286e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.Cooperation; - -import java.util.List; - -/** - * 果酱模块化官网 合作平台表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CooperationService extends IService { - - /** - * 查询所有果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 14:22 - * @param: [] - * @return: java.lang.Object - **/ - List selectTypeNameList(); - - /** - * 分页查询果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 15:39 - * @param: [typeId] - * @return: com.mybatisflex.core.paginate.Page - **/ - Page getPage(String typeId); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationTypeService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationTypeService.java deleted file mode 100644 index 4e2159a..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/CooperationTypeService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.vo.CooperationTypeVo; -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.CooperationType; - -import java.util.List; - -/** - * 果酱模块化官网 合作类别表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface CooperationTypeService extends IService { - - /** - * 查询所有果酱模块化官网 合作类别表。 - * - * @author: Yxz - * @date: 2024/1/22 19:18 - * @param: [] - * @return: java.util.List - **/ - List getList(); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/DevelopmentService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/DevelopmentService.java deleted file mode 100644 index aeca9de..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/DevelopmentService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.Development; - -import java.time.LocalDate; - -/** - * 果酱模块化官网 发展历程表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface DevelopmentService extends IService { - - /** - * 分页查询果酱模块化官网 发展历程表 - * - * @author: Yxz - * @date: 2024/1/21 15:53 - * @param: [title, link, publishTime] - * @return: com.mybatisflex.core.paginate.Page - **/ - Page selectPage(String title, LocalDate startTime,LocalDate endTime); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderDetailService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderDetailService.java deleted file mode 100644 index 46fad70..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderDetailService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.EasyLearnOrderDetail; - -/** - * 果酱-放心学订单详情表 服务层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderDetailService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderExtendService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderExtendService.java deleted file mode 100644 index f8cde82..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderExtendService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.EasyLearnOrderExtend; - -/** - * 果酱-放心学-订单拓展 服务层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderExtendService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java deleted file mode 100644 index 3ec128e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/EasyLearnOrderService.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.bo.*; -import com.cpop.jambox.business.dto.EasyLearnPageDto; -import com.cpop.jambox.business.entity.EasyLearnOrder; -import com.cpop.jambox.business.vo.EasyLearnPageVo; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanResult; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreUserSignPlanResult; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * 果酱-放心学订单表 服务层。 - * - * @author DB - * @since 2023-12-14 - */ -public interface EasyLearnOrderService extends IService { - - /** - * 获取放心学分页 - * @author DB - * @since 2023/12/15 - * @param bo 查询参数 - * @return Page - */ - Page getEasyLearnPage(EasyLearnPageBo bo); - - /** - * 导出放心学数据 - * @author DB - * @since 2023/12/15 - * @param bo 请求参数 - * @return List - */ - List getEasyLearnXml(EasyLearnPageBo bo); - - /** - * 微信支付订单通知 - * @author DB - * @since 2023/12/21 - * @param xmlData 数据 - */ - void oncePayResult(String xmlData); - - /** - * 一次性支付下单 - * @author DB - * @since 2023/10/23 12:15 - * @param bo 下单请求对象 - */ - Object oncePlaceOrder(OncePlaceOrderBo bo); - - /** - * 放心学统一支付 - * @author DB - * @since 2023/12/28 - * @param bo 请求参数 - * @return R - */ - Object unionPay(EasyLearnUnionPayBo bo); - - /** - * 微信支付联合支付订单通知 - * @param xmlData 数据 - */ - void unionPayResult(String xmlData); - - /** - * 放心学统一支付 - * @author DB - * @since 2024/1/9 - * @param bo 请求参数 - * @return Object - */ - Object unifiedPay(EasyLearnUnifiedPayBo bo); - - /** - * 创建用户签约计划 - * @author DB - * @since 2024/1/19 - * @param bo 请求参数 - */ - WxPartnerPayScoreUserSignPlanResult createUserSignPlans(LearnNowPayLaterUserSignPlansBo bo); - - /** - * 用户签约成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 返回参数 - */ - void learnNowPayLaterUserSignPlanNotify(String notifyData); - - /** - * 创建用户服务订单(核销) - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - * @return WxPartnerPayScoreSignPlanResult - */ - WxPartnerPayScoreSignPlanResult createServiceOrder(LearnNowPayLaterServiceOrderBo bo); - - /** - * 支付分用户核销成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 返回数据 - */ - void userServiceOrderSuccess(String notifyData); - - /** - * 取消用户签约计划 - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - */ - void stopUserSignPlans(LearnNowPayLaterStopUserSignPlansBo bo); - - /** - * 发送数币手机验证码 - * @author DB - * @since 2024/1/29 - * @param phone 手机号 - */ - void sendEcppMsmCode(String phone); - - /** - * 微信支付联合支付普通订单通知 - * @author DB - * @since 2024/2/22 - * @return String - */ - String normalUnionPay(HttpServletRequest request, HttpServletResponse response); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/PlugService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/PlugService.java deleted file mode 100644 index e37093e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/PlugService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.bo.PlugBo; -import com.cpop.jambox.business.vo.PlugPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.Plug; - -/** - * 果酱-插件 服务层。 - * - * @author DB - * @since 2024-01-05 - */ -public interface PlugService extends IService { - - /** - * 查询插件分页 - * @author DB - * @since 2024/1/5 - * @return R> - */ - Page getPlugPage(); - - /** - * 新增插件 - * @author DB - * @since 2024/1/5 - * @param bo 请求参数 - */ - void insertPlug(PlugBo bo); - - /** - * 修改插件 - * @author DB - * @since 2024/1/5 - * @param bo 请求参数 - */ - void updatePlug(PlugBo bo); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreActiveService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreActiveService.java deleted file mode 100644 index b3f6a1b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreActiveService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.StoreActive; - -/** - * 校区活跃数表 服务层。 - * - * @author DB - * @since 2024-04-12 - */ -public interface StoreActiveService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreExtendService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreExtendService.java deleted file mode 100644 index 0352e18..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StoreExtendService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.entity.StoreExtend; -import com.mybatisflex.core.service.IService; - -/** - * 果酱校区拓展表 服务层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface StoreExtendService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StorePlugService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StorePlugService.java deleted file mode 100644 index 8c05675..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/StorePlugService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.vo.StorePlugListVo; -import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.StorePlug; - -import java.util.List; - -/** - * 校区-插件记录表 服务层。 - * - * @author DB - * @since 2023-12-29 - */ -public interface StorePlugService extends IService { - - /** - * 查询校区插件列表 - * @author DB - * @since 2023/12/29 - * @param brandId 品牌 - * @param storeId 校区 - * @return List - */ - List getStorePlugList(String brandId, String storeId); -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebProductService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebProductService.java deleted file mode 100644 index 467a808..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebProductService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.jambox.business.entity.website.WebProduct; -import com.mybatisflex.core.service.IService; - -/** - * 果酱模块化官网 核心产品表 服务层。 - * - * @author Yxz - * @since 2024-01-19 - */ -public interface WebProductService extends IService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebsiteService.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebsiteService.java deleted file mode 100644 index 6058019..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/WebsiteService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cpop.jambox.business.service; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.entity.website.BusinessIntro; -import com.cpop.jambox.business.vo.CompanyIntroVo; -import com.cpop.jambox.business.vo.CooperationPlatformVo; - -import java.util.List; - -/** - * 模块化官网服务层 - * - * @Author: Yxz - * @Date: 2024/1/19 18:32 - */ -public interface WebsiteService { - /** - * @description: 获取合作平台 - * @author: Yxz - * @date: 2024/1/19 18:16 - * @param: [] - * @return: java.util.List - **/ - List getCooperationPlatform(); - - /** - * @description: 获取公司介绍 - * @author: Yxz - * @date: 2024/1/19 18:16 - * @param: [] - * @return: com.cpop.jambox.business.vo.CompanyIntroVo - **/ - CompanyIntroVo getCompanyIntro(); - - /** - * 获取公司业务介绍 - * - * @author: Yxz - * @date: 2024/1/21 11:23 - * @param: [] - * @return: com.cpop.jambox.business.entity.website.BusinessIntro - **/ - BusinessIntro getBusinessIntro() ; - - /** - * 获取发展历程 - * - * @author: Yxz - * @date: 2024/1/21 11:57 - * @param: [] - * @return: java.lang.Object - **/ - R getDevelopmentCourse(); - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandExtendServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandExtendServiceImpl.java deleted file mode 100644 index 3a75481..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BrandExtendServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.mapper.BrandExtendMapper; -import com.cpop.jambox.business.service.BrandExtendService; -import org.springframework.stereotype.Service; - -/** - * 果酱品牌拓展表 服务层实现。 - * - * @author DB - * @since 2023-10-25 - */ -@Service("brandExtendService") -public class BrandExtendServiceImpl extends ServiceImpl implements BrandExtendService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessDataServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessDataServiceImpl.java deleted file mode 100644 index b0bb535..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessDataServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.BusinessData; -import com.cpop.jambox.business.mapper.BusinessDataMapper; -import com.cpop.jambox.business.service.BusinessDataService; -import org.springframework.stereotype.Service; - -/** - * 果酱模块化官网 业务数据表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("businessDataService") -public class BusinessDataServiceImpl extends ServiceImpl implements BusinessDataService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessIntroServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessIntroServiceImpl.java deleted file mode 100644 index f297c99..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/BusinessIntroServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.BusinessIntro; -import com.cpop.jambox.business.mapper.BusinessIntroMapper; -import com.cpop.jambox.business.service.BusinessIntroService; -import org.springframework.stereotype.Service; - -/** - * 果酱模块化官网 业务介绍表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("businessIntroService") -public class BusinessIntroServiceImpl extends ServiceImpl implements BusinessIntroService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateExtendServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateExtendServiceImpl.java deleted file mode 100644 index 611cded..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateExtendServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.CardTemplateExtend; -import com.cpop.jambox.business.mapper.CardTemplateExtendMapper; -import com.cpop.jambox.business.service.CardTemplateExtendService; -import org.springframework.stereotype.Service; - -/** - * 果酱模板拓展表 服务层实现。 - * - * @author DB - * @since 2024-01-17 - */ -@Service("cardTemplateExtendService") -public class CardTemplateExtendServiceImpl extends ServiceImpl implements CardTemplateExtendService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java deleted file mode 100644 index c34f22d..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java +++ /dev/null @@ -1,359 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import cn.binarywang.wx.miniapp.api.WxMaQrcodeService; -import cn.binarywang.wx.miniapp.api.WxMaService; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.file.FileUtils; -import com.cpop.jambox.business.bo.CardTemplateUnionBo; -import com.cpop.jambox.business.bo.EasyLearnDigitalCurrencyBo; -import com.cpop.jambox.business.bo.EasyLearnOldContractBo; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.entity.CardTemplate; -import com.cpop.jambox.business.entity.CardTemplateExtend; -import com.cpop.jambox.business.entity.StoreExtend; -import com.cpop.jambox.business.mapper.CardTemplateMapper; -import com.cpop.jambox.business.service.BrandExtendService; -import com.cpop.jambox.business.service.CardTemplateExtendService; -import com.cpop.jambox.business.service.CardTemplateService; -import com.cpop.jambox.business.service.StoreExtendService; -import com.cpop.jambox.business.vo.CardTemplateInfoVo; -import com.cpop.jambox.business.vo.LearnNowPayLaterPlanDetailVo; -import com.cpop.jambox.business.vo.LearnNowPayLaterPlanVo; -import com.cpop.jambox.framework.tasks.LearnNowPayLaterTask; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.entity.WxPayScore; -import com.cpop.system.business.entity.WxPayScoreDetail; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.service.WxPayScoreDetailService; -import com.cpop.system.business.service.WxPayScoreService; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.qcloud.cos.model.UploadResult; -import me.chanjar.weixin.common.error.WxErrorException; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.jambox.business.entity.table.CardTemplateExtendTableDef.CARD_TEMPLATE_EXTEND; -import static com.cpop.jambox.business.entity.table.CardTemplateTableDef.CARD_TEMPLATE; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -import static com.cpop.system.business.entity.table.WxPayScoreDetailTableDef.WX_PAY_SCORE_DETAIL; -import static com.cpop.system.business.entity.table.WxPayScoreTableDef.WX_PAY_SCORE; - -/** - * 果酱-课卡模板 服务层实现。 - * - * @author DB - * @since 2023-09-27 - */ -@Service("cardTemplateService") -public class CardTemplateServiceImpl extends ServiceImpl implements CardTemplateService { - - /** - * @descriptions 获取模板信息 - * @author DB - * @date 2023/11/13 12:00 - * @param oldTemplateId 旧模板id - * @param brandId 品牌id - * @return: com.cpop.jambox.business.entity.CardTemplate - */ - @Override - public Row getOldTemplateInfo(String oldTemplateId, String brandId) { - try { - DataSourceKey.use("jambox"); - return Db.selectOneByQuery("t_card_template", QueryWrapper.create() - .select("template_id AS oldTemplateId", "store_id AS cloudStoreId", "open_status AS status", "name", "day AS validDay", - "start AS startDate", "end AS endDate", "price", "number AS classNumber", "week_appointment", "day_appointment", - "time_limit AS oldTemplateType", "type AS scopeUse", "pay_type", "template_qr_code AS qrCode", "is_member") - .from("t_card_template") - .where("template_id = ?", oldTemplateId)); - } finally { - DataSourceKey.clear(); - } - - } - - /** - * 添加课卡模板(整合) - * @author DB - * @since 2024/1/16 - * @param bo 请求参数 - * @return String 旧模板id - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCardTemplateUnion(CardTemplateUnionBo bo) { - CardTemplate cardTemplate = BeanUtils.mapToClass(bo, CardTemplate.class); - //品牌 - if (StringUtils.isNotBlank(bo.getBrandCloudId())){ - BrandExtendService brandExtendService = SpringUtils.getBean(BrandExtendService.class); - BrandExtend brandExtend = brandExtendService.getOne(QueryWrapper.create().where(BRAND_EXTEND.BRAND_CLOUD_ID.eq(bo.getBrandCloudId()))); - cardTemplate.setBrandId(brandExtend.getBrandId()); - } else { - //校区 - StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).getOne(QueryWrapper.create().where(STORE_EXTEND.STORE_CLOUD_ID.eq(bo.getStoreCloudId()))); - Store store = SpringUtils.getBean(StoreService.class).getById(storeExtend.getStoreId()); - cardTemplate.setStoreId(store.getId()).setBrandId(store.getBrandId()); - } - this.save(cardTemplate); - saveTemplateExtend(cardTemplate,bo); - //次付 - if (bo.getPayType().contains(1)) { - SpringUtils.getBean(LearnNowPayLaterTask.class).asyncCreateLearnNowPayLaterPlan(cardTemplate, bo.getLearnNowPayLaterPay(), 1); - } - //月付 - if (bo.getPayType().contains(5)) { - SpringUtils.getBean(LearnNowPayLaterTask.class).asyncCreateLearnNowPayLaterPlan(cardTemplate, bo.getLearnNowPayLaterMonthPay(), 5); - } - if (bo.getPayType().contains(0) || bo.getPayType().contains(1) || bo.getPayType().contains(2) || bo.getPayType().contains(3) || bo.getPayType().contains(5)) { - WxMaQrcodeService qrcodeService = SpringUtils.getBean(WxMaService.class).getQrcodeService(); - try { - // 获取当前执行环境 - String active = SpringUtils.getActiveProfile(); - File qrCode = qrcodeService.createWxaCodeUnlimit(cardTemplate.getId(), "pages/pay/pay", false, StringUtils.equals(active, "prod") ? "release" : "trial", 430, - true, null, false); - MultipartFile multipartFile = FileUtils.getInstance().getMultipartFile(qrCode); - TencentCosHandler tencentCosHandler = SpringUtils.getBean(TencentCosHandler.class); - UploadResult uploadResult = tencentCosHandler.cdnUpload(multipartFile); - cardTemplate.setQrCode("https://" + uploadResult.getBucketName() + tencentCosHandler.getCdnUrl() + uploadResult.getKey()); - this.updateById(cardTemplate); - } catch (WxErrorException | IOException e) { - throw new ServiceException("生成支付码失败"); - } - } - } - - /** - * 插入模板拓展 - * @author DB - * @since 2024/1/19 - * @param cardTemplate 模板 - * @param bo 请求 - */ - private void saveTemplateExtend(CardTemplate cardTemplate, CardTemplateUnionBo bo) { - List cardTemplateExtends = new ArrayList<>(); - List payTypeList = bo.getPayType(); - //普通微信支付 - if (payTypeList.contains(0)){ - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(0); - cardTemplateExtends.add(cardTemplateExtend); - } - //放心学合约支付 - if (payTypeList.contains(2)){ - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - EasyLearnOldContractBo easyLearnOldContract = bo.getEasyLearnOldContract(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(2) - .setExtendParamOne(easyLearnOldContract.getStageNum().toString()) - .setExtendParamTwo(easyLearnOldContract.getDeposit().toString()) - .setExtendParamThree(easyLearnOldContract.getFirstBufferDay().toString()); - cardTemplateExtends.add(cardTemplateExtend); - } - //数字人民币支付 - if (payTypeList.contains(3)){ - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - EasyLearnDigitalCurrencyBo easyLearnDigitalCurrency = bo.getEasyLearnDigitalCurrency(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(3) - .setExtendParamOne(easyLearnDigitalCurrency.getIsActivity().toString()) - .setExtendParamTwo(easyLearnDigitalCurrency.getActivityCode()) - .setExtendParamThree(easyLearnDigitalCurrency.getActivityDesc()); - cardTemplateExtends.add(cardTemplateExtend); - } - //线下支付 - if (payTypeList.contains(4)){ - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(4); - cardTemplateExtends.add(cardTemplateExtend); - } - SpringUtils.getBean(CardTemplateExtendService.class).saveBatch(cardTemplateExtends); - } - - /** - * 修改课卡模板(整合) - * @author DB - * @since 2024/1/18 - * @param bo 请求参数 - */ - @Override - public void updateCardTemplateUnion(CardTemplateUnionBo bo) { - CardTemplate cardTemplate = BeanUtils.mapToClass(bo, CardTemplate.class); - this.update(cardTemplate, QueryWrapper.create().where(CARD_TEMPLATE.OLD_TEMPLATE_ID.eq(bo.getOldTemplateId()))); - CardTemplateExtendService cardTemplateExtendService = SpringUtils.getBean(CardTemplateExtendService.class); - List cardTemplateExtends = cardTemplateExtendService.list(QueryWrapper.create() - .where(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(bo.getOldTemplateId()))); - updateTemplateExtend(cardTemplate, bo, cardTemplateExtends); - //次付 - List payTypeList = cardTemplateExtends.stream().map(CardTemplateExtend::getPayType).collect(Collectors.toList()); - if (bo.getPayType().contains(1) && !payTypeList.contains(1)) { - SpringUtils.getBean(LearnNowPayLaterTask.class).asyncCreateLearnNowPayLaterPlan(cardTemplate, bo.getLearnNowPayLaterPay(), 1); - } - if (!bo.getPayType().contains(1) && payTypeList.contains(1)){ - //停用先学后付 - SpringUtils.getBean(CardTemplateExtendService.class).updateChain() - .set(CARD_TEMPLATE_EXTEND.EXTEND_PARAM_ONE, false) - .where(CARD_TEMPLATE_EXTEND.PAY_TYPE.eq(1)) - .and(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(cardTemplate.getId())) - .update(); - } - //月付 - if (bo.getPayType().contains(5) && !payTypeList.contains(5)) { - SpringUtils.getBean(LearnNowPayLaterTask.class).asyncCreateLearnNowPayLaterPlan(cardTemplate, bo.getLearnNowPayLaterMonthPay(), 5); - } - if (!bo.getPayType().contains(1) && payTypeList.contains(1)){ - //停用先学后付 - SpringUtils.getBean(CardTemplateExtendService.class).updateChain() - .set(CARD_TEMPLATE_EXTEND.EXTEND_PARAM_ONE, false) - .where(CARD_TEMPLATE_EXTEND.PAY_TYPE.eq(5)) - .and(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(cardTemplate.getId())) - .update(); - } - } - - /** - * 更新模板拓展 - * @author DB - * @since 2024/1/19 - * @param cardTemplate 模板 - * @param bo 请求 - */ - private void updateTemplateExtend(CardTemplate cardTemplate, CardTemplateUnionBo bo, List cardTemplateExtends) { - List payTypeList = bo.getPayType(); - Map existExtends = cardTemplateExtends.stream().collect(Collectors.toMap(CardTemplateExtend::getPayType, item -> item)); - List removePayTypes = new ArrayList<>(); - //普通微信支付 - if (payTypeList.contains(0)) { - if (existExtends.get(0) == null) { - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(0); - cardTemplateExtends.add(cardTemplateExtend); - } - } else { - removePayTypes.add(0); - } - //放心学旧合约支付 - if (payTypeList.contains(2)) { - CardTemplateExtend cardTemplateExtend; - EasyLearnOldContractBo easyLearnOldContract = bo.getEasyLearnOldContract(); - if (existExtends.get(2) == null) { - cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(2) - .setExtendParamOne(easyLearnOldContract.getStageNum().toString()) - .setExtendParamTwo(easyLearnOldContract.getDeposit().toString()) - .setExtendParamThree(easyLearnOldContract.getFirstBufferDay().toString()); - } else { - cardTemplateExtend = existExtends.get(2); - cardTemplateExtend.setExtendParamOne(easyLearnOldContract.getStageNum().toString()) - .setExtendParamTwo(easyLearnOldContract.getDeposit().toString()) - .setExtendParamThree(easyLearnOldContract.getFirstBufferDay().toString()); - } - cardTemplateExtends.add(cardTemplateExtend); - } else { - removePayTypes.add(2); - } - //数字人民币支付 - if (payTypeList.contains(3)){ - CardTemplateExtend cardTemplateExtend; - EasyLearnDigitalCurrencyBo easyLearnDigitalCurrency = bo.getEasyLearnDigitalCurrency(); - if (existExtends.get(3) == null) { - cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(3) - .setExtendParamOne(easyLearnDigitalCurrency.getIsActivity().toString()) - .setExtendParamTwo(easyLearnDigitalCurrency.getActivityCode()) - .setExtendParamThree(easyLearnDigitalCurrency.getActivityDesc()); - } else { - cardTemplateExtend = existExtends.get(3); - cardTemplateExtend.setExtendParamOne(easyLearnDigitalCurrency.getIsActivity().toString()) - .setExtendParamTwo(easyLearnDigitalCurrency.getActivityCode()) - .setExtendParamThree(easyLearnDigitalCurrency.getActivityDesc()); - } - cardTemplateExtends.add(cardTemplateExtend); - } else { - removePayTypes.add(3); - } - //线下支付 - if (payTypeList.contains(4)) { - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()).setPayType(4); - cardTemplateExtends.add(cardTemplateExtend); - } else { - removePayTypes.add(4); - } - CardTemplateExtendService cardTemplateExtendService = SpringUtils.getBean(CardTemplateExtendService.class); - cardTemplateExtendService.saveBatch(cardTemplateExtends); - cardTemplateExtendService.updateChain() - .where(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(cardTemplate.getId())) - .and(CARD_TEMPLATE_EXTEND.PAY_TYPE.in(removePayTypes)) - .remove(); - } - - /** - * 获取支付分计划 - * @author DB - * @since 2024/1/18 - * @param oldTemplateId 旧模板id - * @param isMonth 是否月付 - * @return LearnNowPayLaterPlanDetailVo - */ - @Override - public LearnNowPayLaterPlanVo getWxPayScorePlan(String oldTemplateId,String templateId, Boolean isMonth) { - CardTemplate cardTemplate; - if (StringUtils.isNotBlank(templateId)) { - cardTemplate = this.queryChain().where(CARD_TEMPLATE.OLD_TEMPLATE_ID.eq(oldTemplateId)).one(); - } else { - cardTemplate = this.queryChain().where(CARD_TEMPLATE.ID.eq(templateId)).one(); - } - CardTemplateExtendService cardTemplateExtendService = SpringUtils.getBean(CardTemplateExtendService.class); - CardTemplateExtend cardTemplateExtend = cardTemplateExtendService.getOne(QueryWrapper.create() - .where(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(cardTemplate.getId())) - .and(CARD_TEMPLATE_EXTEND.PAY_TYPE.eq(isMonth ? 5 : 1))); - WxPayScore wxPayScore = SpringUtils.getBean(WxPayScoreService.class).getOne(QueryWrapper.create() - .where(WX_PAY_SCORE.ID.eq(cardTemplateExtend.getExtendId()))); - LearnNowPayLaterPlanVo vo = BeanUtils.mapToClass(wxPayScore, LearnNowPayLaterPlanVo.class); - List wxPayScoreDetails = SpringUtils.getBean(WxPayScoreDetailService.class).list(QueryWrapper.create() - .where(WX_PAY_SCORE_DETAIL.SYS_WX_PAY_SCORE_ID.eq(vo.getId()))); - List detailVos = BeanUtils.mapToList(wxPayScoreDetails, LearnNowPayLaterPlanDetailVo.class); - vo.setPlanDetailList(detailVos); - return vo; - } - - /** - * 获取模板信息 - * @author DB - * @since 2024/1/22 - * @param id 主键 - */ - @Override - public CardTemplateInfoVo getCardTemplateInfo(String id, String oldTemplateId) { - //TODO: 模板详情信息调整 - CardTemplateInfoVo vo; - if (StringUtils.isNotBlank(id)) { - vo = this.getOneAs(QueryWrapper.create().where(CARD_TEMPLATE.ID.eq(id)) - , CardTemplateInfoVo.class); - } else { - vo = this.getOneAs(QueryWrapper.create().where(CARD_TEMPLATE.OLD_TEMPLATE_ID.eq(oldTemplateId)) - , CardTemplateInfoVo.class); - } - //获取模板拓展 - List payTypeList = SpringUtils.getBean(CardTemplateExtendService.class).queryChain() - .where(CARD_TEMPLATE_EXTEND.TEMPLATE_ID.eq(vo.getId())) - .list().stream().map(CardTemplateExtend::getPayType) - .collect(Collectors.toList()); - vo.setPayType(payTypeList); - return vo; - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CompanyIntroServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CompanyIntroServiceImpl.java deleted file mode 100644 index 3194a2f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CompanyIntroServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.CompanyIntro; -import com.cpop.jambox.business.mapper.CompanyIntroMapper; -import com.cpop.jambox.business.service.CompanyIntroService; -import org.springframework.stereotype.Service; - -/** - * 果酱模块化官网 公司简介表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("companyIntroService") -public class CompanyIntroServiceImpl extends ServiceImpl implements CompanyIntroService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationServiceImpl.java deleted file mode 100644 index 1bf0e42..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SqlUtils; -import com.cpop.jambox.business.entity.website.CooperationType; -import com.cpop.jambox.business.service.CooperationTypeService; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.Cooperation; -import com.cpop.jambox.business.mapper.CooperationMapper; -import com.cpop.jambox.business.service.CooperationService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 果酱模块化官网 合作平台表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("cooperationService") -public class CooperationServiceImpl extends ServiceImpl implements CooperationService { - @Autowired - private CooperationTypeService cooperationTypeService; - - /** - * 查询所有果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 14:27 - * @param: [] - * @return: java.util.List - **/ - @Override - public List selectTypeNameList() { - List cooperationList = this.mapper.selectAll(); - // 设置种类名称 - cooperationList.forEach(item -> { - CooperationType cooperationType = cooperationTypeService.getById(item.getTypeId()); - item.setTypeName(cooperationType.getTypeName()); - }); - return cooperationList; - } - - /** - * 分页查询果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 15:39 - * @param: [typeId] - * @return: com.mybatisflex.core.paginate.Page - **/ - @Override - public Page getPage(String typeId) { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page cooperationPage = this.mapper.paginate(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), QueryWrapper.create().eq("type_id", typeId)); - return cooperationPage; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationTypeServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationTypeServiceImpl.java deleted file mode 100644 index 2e904b6..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CooperationTypeServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.jambox.business.vo.CooperationTypeVo; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.CooperationType; -import com.cpop.jambox.business.mapper.CooperationTypeMapper; -import com.cpop.jambox.business.service.CooperationTypeService; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 果酱模块化官网 合作类别表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("cooperationTypeService") -public class CooperationTypeServiceImpl extends ServiceImpl implements CooperationTypeService { - - /** - * 查询所有果酱模块化官网 合作类别表。 - * - * @author: Yxz - * @date: 2024/1/22 19:19 - * @param: [] - * @return: java.util.List - **/ - @Override - public List getList() { - List cooperationTypeVoList = this.list().stream().map(entity -> { - CooperationTypeVo vo = new CooperationTypeVo(); - BeanUtils.copyProperties(entity,vo,"updateTime"); - - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - String updateTime = entity.getUpdateTime().format(formatter); - - vo.setUpdateTime(updateTime); - return vo; - }).collect(Collectors.toList()); - return cooperationTypeVoList; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/DevelopmentServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/DevelopmentServiceImpl.java deleted file mode 100644 index 656f32f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/DevelopmentServiceImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SqlUtils; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.Development; -import com.cpop.jambox.business.mapper.DevelopmentMapper; -import com.cpop.jambox.business.service.DevelopmentService; -import org.springframework.stereotype.Service; - -import java.time.LocalDate; - -/** - * 果酱模块化官网 发展历程表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("developmentService") -public class DevelopmentServiceImpl extends ServiceImpl implements DevelopmentService { - - - /** - * 分页查询果酱模块化官网 合作平台表 - * - * @author: Yxz - * @date: 2024/1/21 15:59 - * @param: [title, link, publishTime] - * @return: com.mybatisflex.core.paginate.Page - **/ - @Override - public Page selectPage(String title, LocalDate startTime,LocalDate endTime) { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page cooperationPage = this.mapper.paginate(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), - QueryWrapper.create().like("title", title) - .between("publish_time",startTime,endTime)); - return cooperationPage; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderDetailServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderDetailServiceImpl.java deleted file mode 100644 index f996626..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderDetailServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.EasyLearnOrderDetail; -import com.cpop.jambox.business.mapper.EasyLearnOrderDetailMapper; -import com.cpop.jambox.business.service.EasyLearnOrderDetailService; -import org.springframework.stereotype.Service; - -/** - * 果酱-放心学订单详情表 服务层实现。 - * - * @author DB - * @since 2023-12-14 - */ -@Service("easyLearnOrderDetailService") -public class EasyLearnOrderDetailServiceImpl extends ServiceImpl implements EasyLearnOrderDetailService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderExtendServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderExtendServiceImpl.java deleted file mode 100644 index 219b80d..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderExtendServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.EasyLearnOrderExtend; -import com.cpop.jambox.business.mapper.EasyLearnOrderExtendMapper; -import com.cpop.jambox.business.service.EasyLearnOrderExtendService; -import org.springframework.stereotype.Service; - -/** - * 果酱-放心学-订单拓展 服务层实现。 - * - * @author DB - * @since 2023-12-14 - */ -@Service("easyLearnOrderExtendService") -public class EasyLearnOrderExtendServiceImpl extends ServiceImpl implements EasyLearnOrderExtendService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java deleted file mode 100644 index d89ecef..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/EasyLearnOrderServiceImpl.java +++ /dev/null @@ -1,1123 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.cpop.api.cloudDb.core.dto.CloudClassCardDto; -import com.cpop.api.cloudDb.handler.CloudClassCardHandler; -import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.common.utils.http.HttpUtils; -import com.cpop.common.utils.ip.IpUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.SqlUtils; -import com.cpop.jambox.business.bo.*; -import com.cpop.jambox.business.dto.EasyLearnPageDto; -import com.cpop.jambox.business.entity.*; -import com.cpop.jambox.business.mapper.EasyLearnOrderMapper; -import com.cpop.jambox.business.service.*; -import com.cpop.jambox.business.vo.EasyLearnPageVo; -import com.cpop.jambox.framework.constant.JamboxCloudUrl; -import com.cpop.jambox.framework.constant.JamboxRedisConstant; -import com.cpop.jambox.framework.enums.EasyLearnPayPayEnum; -import com.cpop.pay.framewok.config.wxPay.WxPayConfiguration; -import com.cpop.pay.framewok.core.request.ecpp.EcppSmsCodeRequest; -import com.cpop.pay.framewok.core.response.ecpp.EcppSmsCodeResponse; -import com.cpop.pay.framewok.handler.ecpp.EcppHandler; -import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.cpop.pay.framewok.handler.wxPay.WxPayNormalHandler; -import com.cpop.pay.framewok.handler.wxPay.WxUtils; -import com.cpop.pay.framewok.task.WxPayAsyncTask; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.entity.WxPayScore; -import com.cpop.system.business.entity.WxPayScoreDetail; -import com.cpop.system.business.service.StoreService; -import com.cpop.system.business.service.WxPayScoreDetailService; -import com.cpop.system.business.service.WxPayScoreService; -import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; -import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; -import com.github.binarywang.wxpay.bean.payscore.*; -import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; -import com.github.binarywang.wxpay.config.WxPayConfig; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.PartnerPayScoreSignPlanService; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.core.FlexGlobalConfig; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.datasource.FlexDataSource; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowUtil; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.zaxxer.hikari.HikariDataSource; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Response; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.client.RestTemplate; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.locks.Lock; - -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.jambox.business.entity.table.EasyLearnOrderDetailTableDef.EASY_LEARN_ORDER_DETAIL; -import static com.cpop.jambox.business.entity.table.EasyLearnOrderExtendTableDef.EASY_LEARN_ORDER_EXTEND; -import static com.cpop.jambox.business.entity.table.EasyLearnOrderTableDef.EASY_LEARN_ORDER; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.cpop.system.business.entity.table.WxPayScoreDetailTableDef.WX_PAY_SCORE_DETAIL; -import static com.cpop.system.business.entity.table.WxPayScoreTableDef.WX_PAY_SCORE; - -/** - * 果酱-放心学订单表 服务层实现。 - * - * @author DB - * @since 2023-12-14 - */ -@Service("easyLearnOrderService") -@Slf4j -public class EasyLearnOrderServiceImpl extends ServiceImpl implements EasyLearnOrderService { - - @Autowired - private WxPayHandler wxPayHandler; - - @Autowired - private WxPayAsyncTask wxPayAsyncTask; - - @Autowired - private WxPayConfiguration wxPayConfiguration; - - /** - * 一次性支付回调地址(本地内网穿透) - */ - private final String ONCE_PAY_DEV_NOTIFY_URL = "https://frp-bid.top:60778/Cpop-Oam/callback/easyLearn/notify/oncePay"; - - /** - * 一次性支付回调地址(测试地址) - */ - private final String ONCE_PAY_TEST_NOTIFY_URL = "https://test.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/oncePay"; - - /** - * 获取放心学分页 - * - * @param bo 查询参数 - * @return Page - * @author DB - * @since 2023/12/15 - */ - @Override - public Page getEasyLearnPage(EasyLearnPageBo bo) { - //TODO: 后续数据录入后,应该查询新版中的数据 - return getOldEasyLearnPage(bo); - } - - /** - * 导出放心学数据 - * - * @param bo 请求参数 - * @return List - * @author DB - * @since 2023/12/15 - */ - @Override - public List getEasyLearnXml(EasyLearnPageBo bo) { - //TODO: 后续数据录入后,应该查询新版中的数据 - return getOldEasyLearnXml(bo); - } - - /** - * 获取旧数据 - * - * @param bo 请求参数 - * @return List - * @author DB - * @since 2023/12/15 - */ - private List getOldEasyLearnXml(EasyLearnPageBo bo) { - //TODO: 暂时不处理顾问 - try { - getJamboxProdDataSource(); - switch (bo.getOrderType()) { - // 先学后付 - case 0: - try { - DataSourceKey.use("jamboxProd"); - return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(false, bo)), EasyLearnPageDto.class); - } finally { - DataSourceKey.clear(); - } - case 1: - try { - DataSourceKey.use("jamboxProd"); - return RowUtil.toEntityList(Db.selectListByQuery(getLearnNowPayLaterData(true, bo)), EasyLearnPageDto.class); - } finally { - DataSourceKey.clear(); - } - case 2: - return new ArrayList(); - // 数币分页 - case 3: - try { - DataSourceKey.use("jamboxProd"); - return RowUtil.toEntityList(Db.selectListByQuery(getEcppData(bo)), EasyLearnPageDto.class); - } finally { - DataSourceKey.clear(); - } - case 4: - try { - //使用旧库 - DataSourceKey.use("jamboxProd"); - return RowUtil.toEntityList(Db.selectListByQuery(getMemberData(bo)), EasyLearnPageDto.class); - } finally { - DataSourceKey.clear(); - } - default: - return null; - } - } finally { - removeJamboxProdDataSource(); - } - } - - /** - * 获取旧数据分页 - * - * @param bo 请求参数 - * @return Page - * @author DB - * @since 2023/12/15 - */ - private Page getOldEasyLearnPage(EasyLearnPageBo bo) { - //TODO: 暂时不处理顾问 - try { - getJamboxProdDataSource(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page page = Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()); - page.setOptimizeCountQuery(false); - switch (bo.getOrderType()) { - // 先学后付 - case 0: - try { - DataSourceKey.use("jamboxProd"); - return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(false, bo)).map(item -> item.toEntity(EasyLearnPageVo.class)); - } finally { - DataSourceKey.clear(); - } - case 1: - try { - DataSourceKey.use("jamboxProd"); - return Db.paginate("j_commodity_ticket", page, getLearnNowPayLaterData(true, bo)).map(item -> item.toEntity(EasyLearnPageVo.class)); - } finally { - DataSourceKey.clear(); - } - case 2: - return Page.of(1, 10, 0); - // 数币分页 - case 3: - try { - DataSourceKey.use("jamboxProd"); - return Db.paginate("j_commodity_ticket", page, getEcppData(bo)).map(item -> item.toEntity(EasyLearnPageVo.class)); - } finally { - DataSourceKey.clear(); - } - case 4: - try { - //使用旧库 - DataSourceKey.use("jamboxProd"); - return Db.paginate("j_commodity_ticket", page, getMemberData(bo)).map(item -> item.toEntity(EasyLearnPageVo.class)); - } finally { - DataSourceKey.clear(); - } - default: - return null; - } - } finally { - removeJamboxProdDataSource(); - } - } - - private QueryWrapper getMemberData(EasyLearnPageBo bo) { - QueryWrapper queryWrapper = QueryWrapper.create(); - queryWrapper - //查询品牌校区 - .select("tbi.name as brandName") - .select("jmt.ticket_id as id", "jmt.wx_order_id as outOrderNo", "jmt.name as customerName", "jmt.price as totalAmount", "jmt.price as totalPayAmount", "jmt.phone as customerPhone", "jmt.creation_time as createTime") - .from("j_membership_ticket").as("jmt") - //品牌 - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jmt.brand_id") - .where("jmt.deleted = 1") - .and("jmt.pay_status = 'PAY'") - .groupBy("jmt.ticket_id") - .orderBy("jmt.creation_time desc"); - //开始时间结束时间 - if (bo.getStartDate() != null && bo.getEndDate() != null) { - queryWrapper.and("jmt.creation_time between ? and ?", bo.getStartDate(), bo.getEndDate()); - } - //品牌校区模糊查询 - if (StringUtils.isNotBlank(bo.getBrandOrStore())) { - queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%"); - } - return queryWrapper; - } - - - /** - * 获取数币数据 - * - * @return Page - * @author DB - * @since 2023/12/15 - */ - private QueryWrapper getEcppData(EasyLearnPageBo bo) { - QueryWrapper queryWrapper = QueryWrapper.create(); - queryWrapper - //查询品牌校区 - .select("tbi.name as brandName", "tmi.mechanism as storeName") - .select("jct.ticket_id as id", "jct.wx_order_id as outOrderNo", "jct.name as customerName", "jct.price as totalAmount", "jct.price as totalPayAmount", "jct.phone as customerPhone", "jct.creation_time as createTime") - .select("tct.name as productName") - .from("j_commodity_ticket").as("jct") - //品牌 - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jct.brand_id") - //校区 - .leftJoin("t_mechanism_info").as("tmi").on("tmi.store_id = jct.store_id") - //模板 - .leftJoin("t_card_template").as("tct").on("tct.template_id = jct.commodity_id") - .where("jct.deleted = 1") - .and("jct.pay_status = 'PAY'") - .and("jct.is_suda = 1") - .groupBy("jct.ticket_id") - .orderBy("jct.creation_time desc"); - //开始时间结束时间 - if (bo.getStartDate() != null && bo.getEndDate() != null) { - queryWrapper.and("jct.creation_time between ? and ?", bo.getStartDate(), bo.getEndDate()); - } - //品牌校区模糊查询 - if (StringUtils.isNotBlank(bo.getBrandOrStore())) { - queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%"); - } - if (StringUtils.isNotBlank(bo.getStaffName())) { - queryWrapper.and("jct.staff_name like ?", "%" + bo.getStaffName() + "%"); - } - return queryWrapper; - } - - /** - * 获取先学后付数据 - * - * @param isMonth 是否是月付 - * @return Page - * @author DB - * @since 2023/12/15 - */ - private QueryWrapper getLearnNowPayLaterData(Boolean isMonth, EasyLearnPageBo bo) { - QueryWrapper queryWrapper = QueryWrapper.create() - //查询品牌校区 - .select("tbi.name as brandName", "tmi.mechanism as storeName") - .select("jct.ticket_id as id", "jct.wx_order_id as outOrderNo", "jct.name as customerName", "jct.price as totalAmount", "jct.price as totalPayAmount", "jct.phone as customerPhone", "jct.creation_time as createTime") - .select("tct.name as productName") - .from("j_commodity_ticket").as("jct") - //品牌 - .leftJoin("t_brand_info").as("tbi").on("tbi.id = jct.brand_id") - //校区 - .leftJoin("t_mechanism_info").as("tmi").on("tmi.store_id = jct.store_id") - //模板 - .leftJoin("t_card_template").as("tct").on("tct.template_id = jct.commodity_id") - //微信支付 - .leftJoin("j_wechat_pay_plan").as("jwpp").on("jwpp.template_id = jct.commodity_id") - .where("jct.deleted = 1") - .and("jct.pay_status = 'PAY'") - .and("jct.ticket_type = 1") - .and("jwpp.is_month = ?", isMonth) - .groupBy("jct.ticket_id") - .orderBy("jct.creation_time desc"); - //开始时间结束时间 - if (bo.getStartDate() != null && bo.getEndDate() != null) { - queryWrapper.and("jct.creation_time between ? and ?", bo.getStartDate(), bo.getEndDate()); - } - //品牌校区模糊查询 - if (StringUtils.isNotBlank(bo.getBrandOrStore())) { - queryWrapper.and("tbi.name like ?", "%" + bo.getBrandOrStore() + "%").or("tmi.mechanism like ?", "%" + bo.getBrandOrStore() + "%"); - } - if (StringUtils.isNotBlank(bo.getStaffName())) { - queryWrapper.and("jct.staff_name like ?", "%" + bo.getStaffName() + "%"); - } - return queryWrapper; - } - - private static final String URL = "jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_association?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"; - /** - * 数据库用户名 - */ - private static final String USERNAME = "root"; - /** - * 数据库密码 - */ - private static final String PASSWORD = "Customer0401"; - - @Deprecated - private void getJamboxProdDataSource() { - FlexDataSource flexDataSource = FlexGlobalConfig.getDefaultConfig().getDataSource(); - //新的数据源 - HikariDataSource dataSource = new HikariDataSource(); - dataSource.setJdbcUrl(URL); - dataSource.setUsername(USERNAME); - dataSource.setPassword(PASSWORD); - flexDataSource.addDataSource("jamboxProd", dataSource); - } - - @Deprecated - private void removeJamboxProdDataSource() { - FlexDataSource flexDataSource = FlexGlobalConfig.getDefaultConfig().getDataSource(); - flexDataSource.removeDatasource("jamboxProd"); - } - - /** - * 放心学一次性订单通知 - * @author DB - * @since 2023/12/21 - * @param xmlData 数据 - */ - @Override - public void oncePayResult(String xmlData) { - try { - WxPayService wxPayService = wxPayHandler.getWxPayService(); - WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); - if (!StringUtils.equals(notifyResult.getResultCode(), "SUCCESS")) { - throw new ServiceException(notifyResult.getReturnMsg()); - } - String orderId = notifyResult.getOutTradeNo(); - //获取订单信息 - EasyLearnOrder easyLearnOrder = this.getById(orderId); - //需要分账 - String subMchId = wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId()); - if (notifyResult.getTotalFee() >= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) { - //设置子商户 - WxPayConfig config = wxPayService.getConfig(); - config.setSubMchId(subMchId); - wxPayAsyncTask.asyncWxPayProfitSharing(orderId, notifyResult, wxPayService, OrderSource.EASY_LEARN); - } - //课卡信息 - JSONObject jsonBody = new JSONObject(); - jsonBody.put("_type", "addPeriod"); - //办卡实收金额 - jsonBody.put("money", easyLearnOrder.getTotalPayAmount()); - //获取云校区id - StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).getOne(QueryWrapper.create().where(STORE_EXTEND.STORE_ID.eq(easyLearnOrder.getStoreId()))); - //店铺/校区 - jsonBody.put("storeId", storeExtend.getStoreCloudId()); - //手机号 - jsonBody.put("phone", easyLearnOrder.getCustomerPhone()); - //客户名称 - jsonBody.put("customerName", easyLearnOrder.getCustomerName()); - //模板id - jsonBody.put("templateId", easyLearnOrder.getOrderCloudId()); - //订单来源 - jsonBody.put("orderSource", OrderSource.EASY_LEARN.toString()); - //订单来源 - jsonBody.put("subMchId", subMchId); - //获取课卡信息 - JSONObject result = SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class); - if (result == null){ - throw new ServiceException("放心学一次性支付办卡失败!"); - } - //更新订单 - this.updateChain().set(EASY_LEARN_ORDER.OUT_ORDER_NO, notifyResult.getTransactionId()) - .set(EASY_LEARN_ORDER.PRODUCT_ID, result.getString("data")) - .set(EASY_LEARN_ORDER.ORDER_STATUS, 1) - .where(EASY_LEARN_ORDER.ID.eq(orderId)).update(); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 一次性支付下单 - * @author DB - * @since 2023/10/23 12:15 - * @param bo 下单请求对象 - */ - @Override - public Object oncePlaceOrder(OncePlaceOrderBo bo) { - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - String openId; - if (StringUtils.isBlank(bo.getOpenId())){ - //获取当前下单用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - openId = loginUserInfo.getString("openId"); - }else { - openId = bo.getOpenId(); - } - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(JamboxRedisConstant.ONCE_PAY_LOCK_USER_PAY + bo.getCustomerPhone()); - if (userIdLock.tryLock()) { - try { - //获取品牌 - BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain().where(BRAND_EXTEND.BRAND_CLOUD_ID.eq(bo.getBrandCloudId())).one(); - //获取校区 - StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_CLOUD_ID.eq(bo.getStoreCloudId())).one(); - EasyLearnOrder easyLearnOrder = this.getOne(QueryWrapper.create().where(EASY_LEARN_ORDER.ORDER_CLOUD_ID.eq(bo.getOrderCloudId()))); - if (easyLearnOrder == null) { - //创建订单 - easyLearnOrder = BeanUtils.mapToClass(bo, EasyLearnOrder.class); - easyLearnOrder.setOrderType(2).setBrandId(brandExtend.getBrandId()).setStoreId(storeExtend.getStoreId()).setOrderContent(bo.getOrderContent()); - //需要分账 - if (bo.getTotalAmount().scaleByPowerOfTen(2).intValue() >= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) { - easyLearnOrder.setRate(OrderSource.EASY_LEARN.getRate()); - } - this.save(easyLearnOrder); - } else { - if (easyLearnOrder.getOrderStatus() == 1){ - throw new ServiceException("当前订单已支付,请勿重复支付"); - } - } - String payNotifyUrl; - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - //一次性支付 - payNotifyUrl = SpringUtils.getBean(WxPayConfiguration.class).getProperties().getEasyLearnOncePayNotifyUrl(); - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())){ - payNotifyUrl = ONCE_PAY_TEST_NOTIFY_URL; - } else { - payNotifyUrl = ONCE_PAY_DEV_NOTIFY_URL; - } - //获取商户信息 - WxPayService wxPayService = wxPayHandler.getWxPayService(null, wxPayHandler.getSubMchId(brandExtend.getBrandId(), storeExtend.getStoreId()), payNotifyUrl); - WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); - if (easyLearnOrder.getRate() != null) { - //需要分账 - orderRequest.setProfitSharing("Y"); - } - orderRequest.setSpbillCreateIp(IpUtils.getHostIp()) - .setOpenid(openId) - //商品描述 - .setBody("一次性支付") - .setOutTradeNo(easyLearnOrder.getId()) - //元转分 - .setTotalFee(easyLearnOrder.getTotalAmount().scaleByPowerOfTen(2).intValue()) - .setTradeType("JSAPI"); - return wxPayService.createOrder(orderRequest); - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } finally { - //释放锁 - userIdLock.unlock(); - } - } else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复支付"); - } - } - - /** - * 联合支付回调地址(本地内网穿透) - */ - private final String UNION_PAY_DEV_NOTIFY_URL = "https://frp-bid.top:60778/Cpop-Oam/callback/easyLearn/notify/unionPay"; - - /** - * 联合支付回调地址(测试地址) - */ - private final String UNION_PAY_TEST_NOTIFY_URL = "https://test.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/unionPay"; - - /** - * 联合支付回调地址(本地内网穿透) - */ - private final String UNION_PAY_DEV_NORMAL_NOTIFY_URL = "https://frp-bid.top:60778/Cpop-Oam/callback/easyLearn/notify/normalUnionPay"; - - /** - * 联合支付回调地址(测试地址) - */ - private final String UNION_PAY_TEST_NORMAL_NOTIFY_URL = "https://test.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/normalUnionPay"; - - /** - * 放心学统一支付 - * @author DB - * @since 2023/12/28 - * @param bo 请求参数 - * @return R - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Object unionPay(EasyLearnUnionPayBo bo) { - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(JamboxRedisConstant.ONCE_PAY_LOCK_USER_PAY + bo.getCustomerPhone()); - if (userIdLock.tryLock()) { - WxPayService wxPayService = null; - try { - //创建订单 - EasyLearnOrder easyLearnOrder = BeanUtils.mapToClass(bo, EasyLearnOrder.class); - //获取校区 - StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain().where(STORE_EXTEND.STORE_CLOUD_ID.eq(bo.getBrandOrStoreCloudId())).one(); - //获取品牌 - BrandExtend brandExtend; - if (storeExtend == null) { - brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain().where(BRAND_EXTEND.BRAND_CLOUD_ID.eq(bo.getBrandOrStoreCloudId())).one(); - easyLearnOrder.setBrandId(brandExtend.getBrandId()); - } else { - //获取品牌 - Store store = SpringUtils.getBean(StoreService.class).getById(storeExtend.getStoreId()); - easyLearnOrder.setBrandId(store.getBrandId()); - easyLearnOrder.setStoreId(storeExtend.getStoreId()); - } - EasyLearnPayPayEnum easyLearnPayPayEnum = EasyLearnPayPayEnum.valueOf(bo.getEasyLearnUnionPay()); - easyLearnOrder.setOrderType(easyLearnPayPayEnum.getOrderType()).setOrderContent(bo.getOrderContent()); - this.save(easyLearnOrder); - String payNotifyUrl; - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - //联合支付 - payNotifyUrl = SpringUtils.getBean(WxPayConfiguration.class).getProperties().getEasyLearnUnionPayNotifyUrl(); - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())){ - payNotifyUrl = UNION_PAY_TEST_NOTIFY_URL; - } else { - payNotifyUrl = UNION_PAY_DEV_NOTIFY_URL; - } - //获取商户信息 - wxPayService = wxPayHandler.getWxPayService(null, wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId()), payNotifyUrl); - if (StringUtils.isBlank(wxPayService.getConfig().getSubMchId())){ - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - //联合支付 - payNotifyUrl = SpringUtils.getBean(WxPayConfiguration.class).getProperties().getEasyLearnUnionPayNormalNotifyUrl(); - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())){ - payNotifyUrl = UNION_PAY_TEST_NORMAL_NOTIFY_URL; - } else { - payNotifyUrl = UNION_PAY_DEV_NORMAL_NOTIFY_URL; - } - return SpringUtils.getBean(WxPayNormalHandler.class).createOrder(easyLearnOrder.getId(),bo.getOpenId(), easyLearnOrder.getTotalPayAmount(), "联合支付", IpUtils.getHostIp(), payNotifyUrl); - } else { - WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); - //需要分账 - if (easyLearnOrder.getRate() != null && easyLearnOrder.getTotalAmount().scaleByPowerOfTen(2).intValue() >= Math.ceil(1 / easyLearnOrder.getRate())) { - //需要分账 - orderRequest.setProfitSharing("Y"); - } - orderRequest.setSpbillCreateIp(IpUtils.getHostIp()) - .setOpenid(bo.getOpenId()) - //商品描述 - .setBody("联合支付") - .setOutTradeNo(easyLearnOrder.getId()) - //元转分 - .setTotalFee(easyLearnOrder.getTotalAmount().scaleByPowerOfTen(2).intValue()) - .setTradeType("JSAPI"); - return wxPayService.createOrder(orderRequest); - } - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } finally { - //释放锁 - userIdLock.unlock(); - } - } else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复支付"); - } - } - - /** - * 果酱通知地址(本地) - */ - private final String UNION_PAY_DEV_JAMBOX_NOTIFY_URL = "http://localhost:8078/test/ass/jambox/contract/unionPayNotify"; - - /** - * 果酱通知地址(测试地址) - */ - private final String UNION_PAY_TEST_JAMBOX_NOTIFY_URL = "https://test.cpopsz.com/test/ass/jambox/contract/unionPayNotify"; - - /** - * 果酱通知地址(线上) - */ - private final String UNION_PAY_PROD_JAMBOX_NOTIFY_URL = "https://api.jamboxsys.com/jambox/ass/jambox/contract/unionPayNotify"; - - /** - * 微信支付联合支付订单通知 - * @param xmlData 数据 - */ - @Override - public void unionPayResult(String xmlData) { - try { - WxPayService wxPayService = wxPayHandler.getWxPayService(); - WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); - if (!StringUtils.equals(notifyResult.getResultCode(), "SUCCESS")) { - throw new ServiceException(notifyResult.getReturnMsg()); - } - String orderId = notifyResult.getOutTradeNo(); - //获取订单信息 - EasyLearnOrder easyLearnOrder = this.getById(orderId); - if (easyLearnOrder.getRate() != null && easyLearnOrder.getTotalAmount().scaleByPowerOfTen(2).intValue() >= Math.ceil(1 / easyLearnOrder.getRate())) { - //设置子商户 - WxPayConfig config = wxPayService.getConfig(); - //需要分账 - String subMchId = wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId()); - config.setSubMchId(subMchId); - wxPayAsyncTask.asyncWxPayProfitSharing(orderId, notifyResult, wxPayService, OrderSource.EASY_LEARN, easyLearnOrder.getRate()); - } - JSONObject jsonObject = new JSONObject(); - EasyLearnPayPayEnum easyLearnPayPayEnum = EasyLearnPayPayEnum.getEasyLearnPayPayEnum(easyLearnOrder.getOrderType()); - jsonObject.put("wxOrderId", easyLearnOrder.getId()); - jsonObject.put("unionPayOutOrderId", easyLearnOrder.getUnionPayOutOrderId()); - jsonObject.put("easyLearnUnionPay", easyLearnPayPayEnum.toString()); - String url; - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - url = UNION_PAY_PROD_JAMBOX_NOTIFY_URL; - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())) { - url = UNION_PAY_TEST_JAMBOX_NOTIFY_URL; - } else { - url = UNION_PAY_DEV_JAMBOX_NOTIFY_URL; - } - //通知晖哥 - Response response = HttpUtils.sendOkHttpPost(url, jsonObject.toJSONString()); - response.close(); - //更新订单 - this.updateChain().set(EASY_LEARN_ORDER.OUT_ORDER_NO, notifyResult.getTransactionId()) - .set(EASY_LEARN_ORDER.ORDER_STATUS, 1) - .where(EASY_LEARN_ORDER.ID.eq(orderId)).update(); - } catch (WxPayException | IOException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 放心学统一支付 - * @author DB - * @since 2024/1/9 - * @param bo 请求参数 - * @return Object - */ - @Override - public Object unifiedPay(EasyLearnUnifiedPayBo bo) { - return null; - } - - /** - * 创建用户签约计划 - * @author DB - * @since 2024/1/19 - * @param bo 请求参数 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public WxPartnerPayScoreUserSignPlanResult createUserSignPlans(LearnNowPayLaterUserSignPlansBo bo) { - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(JamboxRedisConstant.LEARN_NOW_PAY_LATER_CREATE_USER_PLANS_LOCK_USER_PAY + bo.getId()); - if (userIdLock.tryLock()) { - try { - // 获取计划 - WxPayScore wxPayScore = SpringUtils.getBean(WxPayScoreService.class).getById(bo.getId()); - //获取计划详情 - List wxPayScoreDetails = SpringUtils.getBean(WxPayScoreDetailService.class).queryChain() - .where(WX_PAY_SCORE_DETAIL.SYS_WX_PAY_SCORE_ID.eq(bo.getId())) - .list(); - Row brandAndStore = Db.selectOneByQuery(QueryWrapper.create() - .select(STORE.ID, STORE.BRAND_ID) - .leftJoin(STORE_EXTEND).on(STORE_EXTEND.STORE_ID.eq(STORE.ID)) - .where(STORE_EXTEND.STORE_CLOUD_ID.eq(bo.getStoreCloudId()))); - //创建用户签约计划 - String orderId = createEasyLearnUserSignPlans(bo, brandAndStore, wxPayScore); - String subMchId = wxPayHandler.getSubMchId(brandAndStore.getString("brandId"), brandAndStore.getString("id")); - WxPayService wxPayService = wxPayHandler.getWxPayService(null, subMchId); - PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = wxPayService.getPartnerPayScoreSignPlanService(); - List payScorePlanDetailRequests = BeanUtils.mapToList(wxPayScoreDetails, PayScorePlanDetailRequest.class); - WxPartnerPayScoreSignPlanRequest signPlanRequest = new WxPartnerPayScoreSignPlanRequest(); - signPlanRequest.setPlanId(wxPayScore.getOutPlanId()).setSubAppid(subMchId) - .setSubOpenid(bo.getSubOpenId()) - .setMerchantSignPlanNo(orderId) - .setPlanDetailList(payScorePlanDetailRequests) - .setNotifyUrl(wxPayConfiguration.getProperties().getLearnNowPayLaterUserSignPlanNotifyUrl()); - try { - return partnerPayScoreSignPlanService.createUserSignPlans(signPlanRequest); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } finally { - //释放锁 - userIdLock.unlock(); - } - } else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复提交"); - } - - } - - /** - * 创建用户支付计划 - * @author DB - * @since 2024/1/19 - * @param wxPayScore 支付分 - * @return String - */ - private String createEasyLearnUserSignPlans(LearnNowPayLaterUserSignPlansBo bo, Row brandAndStore, WxPayScore wxPayScore) { - EasyLearnOrder easyLearnOrder = new EasyLearnOrder(); - easyLearnOrder.setBrandId(brandAndStore.getString("brandId")) - .setStoreId(brandAndStore.getString("id")) - .setOrderContent(bo.getPlanName()) - .setOrderStatus(0) - .setCustomerName(bo.getCustomerName()) - .setCustomerPhone(bo.getCustomerPhone()) - .setTotalAmount(new BigDecimal(wxPayScore.getTotalOriginalPrice()).divide(BigDecimal.valueOf(100))) - .setTotalPayAmount(BigDecimal.ZERO) - .setOrderType(0) - .setRate(OrderSource.LEARN_NOW_PAY_LATER.getRate()) - .setTemplateId(bo.getTemplateId() == null ? bo.getOldTemplateId() : bo.getTemplateId()) - .setCounselor(bo.getCounselor()); - this.save(easyLearnOrder); - return easyLearnOrder.getId(); - } - - private final String LOCAL_TEMPLATE_URL = "http://localhost:9420/Cpop-Oam/"; - - private final String TEST_TEMPLATE_URL = "https://test.cpopsz.com/oam/Cpop-Oam/"; - - private final String PROD_TEMPLATE_URL = "https://oam.jamboxsys.com/Cpop-Oam/"; - - /** - * 用户签约成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 响应数据 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void learnNowPayLaterUserSignPlanNotify(String notifyData) { - try { - PayScoreNotifyData payScoreNotifyData = JSONObject.parseObject(notifyData, PayScoreNotifyData.class); - PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = wxPayHandler.getWxPayService().getPartnerPayScoreSignPlanService(); - SignatureHeader signatureHeader = wxPayHandler.getSignatureHeader(); - PartnerUserSignPlanEntity result = partnerPayScoreSignPlanService.parseSignPlanNotifyResult(notifyData, signatureHeader); - String orderId = result.getMerchantSignPlanNo(); - EasyLearnOrder easyLearnOrder = this.getById(orderId); - //支付成功 - if (StringUtils.equals("PAYSCORE.USER_SIGN_PLAN", payScoreNotifyData.getEventType())) { - //订单已支付 - if (easyLearnOrder.getOrderStatus() == 1){ - return; - } - easyLearnOrder.setOrderStatus(1).setOutOrderNo(result.getSignPlanId()); - //添加支付分详情 - List easyLearnOrderDetails = new ArrayList<>(); - result.getSignedDetailList().forEach(item->{ - EasyLearnOrderDetail easyLearnOrderDetail = new EasyLearnOrderDetail(); - easyLearnOrderDetail.setOrderId(easyLearnOrder.getId()) - .setPeriodNo(item.getPlanDetailNo()) - .setAmount(new BigDecimal(item.getOriginalPrice()).divide(BigDecimal.valueOf(100))) - .setDetailDesc(item.getPlanDiscountDescription()) - .setActualPrice(new BigDecimal(item.getActualPrice()).divide(BigDecimal.valueOf(100))) - .setDetailStatus(0) - .setOutOrderNo(item.getOrderId()) - .setDetailName(item.getPlanDetailName()); - easyLearnOrderDetails.add(easyLearnOrderDetail); - }); - SpringUtils.getBean(EasyLearnOrderDetailService.class).saveBatch(easyLearnOrderDetails); - //支付分拓展 - EasyLearnOrderExtend orderExtend = new EasyLearnOrderExtend(); - orderExtend.setOrderId(orderId) - .setPlanId(result.getPlanId()) - .setSignPlanId(result.getSignPlanId()) - .setSubMchId(result.getSubMchid()) - .setExtendStatus(0) - .setGoingDetailNo(0); - SpringUtils.getBean(EasyLearnOrderExtendService.class).save(orderExtend); - //云办卡 - CloudClassCardDto dto = new CloudClassCardDto(); - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - dto.setTemplateUrl(PROD_TEMPLATE_URL); - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())){ - dto.setTemplateUrl(TEST_TEMPLATE_URL); - } else { - dto.setTemplateUrl(LOCAL_TEMPLATE_URL); - } - // 办卡 - dto.setOpenId(result.getSubOpenid()); - dto.setMerchantSignPlanNo(result.getMerchantSignPlanNo()); - dto.setSignPlanId(result.getSignPlanId()); - dto.setOrderCloudId(easyLearnOrder.getTemplateId()); - StoreExtend storeExtend = SpringUtils.getBean(StoreExtendService.class).queryChain() - .where(STORE_EXTEND.STORE_ID.eq(easyLearnOrder.getStoreId())) - .one(); - dto.setStoreCloudId(storeExtend.getStoreCloudId()); - dto.setCustomerPhone(easyLearnOrder.getCustomerPhone()); - dto.setCustomerName(easyLearnOrder.getCustomerName()); - dto.setPlanId(result.getPlanId()); - dto.setSignPlanDetails(JSONArray.toJSONString(result.getSignedDetailList())); - //获取计划 - Row payScorePlan = DbChain.table(WX_PAY_SCORE.getTableName()).select(WX_PAY_SCORE.CLASS_HOUR).where(WX_PAY_SCORE.OUT_PLAN_ID.eq(result.getPlanId())).one(); - //获取支付分 - if (payScorePlan != null && StringUtils.isNotBlank(payScorePlan.getString("classHour"))) { - dto.setClassHour(payScorePlan.getString("classHour")); - } - String cloudCardId = SpringUtils.getBean(CloudClassCardHandler.class).insertCloudClassCard(dto); - easyLearnOrder.setProductId(cloudCardId); - this.updateById(easyLearnOrder); - } else if (StringUtils.equals("PAYSCORE.USER_CANCEL_SIGN_PLAN", payScoreNotifyData.getEventType())){ - //取消合约 - easyLearnOrder.setOrderStatus(2); - this.updateById(easyLearnOrder); - //批量修改订单详情状态 - SpringUtils.getBean(EasyLearnOrderDetailService.class).updateChain() - .set(EASY_LEARN_ORDER_DETAIL.DETAIL_STATUS, 3) - .where(EASY_LEARN_ORDER_DETAIL.ORDER_ID.eq(easyLearnOrder.getId())) - .and(EASY_LEARN_ORDER_DETAIL.DETAIL_STATUS.eq(0)) - .update(); - //通知波哥取消课卡 - CloudClassCardDto cloudClassCardDto = new CloudClassCardDto(); - cloudClassCardDto.setSignPlanId(result.getSignPlanId()); - cloudClassCardDto.setMerchantSignPlanNo(result.getMerchantSignPlanNo()); - SpringUtils.getBean(CloudClassCardHandler.class).refundCloudClassCard(cloudClassCardDto); - } - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 创建用户服务订单(核销) - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - * @return WxPartnerPayScoreSignPlanResult - */ - @Override - @Transactional(rollbackFor = Exception.class) - public WxPartnerPayScoreSignPlanResult createServiceOrder(LearnNowPayLaterServiceOrderBo bo) { - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(JamboxRedisConstant.LEARN_NOW_PAY_LATER_SERVICE_ORDER_LOCK_USER_PAY + bo.getSignPlanId()); - if (userIdLock.tryLock()) { - try { - EasyLearnOrder easyLearnOrder = this.queryChain().where(EASY_LEARN_ORDER.OUT_ORDER_NO.eq(bo.getSignPlanId())).one(); - EasyLearnOrderDetailService easyLearnOrderDetailService = SpringUtils.getBean(EasyLearnOrderDetailService.class); - EasyLearnOrderDetail easyLearnOrderDetail = easyLearnOrderDetailService.queryChain() - .where(EASY_LEARN_ORDER_DETAIL.ORDER_ID.eq(easyLearnOrder.getId())) - .and(EASY_LEARN_ORDER_DETAIL.PERIOD_NO.eq(bo.getPlanDetailNo())) - .one(); - //获取计划拓展 - EasyLearnOrderExtend orderExtend = SpringUtils.getBean(EasyLearnOrderExtendService.class).queryChain() - .where(EASY_LEARN_ORDER_EXTEND.ORDER_ID.eq(easyLearnOrder.getId())) - .one(); - WxPayService wxPayService = wxPayHandler.getWxPayService(null, orderExtend.getSubMchId()); - PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = wxPayService.getPartnerPayScoreSignPlanService(); - WxPartnerPayScoreSignPlanRequest signPlanRequest = new WxPartnerPayScoreSignPlanRequest(); - signPlanRequest.setSignPlanId(easyLearnOrder.getOutOrderNo()) - .setPlanDetailNo(easyLearnOrderDetail.getPeriodNo()) - .setSubMchid(orderExtend.getSubMchId()) - .setSubOpenid(bo.getOpenid()) - .setNotifyUrl(wxPayConfiguration.getProperties().getLearnNowPayLaterServiceOrderNotifyUrl()) - .setServiceIntroduction(easyLearnOrderDetail.getDetailDesc()); - TimeRange timeRange = new TimeRange(); - LocalDateTime now = LocalDateTime.now(); - DateTimeFormatter yyyyMMddHHmmss = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); - String startTime = now.plusSeconds(10).format(yyyyMMddHHmmss); - timeRange.setStartTime(startTime); - String endTime = now.plusSeconds(60).format(yyyyMMddHHmmss); - timeRange.setEndTime(endTime); - signPlanRequest.setTimeRange(timeRange).setOutOrderNo(easyLearnOrderDetail.getId()); - easyLearnOrderDetail.setDetailStatus(1); - easyLearnOrderDetailService.updateById(easyLearnOrderDetail); - try { - return partnerPayScoreSignPlanService.signPlanServiceOrder(signPlanRequest); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } finally { - //释放锁 - userIdLock.unlock(); - } - } else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复提交"); - } - } - - /** - * 支付分用户核销成功回调 - * @author DB - * @since 2024/1/20 - * @param notifyData 返回数据 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void userServiceOrderSuccess(String notifyData) { - try { - WxPayOrderNotifyResult notifyResult = wxPayHandler.getWxPayService().parseOrderNotifyResult(notifyData); - EasyLearnOrderDetailService easyLearnOrderDetailService = SpringUtils.getBean(EasyLearnOrderDetailService.class); - EasyLearnOrderDetail easyLearnOrderDetail = easyLearnOrderDetailService.queryChain() - .where(EASY_LEARN_ORDER_DETAIL.ORDER_ID.eq(notifyResult.getOutTradeNo())) - .and(EASY_LEARN_ORDER_DETAIL.OUT_ORDER_NO.eq(notifyResult.getTransactionId())) - .one(); - EasyLearnOrder easyLearnOrder = this.getById(easyLearnOrderDetail.getOrderId()); - //需要分账 - String subMchId = notifyResult.getSubMchId(); - if (notifyResult.getTotalFee() >= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) { - //设置子商户 - WxPayService wxPayService = wxPayHandler.getWxPayService(null, subMchId); - wxPayAsyncTask.asyncWxPayProfitSharing(notifyResult.getOutTradeNo(), notifyResult, wxPayService, OrderSource.LEARN_NOW_PAY_LATER); - } - BigDecimal payAmount = new BigDecimal(notifyResult.getTotalFee()).divide(BigDecimal.valueOf(100)); - easyLearnOrderDetail.setDetailStatus(2) - .setActualPrice(payAmount); - easyLearnOrderDetailService.updateById(easyLearnOrderDetail); - //修改订单实际支付金额 - easyLearnOrder.setTotalPayAmount(easyLearnOrder.getTotalPayAmount() == null ? payAmount : easyLearnOrder.getTotalPayAmount().add(payAmount)); - this.updateById(easyLearnOrder); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 取消用户签约计划 - * @author DB - * @since 2024/1/20 - * @param bo 请求参数 - */ - @Override - public void stopUserSignPlans(LearnNowPayLaterStopUserSignPlansBo bo) { - EasyLearnOrder easyLearnOrder = this.queryChain().where(EASY_LEARN_ORDER.OUT_ORDER_NO.eq(bo.getSignPlanId())).one(); - String subMchId = wxPayHandler.getSubMchId(easyLearnOrder.getBrandId(), easyLearnOrder.getStoreId()); - WxPayService wxPayService = wxPayHandler.getWxPayService(null, subMchId); - try { - wxPayService.getPartnerPayScoreSignPlanService().stopUserSignPlans(easyLearnOrder.getId(), subMchId, bo.getStopReason()); - //取消合约 - easyLearnOrder.setOrderStatus(2); - this.updateById(easyLearnOrder); - //批量修改订单详情状态 - SpringUtils.getBean(EasyLearnOrderDetailService.class).updateChain() - .set(EASY_LEARN_ORDER_DETAIL.DETAIL_STATUS, 3) - .where(EASY_LEARN_ORDER_DETAIL.ORDER_ID.eq(easyLearnOrder.getId())) - .and(EASY_LEARN_ORDER_DETAIL.DETAIL_STATUS.eq(0)) - .update(); - //获取拓展信息 - EasyLearnOrderExtend easyLearnOrderExtend = SpringUtils.getBean(EasyLearnOrderExtendService.class).queryChain() - .where(EASY_LEARN_ORDER_EXTEND.ORDER_ID.eq(easyLearnOrder.getId())) - .one(); - //通知波哥取消课卡 - CloudClassCardDto cloudClassCardDto = new CloudClassCardDto(); - cloudClassCardDto.setSignPlanId(easyLearnOrderExtend.getSignPlanId()); - cloudClassCardDto.setMerchantSignPlanNo(easyLearnOrder.getId()); - SpringUtils.getBean(CloudClassCardHandler.class).refundCloudClassCard(cloudClassCardDto); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 发送数币手机验证码 - * @author DB - * @since 2024/1/29 - * @param phone 验证码 - */ - @Override - public void sendEcppMsmCode(String phone) { - EcppSmsCodeRequest request = new EcppSmsCodeRequest(); - request.setSmsTpCd("YGJ_SIGN"); - EcppSmsCodeResponse response = SpringUtils.getBean(EcppHandler.class).sendEcppMsmCode(request); - - - } - - /** - * 微信支付联合支付普通订单通知 - * @author DB - * @since 2024/2/22 - * @return String - */ - @Override - public String normalUnionPay(HttpServletRequest request, HttpServletResponse response) { - WxPayNormalHandler wxPayNormalHandler = SpringUtils.getBean(WxPayNormalHandler.class); - // 预先设定返回的 response 类型为 xml - response.setHeader("Content-type", "application/xml"); - WxUtils wxUtils = SpringUtils.getBean(WxUtils.class); - // 读取参数,解析Xml为map - Map map = null; - Response okResponse = null; - try { - map = wxUtils.transferXmlToMap(wxUtils.readRequest(request)); - // 转换为有序 map,判断签名是否正确 - boolean isSignSuccess = wxUtils.checkSign(new TreeMap(map), "JamBox20220329174000000000000002"); - if (isSignSuccess) { - // 签名校验成功,说明是微信服务器发出的数据 - String orderId = map.get("out_trade_no"); - //获取订单信息 - EasyLearnOrder easyLearnOrder = this.getById(orderId); - JSONObject jsonObject = new JSONObject(); - EasyLearnPayPayEnum easyLearnPayPayEnum = EasyLearnPayPayEnum.getEasyLearnPayPayEnum(easyLearnOrder.getOrderType()); - jsonObject.put("wxOrderId", easyLearnOrder.getId()); - jsonObject.put("unionPayOutOrderId", easyLearnOrder.getUnionPayOutOrderId()); - jsonObject.put("easyLearnUnionPay", easyLearnPayPayEnum.toString()); - String url; - if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) { - url = UNION_PAY_PROD_JAMBOX_NOTIFY_URL; - } else if (StringUtils.equals("test", SpringUtils.getActiveProfile())) { - url = UNION_PAY_TEST_JAMBOX_NOTIFY_URL; - } else { - url = UNION_PAY_DEV_JAMBOX_NOTIFY_URL; - } - //通知晖哥 - okResponse = HttpUtils.sendOkHttpPost(url, jsonObject.toJSONString()); - //更新订单 - this.updateChain().set(EASY_LEARN_ORDER.OUT_ORDER_NO, map.get("transaction_id")) - .set(EASY_LEARN_ORDER.ORDER_STATUS, 1) - .where(EASY_LEARN_ORDER.ID.eq(orderId)).update(); - //发送通知到财务群 - List phoneList = new ArrayList(); - // 获取审核管理员手机号 - RedisService redisService = SpringUtils.getBean(RedisService.class); - String auditStaffPhone = redisService.getCacheObject("sysConfig:oam:OamCancelAfterVerificationStaffPhone"); - phoneList.add(auditStaffPhone); - try { - //获取品牌和校区信息 - Row brandAndStore = Db.selectOneByQuery("cp_sys_store", QueryWrapper.create() - .select("css.store_name") - .select("csb.brand_name") - .from("cp_sys_store").as("css") - .leftJoin("cp_sys_brand").as("csb").on("csb.id = css.brand_id") - .where("css.id= ?", easyLearnOrder.getStoreId())); - SpringUtils.getBean(WebHookSendHandler.class).webHookSendText("a885058b-2478-4df8-bdb7-2bb94a08c1f5", phoneList, - "==========用户订单到账==========" + - "\n订单创建时间:" + easyLearnOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + - "\n品牌:" + brandAndStore.getString("brandName") + - "\n校区:" + brandAndStore.getString("storeName") + - "\n订单类型:" + easyLearnOrder.getOrderType() + - "\n受益人:" + easyLearnOrder.getCustomerName() + - "\n电话:" + easyLearnOrder.getCustomerPhone() + - "\n订单金额:" + easyLearnOrder.getTotalAmount() + - "\n到账金额:" + easyLearnOrder.getTotalPayAmount() + - "\n微信订单号:" + map.get("transaction_id") + - "\n商户号:1618436087", - false); - } catch (IOException e) { - throw new ServiceException("发送任务通知失败!"); - } - return wxPayNormalHandler.success(); - } else { - // 签名校验失败(可能不是微信服务器发出的数据) - return wxPayNormalHandler.fail(); - } - } catch (Exception e) { - return wxPayNormalHandler.fail(); - } finally { - assert okResponse != null; - okResponse.close(); - } - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/NavigationServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/NavigationServiceImpl.java deleted file mode 100644 index 635846b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/NavigationServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.jambox.business.vo.NavigationVo; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.website.Navigation; -import com.cpop.jambox.business.mapper.NavigationMapper; -import com.cpop.jambox.business.service.NavigationService; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 果酱模块化官网 导航栏表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("navigationService") -public class NavigationServiceImpl extends ServiceImpl implements NavigationService { - - /** - * 查询所有果酱模块化官网 导航栏表 - * - * @author: Yxz - * @date: 2024/1/22 18:53 - * @param: [] - * @return: java.util.List - **/ - @Override - public List getList() { - List navigationVoList = this.list().stream().map(entity -> { - NavigationVo vo = new NavigationVo(); - BeanUtils.copyProperties(entity,vo,"updateTime"); - - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - // 格式化为字符串 - String updateTime = entity.getUpdateTime().format(formatter); - vo.setUpdateTime(updateTime); - - return vo; - }).collect(Collectors.toList()); - return navigationVoList; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/PlugServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/PlugServiceImpl.java deleted file mode 100644 index 4ef5785..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/PlugServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SqlUtils; -import com.cpop.jambox.business.bo.PlugBo; -import com.cpop.jambox.business.vo.PlugPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.Plug; -import com.cpop.jambox.business.mapper.PlugMapper; -import com.cpop.jambox.business.service.PlugService; -import org.springframework.stereotype.Service; - -import static com.cpop.jambox.business.entity.table.PlugTableDef.PLUG; - -/** - * 果酱-插件 服务层实现。 - * - * @author DB - * @since 2024-01-05 - */ -@Service("plugService") -public class PlugServiceImpl extends ServiceImpl implements PlugService { - - /** - * 查询插件分页 - * @author DB - * @since 2024/1/5 - * @return R> - */ - @Override - public Page getPlugPage() { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), - QueryWrapper.create() - .select(PLUG.ID, PLUG.NAME, PLUG.ORDER_NO, PLUG.STATUS, PLUG.PLUG_TAG, PLUG.REMARK) - .orderBy(PLUG.ORDER_NO.desc()), - PlugPageVo.class); - } - - /** - * 新增插件 - * @author DB - * @since 2024/1/5 - * @param bo 请求参数 - */ - @Override - public void insertPlug(PlugBo bo) { - Plug plug = BeanUtils.mapToClass(bo, Plug.class); - this.save(plug); - } - - @Override - public void updatePlug(PlugBo bo) { - Plug plug = BeanUtils.mapToClass(bo, Plug.class); - this.updateById(plug); - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreActiveServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreActiveServiceImpl.java deleted file mode 100644 index 53885a0..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreActiveServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.jambox.business.entity.StoreActive; -import com.cpop.jambox.business.mapper.StoreActiveMapper; -import com.cpop.jambox.business.service.StoreActiveService; -import org.springframework.stereotype.Service; - -/** - * 校区活跃数表 服务层实现。 - * - * @author DB - * @since 2024-04-12 - */ -@Service("storeActiveService") -public class StoreActiveServiceImpl extends ServiceImpl implements StoreActiveService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreExtendServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreExtendServiceImpl.java deleted file mode 100644 index 82fa0f7..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StoreExtendServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.jambox.business.entity.StoreExtend; -import com.cpop.jambox.business.mapper.StoreExtendMapper; -import com.cpop.jambox.business.service.StoreExtendService; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * 果酱校区拓展表 服务层实现。 - * - * @author DB - * @since 2023-10-26 - */ -@Service("storeExtendService") -public class StoreExtendServiceImpl extends ServiceImpl implements StoreExtendService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StorePlugServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StorePlugServiceImpl.java deleted file mode 100644 index 2461b61..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/StorePlugServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.common.utils.StringUtils; -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.Plug; -import com.cpop.jambox.business.entity.StorePlug; -import com.cpop.jambox.business.mapper.StorePlugMapper; -import com.cpop.jambox.business.service.PlugService; -import com.cpop.jambox.business.service.StorePlugService; -import com.cpop.jambox.business.vo.StorePlugListVo; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.jambox.business.entity.table.PlugTableDef.PLUG; -import static com.cpop.jambox.business.entity.table.StorePlugTableDef.STORE_PLUG; - -/** - * 校区-插件记录表 服务层实现。 - * - * @author DB - * @since 2023-12-29 - */ -@Service("storePlugService") -public class StorePlugServiceImpl extends ServiceImpl implements StorePlugService { - - /** - * 查询校区插件列表 - * - * @param brandId 品牌 - * @param storeId 校区 - * @return List - * @author DB - * @since 2023/12/29 - */ - @Override - public List getStorePlugList(String brandId, String storeId) { - if (StringUtils.isBlank(brandId) || StringUtils.isBlank(storeId)) { - return new ArrayList<>(); - } - //获取所有插件 - List plugList = SpringUtils.getBean(PlugService.class).listAs(QueryWrapper.create(), StorePlugListVo.class); - if (!plugList.isEmpty()) { - Map plugTagMap = this.list(QueryWrapper.create() - .where(STORE_PLUG.STORE_ID.eq(storeId))).stream().collect(Collectors.toMap(StorePlug::getPlugTag, BaseEntity::getCreateTime)); - plugList.forEach(item -> { - if (plugTagMap.get(item.getPlugTag()) != null) { - item.setIsOpen(true); - item.setOpenTime(plugTagMap.get(item.getPlugTag())); - } else { - item.setIsOpen(false); - } - item.setStoreId(storeId); - }); - return plugList; - } else { - return new ArrayList<>(); - } - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebProductServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebProductServiceImpl.java deleted file mode 100644 index ab962c0..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebProductServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.jambox.business.entity.website.WebProduct; -import com.cpop.jambox.business.mapper.WebProductMapper; -import com.cpop.jambox.business.service.WebProductService; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * 果酱模块化官网 核心产品表 服务层实现。 - * - * @author Yxz - * @since 2024-01-19 - */ -@Service("webProductService") -public class WebProductServiceImpl extends ServiceImpl implements WebProductService { - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebsiteServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebsiteServiceImpl.java deleted file mode 100644 index d286c9d..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/WebsiteServiceImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.cpop.jambox.business.service.impl; - -import com.cpop.core.base.entity.R; -import com.cpop.jambox.business.entity.website.*; -import com.cpop.jambox.business.mapper.DevelopmentMapper; -import com.cpop.jambox.business.service.*; -import com.cpop.jambox.business.vo.CompanyIntroVo; -import com.cpop.jambox.business.vo.CooperationPlatformVo; -import com.cpop.jambox.business.vo.DevelopmentVo; -import com.mybatisflex.core.query.QueryWrapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 果酱官网接口 服务实现层 - * - * @author: Yxz - * @date: 2024/1/21 11:45 - **/ -@Service("websiteService") -public class WebsiteServiceImpl implements WebsiteService { - @Autowired - private CooperationTypeService cooperationTypeService; - @Autowired - private CooperationService cooperationService; - @Autowired - private NavigationService navigationService; - @Autowired - private CompanyIntroService companyIntroService; - @Autowired - private BusinessIntroService businessIntroService; - @Autowired - private WebProductService productService; - @Autowired - private DevelopmentMapper developmentMapper; - - /** - * @description: 获取官网合作平台VO - * @author: Yxz - * @date: 2024/1/19 17:37 - * @param: [] - * @return: java.util.List - **/ - @Override - public List getCooperationPlatform() { - // 根据sort倒序查找合作平台种类 - List cooperationTypeList = cooperationTypeService.list(QueryWrapper.create().orderBy("sort", false)); - List voList = cooperationTypeList.stream().map(entity -> { - // 根据type_id 及 sort倒序查找合作平台 - CooperationPlatformVo vo = new CooperationPlatformVo(); - vo.setTypeName(entity.getTypeName()); - - List cooperationList = cooperationService.list(QueryWrapper.create().eq("type_id", entity.getId()) - .orderBy("sort", false)); - vo.setCooperationList(cooperationList); - return vo; - }).collect(Collectors.toList()); - - return voList; - } - - /** - * 获取公司介绍 - * @author: Yxz - * @date: 2024/1/19 18:32 - * @param: [] - * @return: com.cpop.jambox.business.vo.CompanyIntroVo - **/ - @Override - public CompanyIntroVo getCompanyIntro() { - Navigation navigation = navigationService.getOne(QueryWrapper.create().eq("path", "profile")); - CompanyIntro companyIntro = companyIntroService.getOne(QueryWrapper.create()); - - CompanyIntroVo vo = new CompanyIntroVo(); - vo.setHeadline(navigation.getNavigationName()); - vo.setCompanyIntro(companyIntro); - return vo; - } - - /** - * 获取公司业务介绍 - * - * @author: Yxz - * @date: 2024/1/21 11:28 - * @param: [] - * @return: com.cpop.jambox.business.entity.website.BusinessIntro - **/ - @Override - public BusinessIntro getBusinessIntro() { - BusinessIntro businessIntro = businessIntroService.getOne(QueryWrapper.create()); - /*// 提取图片json数组中的url - try { - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode jsonNode = objectMapper.readTree(businessIntro.getImgUrl()); - JsonNode firstElement = jsonNode.get(0); - - String url = firstElement.get("url").asText(); - businessIntro.setImgUrl(url); - } catch (IOException e) { - e.printStackTrace(); - }*/ - - return businessIntro; - } - - - - /** - * 获取发展历程 - * - * @author: Yxz - * @date: 2024/1/21 11:58 - * @param: [] - * @return: com.cpop.core.base.entity.R - **/ - @Override - public R getDevelopmentCourse() { - // 去重查找发布时间点 - List publishTimeList = developmentMapper.selectDistinctPublishTime(); - List developmentVoList = publishTimeList.stream().map(entity ->{ - DevelopmentVo vo = new DevelopmentVo(); - vo.setMilestone(entity); - List developmentList = developmentMapper.selectDevelopmentByPublishTime(entity); - vo.setDevelopmentList(developmentList); - return vo; - }).collect(Collectors.toList()); - return R.ok(developmentVoList); - } - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/task/CardTemplateAsyncTask.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/task/CardTemplateAsyncTask.java deleted file mode 100644 index 6c19a08..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/task/CardTemplateAsyncTask.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.cpop.jambox.business.task; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.DateUtils; -import com.cpop.common.utils.StringUtils; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.CardTemplate; -import com.cpop.jambox.business.service.CardTemplateService; -import com.cpop.jambox.framework.constant.JamboxCloudUrl; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -/** - * @author DB - * @createTime 2023/11/10 17:52 - * @description 课卡模板异步任务 - */ -@Component -public class CardTemplateAsyncTask { - - /** - * 生成课卡 - */ - @Async("customAsyncThreadPool") - public void cloudCreateCard(JSONObject jsonBody,String cardTemplateId) { - //查询课卡信息 - CardTemplate cardTemplate = SpringUtils.getBean(CardTemplateService.class).getById(cardTemplateId); - //时限卡 - if (cardTemplate.getTemplateType().equals(1)) { - jsonBody.put("moneyCard", true); - jsonBody.put("amount", cardTemplate.getPrice()); - } else if (cardTemplate.getTemplateType().equals(2)) { - jsonBody.put("timeLimit", true); - jsonBody.put("periodNumber", cardTemplate.getValidDay()); - jsonBody.put("periodType", cardTemplate.getTemplateType()); - } else { - // 课卡类型课时卡 - jsonBody.put("periodType", cardTemplate.getTemplateType()); - // 课卡计费类型 true false 课时卡 - jsonBody.put("timeLimit", false); - // 课时卡课时数 - jsonBody.put("periodNumber", cardTemplate.getClassNumber()); - } - // 课卡到期时间 - if (null != cardTemplate.getDayAppointment()){ - // 日最大约课次数 - jsonBody.put("maxFrequency", cardTemplate.getDayAppointment()); - } - if (StringUtils.isNotBlank(cardTemplate.getName())){ - // 课卡名称 - jsonBody.put("periodName", cardTemplate.getName()); - } - if (null != cardTemplate.getWeekAppointment()){ - // 周最大约课次数 - jsonBody.put("maxWeekFrequency", cardTemplate.getWeekAppointment()); - } - // 首次上课开始计有效期 - if (null != cardTemplate.getBufferDay()){ - // 最大停卡次数 - jsonBody.put("maxStopTime", cardTemplate.getBufferDay()); - } - //课卡有效期 - String periodExpire; - if (null != cardTemplate.getValidDay() && cardTemplate.getValidDay() > 0) { - //减一天 - LocalDate localDate = LocalDate.now().plusDays(cardTemplate.getValidDay() - 1); - periodExpire = localDate.format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD)); - } else { - periodExpire = cardTemplate.getEndDate().format(DateTimeFormatter.ofPattern(DateUtils.YYYY_MM_DD)); - } - jsonBody.put("periodExpire", periodExpire); - SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class); - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandListVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandListVo.java deleted file mode 100644 index 30fab5e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandListVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * Description: - * date: 2023/6/2 17:39 - * - * @Author ST - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Brand对象", description = "品牌表") -public class BrandListVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 云函数id - */ - @ApiModelProperty("云函数id") - private String brandCloudId; - - /** - * 品牌名 - */ - @ApiModelProperty("品牌名") - private String brandName; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandStaffPageVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandStaffPageVo.java deleted file mode 100644 index fb866ec..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/BrandStaffPageVo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * Description: - * date: 2023/6/2 13:38 - * - * @Author ST - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "BrandManagementStaff对象", description = "品牌管理员表") -public class BrandStaffPageVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 姓名 - */ - @ApiModelProperty("姓名") - private String name; - - /** - * 手机号 - */ - @ApiModelProperty("手机号") - private String phoneNumber; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - /** - * 品牌名 - */ - @ApiModelProperty("品牌名") - private String brandName; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 校区名 - */ - @ApiModelProperty("校区名") - private String campusName; - - /** - * 校区id - */ - @ApiModelProperty("校区id") - private String campusId; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusListByBrandVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusListByBrandVo.java deleted file mode 100644 index e574cad..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusListByBrandVo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author: DB - * @Date: 2023/07/04/18:10 - * @Description: - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Campus分页对象", description = "校区表") -public class CampusListByBrandVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 校区名 - */ - @ApiModelProperty("校区名") - private String name; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusPageVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusPageVo.java deleted file mode 100644 index 193a37e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CampusPageVo.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author: Administrator - * @Date: 2023/06/07/10:17 - * @Description: - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Campus分页对象", description = "校区表") -public class CampusPageVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 云校区id - */ - @ApiModelProperty("云校区id") - private String campusCloudId; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 品牌 - */ - @ApiModelProperty("品牌") - private String brandName; - - /** - * 校区名 - */ - @ApiModelProperty("校区名") - private String name; - - /** - * 负责人 - */ - @ApiModelProperty("负责人") - private String responsiblePerson; - - /** - * 负责人手机号 - */ - @ApiModelProperty("负责人手机号") - private String responsiblePersonPhone; - - /** - * 地址 - */ - @ApiModelProperty("地址") - private String address; - - /** - * openId - */ - @ApiModelProperty("openId") - private String openId; - - /** - * 到期时间 - */ - @ApiModelProperty("到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - private LocalDateTime expire; - - /** - * 是否签合同(0否1是) - */ - @ApiModelProperty("是否签合同(0否1是)") - private Boolean isSignContract; - - /** - * 顾问名 - */ - @ApiModelProperty("顾问名") - private String consultantName; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateInfoVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateInfoVo.java deleted file mode 100644 index 8be3c4b..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateInfoVo.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-22 10:40 - */ -@Data -@Accessors(chain = true) -@ApiModel("课卡模板信息") -public class CardTemplateInfoVo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 旧课卡模板id - */ - @ApiModelProperty(value = "旧课卡模板id") - private String oldTemplateId; - - /** - * 云品牌id - */ - @ApiModelProperty(value = "云品牌id") - private String brandCloudId; - - /** - * 云校区id - */ - @ApiModelProperty(value = "云校区id") - private String storeCloudId; - - /** - * 模板名 - */ - @NotBlank(message = "模板名不能为空") - @ApiModelProperty(value = "模板名",required = true) - private String name; - - /** - * 有效日期数 - */ - @ApiModelProperty(value = "有效日期数") - private Integer validDay; - - /** - * 结束日期 - */ - @ApiModelProperty(value = "结束日期") - private LocalDate endDate; - - /** - * 价格 - */ - @NotNull(message = "价格不能为空") - @ApiModelProperty(value = "价格") - private BigDecimal price; - - /** - * 课时 - */ - @ApiModelProperty("课时") - private Integer classNumber; - - /** - * 周预约数 - */ - @ApiModelProperty(value = "周预约数") - private Integer weekAppointment; - - /** - * 日预约数 - */ - @ApiModelProperty(value = "日预约数") - private Integer dayAppointment; - - /** - * 缓冲天数 - */ - @ApiModelProperty(value = "缓冲天数") - private Integer bufferDay; - - /** - * 模板类型(0:课时卡,1:时限卡,2:储值卡) - */ - @ApiModelProperty(value = "模板类型(0:课时卡,1:时限卡,2:储值卡)") - private Integer templateType; - - /** - * 使用范围 - */ - @ApiModelProperty(value = "使用范围(旧Type字段)") - private String scopeUse; - - /** - * 支付类型(0:微信支付;1:先学后付次付;2:旧放心学合约支付;3:数字人民币支付;4:线下支付;5:先学后付月付;) - */ - @NotEmpty(message = "支付类型不能为空") - @ApiModelProperty(value = "支付类型(0:微信支付;1:先学后付次付;2:旧放心学合约支付;3:数字人民币支付;4:线下支付;5:先学后付月付;)") - private List payType; - - /** - * 是否是会员(0否1是) - */ - @ApiModelProperty(value = "是否是会员(0否1是)") - private Boolean isMember; - - /** - * 是否是引流卡 - */ - @ApiModelProperty(value = "是否是引流卡(0否1是)") - private Boolean isDrainage; - - /** - * 二维码 - */ - @ApiModelProperty(value = "二维码") - private String qrCode; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateListVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateListVo.java deleted file mode 100644 index a423d16..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CardTemplateListVo.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Date; - -/** - * @author DB - * @createTime 2023/09/27 16:57 - * @description - */ -@Data -@Accessors(chain = true) -public class CardTemplateListVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 品牌id - */ - @ApiModelProperty(value = "品牌id") - private String brandId; - - /** - * 云品牌id - */ - @ApiModelProperty(value = "云品牌id") - private String cloudBrandId; - - /** - * 云校区id - */ - @ApiModelProperty(value = "云校区id") - private String cloudCampusId; - - /** - * 模板名 - */ - @ApiModelProperty(value = "模板名") - private String name; - - /** - * 价格 - */ - @ApiModelProperty(value = "价格") - private BigDecimal price; - - /** - * 有效日期 - */ - @ApiModelProperty(value = "有效日期") - private Integer validDay; - - /** - * 课时 - */ - @ApiModelProperty(value = "课时") - private Integer classNumber; - - /** - * 模板类型(0:课时卡,1:时限卡,2:储值卡) - */ - @ApiModelProperty(value = "模板类型(0:课时卡,1:时限卡,2:储值卡)") - private Integer templateType; - - /** - * 使用范围 - */ - @ApiModelProperty(value = "使用范围") - private String scopeUse; - - /** - * 是否是会员(0否1是) - */ - @ApiModelProperty(value = "是否是会员(0否1是)") - private Boolean isMember; - - /** - * 结束日期 - */ - @ApiModelProperty(value = "结束日期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date endDate; - - /** - * 太阳码 - */ - @ApiModelProperty(value = "太阳码") - private String qrCode; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CompanyIntroVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CompanyIntroVo.java deleted file mode 100644 index e8e3e93..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CompanyIntroVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.cpop.jambox.business.entity.website.CompanyIntro; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @Author: Yxz - * @Date: 2024/1/19 18:10 - * @Version: 1.0 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "官网介绍VO") -public class CompanyIntroVo { - @ApiModelProperty(value = "官网介绍标题") - private String headline; - private CompanyIntro companyIntro; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationPlatformVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationPlatformVo.java deleted file mode 100644 index 3b58fe5..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationPlatformVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.cpop.jambox.business.entity.website.Cooperation; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author: Yxz - * @Date: 2024/1/19 16:54 - * @Version: 1.0 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "官网合作平台VO") -public class CooperationPlatformVo { - @ApiModelProperty(value = "合作平台类别名") - private String typeName; - @ApiModelProperty(value = "合作平台集合") - private List cooperationList; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationTypeVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationTypeVo.java deleted file mode 100644 index 01e258a..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/CooperationTypeVo.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.cpop.jambox.business.vo; - - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @Author: Yxz - * @Date: 2024/1/22 19:15 - * @Version: 1.0 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "导航栏VO") -public class CooperationTypeVo { - @ApiModelProperty(value = "id") - private String id; - @ApiModelProperty(value = "种类名称") - private String typeName; - @ApiModelProperty(value = "排序") - private Integer sort; - @ApiModelProperty(value = "更新时间") - private String updateTime; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/DevelopmentVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/DevelopmentVo.java deleted file mode 100644 index d965317..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/DevelopmentVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.cpop.jambox.business.entity.website.Development; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author: Yxz - * @Date: 2024/1/21 14:02 - * @Version: 1.0 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "官网发展历程VO") -public class DevelopmentVo { - @ApiModelProperty(value = "发展历程时间点") - private String milestone; - @ApiModelProperty(value = "文章集合") - private List developmentList; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/EasyLearnPageVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/EasyLearnPageVo.java deleted file mode 100644 index 9037043..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/EasyLearnPageVo.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-15 9:32 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "EasyLearnPageVo对象", description = "分页返回对象") -public class EasyLearnPageVo { - - /** - * 品牌名 - */ - @ApiModelProperty(value = "品牌名") - private String brandName; - /** - * 签约时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty(value = "签约时间") - private LocalDateTime createTime; - /** - * 客户名 - */ - @ApiModelProperty(value = "客户名") - private String customerName; - /** - * 客户电话 - */ - @ApiModelProperty(value = "客户电话") - private String customerPhone; - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - /** - * 期数 - */ - @ApiModelProperty(value = "期数") - private Long periodNumber; - /** - * 课卡名 - */ - @ApiModelProperty(value = "课卡名") - private String productName; - /** - * 顾问 - */ - @ApiModelProperty(value = "顾问") - private String staffName; - /** - * 校区名 - */ - @ApiModelProperty(value = "校区名") - private String storeName; - /** - * 签约金额 - */ - @ApiModelProperty(value = "签约金额") - private BigDecimal totalAmount; - /** - * 支付金额 - */ - @ApiModelProperty(value = "支付金额") - private BigDecimal totalPayAmount; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanDetailVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanDetailVo.java deleted file mode 100644 index 7d0849e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanDetailVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-08 9:54 - */ -@Data -@ApiModel(value = "先学后付计划详情") -public class LearnNowPayLaterPlanDetailVo { - - /** - * 计划明细优惠说明 - */ - @ApiModelProperty("计划明细优惠说明") - private String planDiscountDescription; - - /** - * 计划明细原支付金额(单位分) - */ - @ApiModelProperty("计划明细原支付金额(单位分)") - private BigDecimal originalPrice; - - public void setOriginalPrice(Integer originalPrice) { - this.originalPrice = new BigDecimal(originalPrice).divide(BigDecimal.valueOf(100)); - } - - /** - * 计划明细实际支付金额(单位分) - */ - @ApiModelProperty("计划明细实际支付金额(单位分)") - private BigDecimal actualPrice; - - public void setActualPrice(Long actualPrice) { - this.actualPrice = new BigDecimal(actualPrice).divide(BigDecimal.valueOf(100)); - } - - /** - * 计划明细名称 - */ - @ApiModelProperty("计划明细名称") - private String planDetailName; - - /** - * 签约计划编号 - */ - @ApiModelProperty("签约计划编号") - private Integer planDetailNo; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanVo.java deleted file mode 100644 index 7d14c17..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/LearnNowPayLaterPlanVo.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-05 16:13 - */ -@Data -@ApiModel("先学后付计划") -public class LearnNowPayLaterPlanVo { - - /** - * 主键 - */ - @ApiModelProperty("计划分主键") - private String id; - - /** - * 支付分计划名称 - */ - @ApiModelProperty("支付分计划名称") - private String planName; - - /** - * 支付分计划有效期(单位天) - */ - @ApiModelProperty("支付分计划有效期(单位天)") - private Integer planDuration; - - /** - * 支付分计划扣费次数 - */ - @ApiModelProperty("支付分计划扣费次数") - private Integer deductionQuantity; - - - /** - * 支付分计划原总金额(单位分) - */ - @ApiModelProperty("支付分计划原总金额") - private BigDecimal totalOriginalPrice; - - public void setTotalOriginalPrice(Integer totalOriginalPrice) { - this.totalOriginalPrice = new BigDecimal(totalOriginalPrice).divide(BigDecimal.valueOf(100)); - } - - /** - * 支付分计划实际扣费总金额(单位分) - */ - @ApiModelProperty("支付分计划实际扣费总金额(单位分)") - private BigDecimal totalActualPrice; - - public void setTotalActualPrice(Integer totalActualPrice) { - this.totalActualPrice = new BigDecimal(totalActualPrice).divide(BigDecimal.valueOf(100)); - } - - /** - * 支付分计划明细列表 - */ - @ApiModelProperty("支付分计划明细列表") - private List planDetailList; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/NavigationVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/NavigationVo.java deleted file mode 100644 index c78a31d..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/NavigationVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.cpop.jambox.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - - - -/** - * @Author: Yxz - * @Date: 2024/1/22 18:46 - * @Version: 1.0 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "导航栏VO") -public class NavigationVo { - @ApiModelProperty(value = "id") - private String id; - @ApiModelProperty(value = "导航栏名称") - private String navigationName; - @ApiModelProperty(value = "路径") - private String path; - @ApiModelProperty(value = "更新时间") - private String updateTime; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugPageVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugPageVo.java deleted file mode 100644 index 5024353..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugPageVo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * 果酱插件 - * @author DB - * @version 1.0.0 - * @since 2024-01-05 10:33 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "PlugPageVo对象") -public class PlugPageVo { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 插件名 - */ - @ApiModelProperty("插件名") - private String name; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remark; - - /** - * 插件标签 - */ - @ApiModelProperty("插件标签") - private String plugTag; - - /** - * 排序 - */ - @ApiModelProperty("排序") - private Integer orderNo; - - /** - * 状态(0:禁用;1:使用) - */ - @ApiModelProperty("状态(0:禁用;1:使用)") - private Integer status; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugVo.java deleted file mode 100644 index 5db617e..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/PlugVo.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-05 13:48 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "PlugPageVo对象") -public class PlugVo { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 插件名 - */ - @ApiModelProperty("插件名") - private String name; - - /** - * 插件标签 - */ - @ApiModelProperty("插件标签") - private String plugTag; - - /** - * 插件图标地址 - */ - @ApiModelProperty("插件图标地址") - private String picUrl; - - /** - * 排序 - */ - @ApiModelProperty("排序") - private Integer orderNo; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remark; - - /** - * 状态(0:禁用;1:使用) - */ - @ApiModelProperty("状态(0:禁用;1:使用)") - private Integer status; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/StorePlugListVo.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/StorePlugListVo.java deleted file mode 100644 index 0e29923..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/vo/StorePlugListVo.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cpop.jambox.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-29 16:36 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "StorePlugListVo对象") -public class StorePlugListVo { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 插件名 - */ - @ApiModelProperty("插件名") - private String name; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remark; - - /** - * 插件标签 - */ - @ApiModelProperty("插件标签") - private String plugTag; - - /** - * 排序 - */ - @ApiModelProperty("排序") - private Integer orderNo; - - /** - * 是否开启 - */ - @ApiModelProperty("是否开启") - private Boolean isOpen; - - - /** - * 上架时间 - */ - @ApiModelProperty("上架时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime updateTime; - - /** - * 开启时间 - */ - @ApiModelProperty("开启时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime openTime; - - /** - * 校区id - */ - @ApiModelProperty("校区id") - private String storeId; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxCloudUrl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxCloudUrl.java deleted file mode 100644 index b603d55..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxCloudUrl.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cpop.jambox.framework.constant; - -/** - * 果酱云地址 - */ -public interface JamboxCloudUrl { - - /** - * 基础地址 - */ - String BASE_URL = "https://beibeike-qy-b33k4-1302318474.ap-shanghai.app.tcloudbase.com"; - - /** - * 课卡相关云函数 - */ - String COMMON_CARD_URL = BASE_URL + "/merchant_cloud"; - - /** - * 数据导入 - */ - String DATA_IMPORT = BASE_URL + "/dataImport"; -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxRedisConstant.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxRedisConstant.java deleted file mode 100644 index 7dbeb9f..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/constant/JamboxRedisConstant.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cpop.jambox.framework.constant; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-21 17:29 - */ -public interface JamboxRedisConstant { - - /** - * 一次性支付 - */ - String ONCE_PAY_LOCK_USER_PAY = "jambox:oncePayLock:userPay:"; - - /** - * 先学后付创建计划 - */ - String LEARN_NOW_PAY_LATER_CREATE_USER_PLANS_LOCK_USER_PAY = "jambox:learnNowPayLaterCreateUserPlansLock:userPay:"; - - /** - * 先学后付用户核销 - */ - String LEARN_NOW_PAY_LATER_SERVICE_ORDER_LOCK_USER_PAY = "jambox:learnNowPayLaterServiceOrderLock:userPay:"; - -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/enums/EasyLearnPayPayEnum.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/enums/EasyLearnPayPayEnum.java deleted file mode 100644 index 424d987..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/enums/EasyLearnPayPayEnum.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.cpop.jambox.framework.enums; - -import lombok.Getter; - -/** - * @author DB - * @version 1.0.0 - * @since 2023-12-28 16:23 - */ -@Getter -public enum EasyLearnPayPayEnum { - - /** - * 放心学次付 - */ - EASY_LEARN_DEFAULT_PAY("EasyLearnDefaultPay",0), - - /** - * 放心学月付 - */ - EASY_LEARN_MONTH_PAY("EasyLearnMonthPay",1), - - /** - * 微信支付 - */ - WX_PAY("WxPay",2), - - /** - * 数币支付 - */ - DIGITAL_CURRENCY("DigitalCurrency",3), - - /** - * 预付 - */ - PREPAYMENT("Prepayment",5), - - /** - * 还款 - */ - REPAYMENT("Repayment",6), - - /** - * 会员 - */ - MEMBER("MEMBER",7); - - EasyLearnPayPayEnum(String name, Integer orderType) { - this.orderType = orderType; - this.name = name; - } - - /** - * 订单类型 - */ - private Integer orderType; - - private String name; - - public void setOrderType(Integer orderType) { - this.orderType = orderType; - } - - public void setName(String name) { - this.name = name; - } - - public static EasyLearnPayPayEnum getEasyLearnPayPayEnum(int orderType) { - for (EasyLearnPayPayEnum c : EasyLearnPayPayEnum.values()) { - if (c.orderType == orderType) { - return c; - } - } - return null; - } -} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/tasks/LearnNowPayLaterTask.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/tasks/LearnNowPayLaterTask.java deleted file mode 100644 index aa08360..0000000 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/framework/tasks/LearnNowPayLaterTask.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.cpop.jambox.framework.tasks; - -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.bo.LearnNowPayLaterPlanBo; -import com.cpop.jambox.business.entity.CardTemplate; -import com.cpop.jambox.business.entity.CardTemplateExtend; -import com.cpop.jambox.business.service.CardTemplateExtendService; -import com.cpop.pay.framewok.config.wxPay.WxPayConfiguration; -import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.cpop.system.business.entity.WxPayScore; -import com.cpop.system.business.entity.WxPayScoreDetail; -import com.cpop.system.business.service.WxPayScoreDetailService; -import com.cpop.system.business.service.WxPayScoreService; -import com.github.binarywang.wxpay.bean.payscore.PayScorePlanDetailRequest; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanRequest; -import com.github.binarywang.wxpay.bean.payscore.WxPartnerPayScoreSignPlanResult; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.PartnerPayScoreSignPlanService; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Arrays; -import java.util.List; - -import static com.cpop.system.business.entity.table.WxPayScoreTableDef.WX_PAY_SCORE; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-17 18:18 - */ -@Component -@Slf4j -public class LearnNowPayLaterTask { - - @Autowired - private WxPayHandler wxPayHandler; - - @Autowired - private WxPayConfiguration wxPayConfiguration; - - /** - * 异步创建先学后付计划 - * @author DB - * @since 2024/1/17 - * @param cardTemplate 课卡模板 - * @param payType 支付类型 - */ - @Async("customAsyncThreadPool") - @Transactional(rollbackFor = Exception.class) - public void asyncCreateLearnNowPayLaterPlan(CardTemplate cardTemplate, LearnNowPayLaterPlanBo bo, Integer payType) { - String subMchId = wxPayHandler.getSubMchId(cardTemplate.getBrandId(), cardTemplate.getStoreId()); - //录入计划与详情 - WxPayScore wxPayScore = BeanUtils.mapToClass(bo, WxPayScore.class); - wxPayScore.setSignAccount(subMchId).setClassHour(bo.getClassHour()); - WxPayScoreService wxPayScoreService = SpringUtils.getBean(WxPayScoreService.class); - wxPayScoreService.save(wxPayScore); - //创建计划 - WxPayService wxPayService = wxPayHandler.getWxPayService(null, subMchId); - PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = wxPayService.getPartnerPayScoreSignPlanService(); - WxPartnerPayScoreSignPlanRequest planRequest = BeanUtils.mapToClass(bo,WxPartnerPayScoreSignPlanRequest.class); - List payScorePlanDetailRequests = BeanUtils.mapToList(bo.getPlanDetailList(), PayScorePlanDetailRequest.class); - planRequest.setAppid(wxPayConfiguration.getProperties().getServiceAppId()); - planRequest.setSubMchid(subMchId); - planRequest.setPlanDetailList(payScorePlanDetailRequests); - planRequest.setMerchantPlanNo(wxPayScore.getId()); - WxPartnerPayScoreSignPlanResult result; - CardTemplateExtendService cardTemplateExtendService = SpringUtils.getBean(CardTemplateExtendService.class); - //设置商户侧计划 - try { - result = partnerPayScoreSignPlanService.createPlans(planRequest); - } catch (WxPayException e) { - //删除计划开通 - try { - //查询旧表 - DataSourceKey.use("jambox"); - Row oldTemplate = DbChain.table("t_card_template") - .select("template_id as oldTemplateId") - .select("pay_type as payTypes") - .from("t_card_template") - .where("template_id = ?", cardTemplate.getOldTemplateId()) - .one(); - //移除 - List payTypes = Arrays.asList(oldTemplate.getString("payTypes").split(",")); - payTypes.remove(payType.toString()); - DbChain.table("t_card_template") - .set("pay_type", StringUtils.join(payTypes, ",")) - .where("template_id = ?", cardTemplate.getOldTemplateId()) - .update(); - } finally { - DataSourceKey.clear(); - } - throw new ServiceException(e.getMessage()); - } - List wxPayScoreDetails = BeanUtils.mapToList(result.getPlanDetailList(), WxPayScoreDetail.class); - wxPayScoreDetails.forEach(item -> { - item.setSysWxPayScoreId(wxPayScore.getId()); - }); - //批量保存计划详情 - SpringUtils.getBean(WxPayScoreDetailService.class).saveBatch(wxPayScoreDetails); - //更新外部计划id - wxPayScoreService.updateChain() - .set(WX_PAY_SCORE.OUT_PLAN_ID,result.getPlanId()) - .where(WX_PAY_SCORE.ID.eq(wxPayScore.getId())) - .update(); - //模板拓展 - CardTemplateExtend cardTemplateExtend = new CardTemplateExtend(); - cardTemplateExtend.setTemplateId(cardTemplate.getId()) - .setExtendId(wxPayScore.getId()) - .setExtendParamOne("1") - .setPayType(payType); - cardTemplateExtendService.save(cardTemplateExtend); - } -} diff --git a/Cpop-Jambox/src/main/resources/application-jambox.yml b/Cpop-Jambox/src/main/resources/application-jambox.yml deleted file mode 100644 index e2c59a4..0000000 --- a/Cpop-Jambox/src/main/resources/application-jambox.yml +++ /dev/null @@ -1,8 +0,0 @@ -wx: - pay: - #支付通知地址 - easy-learn-once-pay-notify-url: https://oamapi.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/oncePay - #放心学联合支付 - easy-learn-union-pay-notify-url: https://oamapi.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/unionPay - #放心学普通支付 - easy-learn-union-pay-normal-notify-url: https://oamapi.cpopsz.com/Cpop-Oam/callback/easyLearn/notify/normalUnionPay \ No newline at end of file diff --git a/Cpop-Jambox/src/main/resources/mapper/BrandExtendMapper.xml b/Cpop-Jambox/src/main/resources/mapper/BrandExtendMapper.xml deleted file mode 100644 index 3ba90ca..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/BrandExtendMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/BusinessDataMapper.xml b/Cpop-Jambox/src/main/resources/mapper/BusinessDataMapper.xml deleted file mode 100644 index 7a4a240..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/BusinessDataMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/BusinessIntroMapper.xml b/Cpop-Jambox/src/main/resources/mapper/BusinessIntroMapper.xml deleted file mode 100644 index f48f956..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/BusinessIntroMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/CardTemplateExtendMapper.xml b/Cpop-Jambox/src/main/resources/mapper/CardTemplateExtendMapper.xml deleted file mode 100644 index 72de3dd..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/CardTemplateExtendMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/CardTemplateMapper.xml b/Cpop-Jambox/src/main/resources/mapper/CardTemplateMapper.xml deleted file mode 100644 index 5a3b5cc..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/CardTemplateMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/CompanyIntroMapper.xml b/Cpop-Jambox/src/main/resources/mapper/CompanyIntroMapper.xml deleted file mode 100644 index d73c5b1..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/CompanyIntroMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/CooperationMapper.xml b/Cpop-Jambox/src/main/resources/mapper/CooperationMapper.xml deleted file mode 100644 index 04ca6c8..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/CooperationMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/CooperationTypeMapper.xml b/Cpop-Jambox/src/main/resources/mapper/CooperationTypeMapper.xml deleted file mode 100644 index 39d5663..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/CooperationTypeMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/DevelopmentMapper.xml b/Cpop-Jambox/src/main/resources/mapper/DevelopmentMapper.xml deleted file mode 100644 index a8f4ba2..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/DevelopmentMapper.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderDetailMapper.xml b/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderDetailMapper.xml deleted file mode 100644 index 9c5f5d2..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderDetailMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderExtendMapper.xml b/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderExtendMapper.xml deleted file mode 100644 index 5223f36..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderExtendMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderMapper.xml b/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderMapper.xml deleted file mode 100644 index 647ea94..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/EasyLearnOrderMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/NavigationMapper.xml b/Cpop-Jambox/src/main/resources/mapper/NavigationMapper.xml deleted file mode 100644 index a4b26bf..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/NavigationMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/PlugMapper.xml b/Cpop-Jambox/src/main/resources/mapper/PlugMapper.xml deleted file mode 100644 index 3980ddf..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/PlugMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/StoreActiveMapper.xml b/Cpop-Jambox/src/main/resources/mapper/StoreActiveMapper.xml deleted file mode 100644 index de7f662..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/StoreActiveMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/StoreExtendMapper.xml b/Cpop-Jambox/src/main/resources/mapper/StoreExtendMapper.xml deleted file mode 100644 index 33fcbf2..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/StoreExtendMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/StorePlugMapper.xml b/Cpop-Jambox/src/main/resources/mapper/StorePlugMapper.xml deleted file mode 100644 index 11a4440..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/StorePlugMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Jambox/src/main/resources/mapper/WebProductMapper.xml b/Cpop-Jambox/src/main/resources/mapper/WebProductMapper.xml deleted file mode 100644 index c338268..0000000 --- a/Cpop-Jambox/src/main/resources/mapper/WebProductMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile b/Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile deleted file mode 100644 index f4a4096..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/Mall-DockerD-Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM openjdk:8-jdk -LABEL authors="Lost" -RUN mkdir -p /root/Cpop-Mall/ -ADD ./target/Cpop-Mall-Web.jar /root/Cpop-Mall/Cpop-Mall-Web.jar -ENTRYPOINT ["sh", "-c", "java -jar /root/Cpop-Mall/Cpop-Mall-Web.jar --spring.profiles.active=dockerD,core,pay"] \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/pom.xml b/Cpop-Mall/Cpop-Mall-Web/pom.xml deleted file mode 100644 index a5d356a..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - - com.cpop - Cpop-Union - 1.1.0 - ../../pom.xml - - Cpop-Mall-Web - Cpop-Mall-Web - Cpop-Mall-Web - jar - 1.1.0 - - - - - com.cpop - Cpop-Mall - - - - com.mysql - mysql-connector-j - runtime - - - - - Cpop-Mall-Web - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java b/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java deleted file mode 100644 index 3f55add..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.cpop.mall.web; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableScheduling; - -/** - * @author DB - */ -@SpringBootApplication(scanBasePackages = {"com.cpop.**"}) -@MapperScan("com.cpop.**.mapper") -@EnableScheduling -public class CpopMallWebApplication { - - public static void main(String[] args) { - SpringApplication.run(CpopMallWebApplication.class, args); - } - -} diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml deleted file mode 100644 index 366a051..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml +++ /dev/null @@ -1,123 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: E:/Cpop/uploadPath - jwt: - #白名单 - whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/mini/brand/jamboxBrandIsInMall/*,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Mall\Cpop-Mall-Web\src\main\resources\static\keyPair\publicKey - # 公钥文件 - privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Mall\Cpop-Mall-Web\src\main\resources\static\keyPair\privateKey - -# DataSource Config -spring: - application: - name: Cpop-Mall-Dev - #redis配置 - redis: - #地址 - host: gz-crs-lv77ii2t.sql.tencentcdb.com - #端口 - port: 27714 - #数据库 - database: 3 - #密码 - password: Cpop2022@ - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - client-type: jedis - data: - mongodb: - host: localhost - port: 27017 - database: cpop-union - -server: - port: 9430 - servlet: - context-path: /Cpop-Mall - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - datasource: - mall: - url: jdbc:mysql://localhost:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Admin@123 - jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true - username: root - password: Customer0401 - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: Cpop-Mall开发API - description: Cpop-Mall开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #商城 - Mall-Backstage: - #后台 - group-name: Mall-Backstage - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.backstage - Mall-Mini: - #小程序 - group-name: Mall-Mini - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.mini - Mall-Test: - #测试 - group-name: Mall-Test - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.test - #系统 - System: - group-name: System - api-rule: package - api-rule-resources: - - com.cpop.system - -#商城相关配置文件 -mall: - cloudBaseUrl: https://test.cpopsz.com/test/ass/ - -#微信支付 -wx: - pay: - # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) - keyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.p12 - # 私钥证书 - privateKeyPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_key.pem - # 私钥文件 - privateCertPath: E:/Cpop/Cpop-Union/Cpop-Core/src/main/resources/static/keyPair/wxPay_cert.pem - #支付通知地址 - notifyUrl: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/order - #退款通知地址 - notifyRefund: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/refund diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dockerD.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dockerD.yml deleted file mode 100644 index 8202011..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dockerD.yml +++ /dev/null @@ -1,123 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: E:/Cpop/uploadPath - jwt: - #白名单 - whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/mini/brand/jamboxBrandIsInMall/*,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: /root/Cpop-Oam/keyPair/publicKey - # 公钥文件 - privateKeyFile: /root/Cpop-Oam/keyPair/privateKey - -# DataSource Config -spring: - application: - name: Cpop-Mall-Dev - #redis配置 - redis: - #地址 - host: gz-crs-lv77ii2t.sql.tencentcdb.com - #端口 - port: 27714 - #数据库 - database: 3 - #密码 - password: Cpop2022@ - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - client-type: jedis - data: - mongodb: - host: localhost - port: 27017 - database: cpop-union - -server: - port: 9430 - servlet: - context-path: /Cpop-Mall - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - datasource: - mall: - url: jdbc:mysql://192.168.3.61:3306/cpop_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Admin@123 - jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true - username: root - password: Customer0401 - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: Cpop-Mall开发API - description: Cpop-Mall开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #商城 - Mall-Backstage: - #后台 - group-name: Mall-Backstage - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.backstage - Mall-Mini: - #小程序 - group-name: Mall-Mini - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.mini - Mall-Test: - #测试 - group-name: Mall-Test - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.test - #系统 - System: - group-name: System - api-rule: package - api-rule-resources: - - com.cpop.system - -#商城相关配置文件 -mall: - cloudBaseUrl: https://test.cpopsz.com/test/ass/ - -#微信支付 -wx: - pay: - # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) - keyPath: /root/Cpop-Oam/keyPair/wxPay_cert.p12 - # 私钥证书 - privateKeyPath: /root/Cpop-Oam/keyPair/wxPay_key.pem - # 私钥文件 - privateCertPath: /root/Cpop-Oam/keyPair/wxPay_cert.pem - #支付通知地址 - notifyUrl: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/order - #退款通知地址 - notifyRefund: https://frp-oak.top:11899/Cpop-Mall/callback/wxPay/notify/refund diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-local.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-local.yml deleted file mode 100644 index e283161..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-local.yml +++ /dev/null @@ -1,107 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: D:\WorkSpace\Cpop\uploadPath - jwt: - #白名单 - whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/callback/wxPay/notify/** - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey - # 公钥文件 - privateKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey - -# DataSource Config -spring: - application: - name: Cpop-Mall-Dev - #redis配置 - redis: - #地址 - host: 106.52.49.102 - #端口 - port: 6333 - #数据库 - database: 10 - #密码 - password: Jambox.123* - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - client-type: jedis - data: - mongodb: - host: localhost - port: 27017 - database: cpop-union - -server: - port: 9430 - servlet: - context-path: /Cpop-Mall - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - datasource: - mall: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true - username: root - password: Customer0401 - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: Cpop-Mall开发API - description: Cpop-Mall开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #商城 - Mall-Backstage: - #后台 - group-name: Mall-Backstage - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.backstage - Mall-Mini: - #后台 - group-name: Mall-Mini - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.mini - #系统 - System: - group-name: System - api-rule: package - api-rule-resources: - - com.cpop.system - -#微信支付 -wx: - pay: - #通知地址 - notifyUrl: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/order - #支付成功 - notifyRefund: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/refund \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml deleted file mode 100644 index 1532ded..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml +++ /dev/null @@ -1,88 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: /root/cpop-union/cpop-mall/upload - jwt: - #白名单 - whiteList: /login,/miniLogin,/mini/brand/jamboxBrandIsInMall/*,/wxPay/callback/notify/**,/callback/wxPay/notify/** - #拦截 - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: /root/cpop-union/cpop-mall/script/secretKey/publicKey - # 公钥文件 - privateKeyFile: /root/cpop-union/cpop-mall/script/secretKey/privateKey - -# DataSource Config -spring: - application: - name: Cpop-Mall-Prod - #redis配置 - redis: - #地址 - host: gz-crs-lv77ii2t.sql.tencentcdb.com - #端口 - port: 27714 - #数据库 - database: 2 - #密码 - password: Cpop2022@ - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 0 - # - max-idle: 16 - # - max-active: 16 - # - max-wait: -1ms - client-type: jedis - data: - mongodb: - host: localhost - port: 27017 - database: rock-blade - -server: - port: 9430 - servlet: - context-path: /Cpop-Mall - -# springdoc-openapi项目配置 -knife4j: - enable: false - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl - datasource: - mall: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_association?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - -#商城相关配置文件 -mall: - cloudBaseUrl: https://api.jamboxsys.com/jambox/ass/ - -#微信支付 -wx: - pay: - # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) - keyPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_cert.p12 - # 私钥证书 - privateKeyPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_key.pem - # 私钥文件 - privateCertPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_cert.pem - #支付通知地址 - notifyUrl: https://api.jamboxsys.com/Cpop-Mall/callback/wxPay/notify/order - #退款通知地址 - notifyRefund: https://api.jamboxsys.com/Cpop-Mall/callback/wxPay/notify/refund diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml deleted file mode 100644 index 423207f..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml +++ /dev/null @@ -1,118 +0,0 @@ -# 项目相关配置 -cpop: - # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) - profile: /root/cpop-union/cpop-mall/upload - jwt: - #白名单 - whiteList: /login,/miniLogin,/mini/brand/jamboxBrandIsInMall/*,/wxPay/callback/notify/**,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/callback/wxPay/notify/** - #拦截 - gateway: - rsa-keypair: - # 公钥文件 - publicKeyFile: /root/cpop-union/cpop-mall/script/secretKey/publicKey - # 公钥文件 - privateKeyFile: /root/cpop-union/cpop-mall/script/secretKey/privateKey - -# DataSource Config -spring: - application: - name: Cpop-Mall-Test - #redis配置 - redis: - #地址 - host: gz-crs-lv77ii2t.sql.tencentcdb.com - #端口 - port: 27714 - #数据库 - database: 3 - #密码 - password: Cpop2022@ - #连接超时 - timeout: 5000 - jedis: - pool: - # - min-idle: 0 - # - max-idle: 8 - # - max-active: 8 - # - max-wait: -1ms - client-type: jedis - data: - mongodb: - host: localhost - port: 27017 - database: rock-blade - -server: - port: 9430 - servlet: - context-path: /Cpop-Mall - -#Mybatis-Flex -mybatis-flex: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - datasource: - mall: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Customer0401 - jambox: - url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true - username: root - password: Customer0401 - -# springdoc-openapi项目配置 -knife4j: - enable: true - openapi: - title: Cpop-Mall开发API - description: Cpop-Mall开发API - email: - concat: DB - url: https://api.jamboxsys.com - version: 1.0.0 - license: Apache 2.0 - license-url: https://stackoverflow.com/ - terms-of-service-url: https://api.jamboxsys.com - group: - #商城 - Mall-Backstage: - #后台 - group-name: Mall-Backstage - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.backstage - Mall-Mini: - #后台 - group-name: Mall-Mini - api-rule: package - api-rule-resources: - - com.cpop.mall.business.controller.mini - #系统 - System: - group-name: System - api-rule: package - api-rule-resources: - - com.cpop.system - -#商城相关配置文件 -mall: - cloudBaseUrl: https://test.cpopsz.com/test/ass/ - -#微信支付 -wx: - pay: - # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头) - keyPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_cert.p12 - # 私钥证书 - privateKeyPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_key.pem - # 私钥文件 - privateCertPath: /root/cpop-union/cpop-mall/script/secretKey/wxPay_cert.pem - #支付通知地址 - notifyUrl: https://test.cpopsz.com/onlineShop/callback/wxPay/notify/order - #退款通知地址 - notifyRefund: https://test.cpopsz.com/onlineShop/callback/wxPay/notify/refund diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml deleted file mode 100644 index cf34918..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml +++ /dev/null @@ -1,142 +0,0 @@ -# 项目相关配置 -cpop: - # 名称 - name: Cpop-Mall - # 版本 - version: 1.0.0 - #JWT - jwt: - #密钥 - secret: abcdefghijklmnopqrstuvwxyz - #过期时间(半天) - expire: 43200 - #token头 - header: Authorization - #拦截 - gateway: - rsa-keypair: - # 加密方式 - algorithm: RSA - # 初始化大小 - keySize: 2048 - -#Spring -spring: - mvc: - pathmatch: - matching-strategy: ant_path_matcher - servlet: - multipart: - #文件最大传输 - max-file-size: 1024MB - max-request-size: 300MB - profiles: - active: dev,core,pay - datasource: - type: com.zaxxer.hikari.HikariDataSource - driver-class-name: com.mysql.cj.jdbc.Driver - #hikari数据源特性配置 - hikari: - #最大连接数,默认值10. - maximum-pool-size: 10 - #最小空闲连接,默认值10. - minimum-idle: 10 - #连接超时时间(毫秒),默认值30秒. - connection-timeout: 30000 - #空闲连接超时时间,默认值600000(10分钟),只有空闲连接数大于最大连接数且空闲时间超过该值,才会被释放;如果大于等于 max-lifetime 且 max-lifetime>0,则会被重置为0. - idle-timeout: 600000 - #连接最大存活时间,默认值30分钟.设置应该比mysql设置的超时时间短 - max-lifetime: 3000000 - #连接测试查询 - connection-test-query: select 1 - messages: - #i18n - basename: static/i18n/messages - encoding: UTF-8 - cacheDuration: 3600 - quartz: - job-store-type: jdbc - jdbc: - initialize-schema: embedded - #定时任务启动开关,true-开 false-关 - auto-startup: true - #延迟1秒启动定时任务 - startup-delay: 1s - #启动时更新己存在的Job - overwrite-existing-jobs: true - properties: - org: - quartz: - scheduler: - instanceName: CpopMallScheduler - instanceId: AUTO - jobStore: - class: org.springframework.scheduling.quartz.LocalDataSourceJobStore - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - tablePrefix: QRTZ_ - isClustered: false - misfireThreshold: 12000 - clusterCheckinInterval: 15000 - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 1 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true - -#Mybatis-Flex -mybatis-flex: - global-config: - key-config: - key-type: generator - value: snowFlakeId - # 逻辑删除数据存在标记值 默认值:0 - normal-value-of-logic-delete: 0 - # 逻辑删除数据删除标记值 默认值:0 - deleted-value-of-logic-delete: 1 - # 全局逻辑删除默认字段 - logic-delete-column: is_delete - -# 线程池配置参数 -task: - pool: - # 设置核心线程数 - corePoolSize: 10 - # 设置最大线程数 - maxPoolSize: 20 - # 设置空闲线程存活时间(秒 - keepAliveSeconds: 300 - # 设置队列容量 - queueCapacity: 1024 - # 设置线程名称前缀 - threadNamePrefix: "Cpop-Mall-AsyncNotify-" - # 设置线程池等待终止时间(秒) - awaitTerminationSeconds: 60 - -# 防止XSS攻击 -xss: - # 过滤开关 - enabled: true - # 排除链接(多个用逗号分隔) - excludes: - # 匹配链接 - urlPatterns: /mall/* - -logging: - level: - #swagger日志 - springfox: error - -#微信 -wx: - #微信支付 - pay: - #微信公众号或者小程序等的appid - appId: wx20853d18c455e874 - #微信支付商户号 - mchId: 1618884922 - #微信支付商户密钥 - mchKey: JamBox20230919174000000000000002 - apiV3Key: JamBox20230919174000000000000002 - #分账服务商账号 - sharingAccount: 1618884922 - sharingAccountName: 果酱盒子 diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/logback.xml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/logback.xml deleted file mode 100644 index a4ee1dc..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/logback.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - %date{yyyy-MM-dd HH:mm:ss.SSS, GMT+8} [%thread] %-5level %logger{36} - %msg%n - UTF-8 - - - - - - - - - - - - - ${LOG_HOME}/${LOG_PREFIX}/info.log - - ${LOG_HOME}/${LOG_PREFIX}/info.log.%d.%i - - 15 - - - 64 MB - - - - - %date{yyyy-MM-dd HH:mm:ss.SSS, GMT+8} [%thread] %-5level %logger{36} - %msg%n - UTF-8 - - - - - - ${LOG_HOME}/${LOG_PREFIX}/sql.log - - ${LOG_HOME}/${LOG_PREFIX}/sql.log.%d.%i - - 15 - - - 64 MB - - - - - %date{yyyy-MM-dd HH:mm:ss.SSS, GMT+8} [%thread] %-5level %logger{36} - %msg%n - UTF-8 - - - - - - ${LOG_HOME}/${LOG_PREFIX}/error.log - - ${LOG_HOME}/${LOG_PREFIX}/error.log.%d.%i - - 15 - - - 64 MB - - - - - %date{yyyy-MM-dd HH:mm:ss.SSS, GMT+8} [%thread] %-5level %logger{36} - %msg%n - UTF-8 - - - - ERROR - ACCEPT - DENY - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties deleted file mode 100644 index e69de29..0000000 diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties deleted file mode 100644 index cd07a24..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties +++ /dev/null @@ -1,29 +0,0 @@ -#\u767B\u5F55\u4FE1\u606F -#\u64CD\u4F5C\u65E5\u5FD7\u4FE1\u606F -i18n_operationLog_systemLogin=System User Login -i18n_operationLog_systemLogout=System User Logout -i18n_operationLog_updateOamConfig=Update System Config -i18n_operationLog_insertOamMenu=Insert Oam Menu -i18n_operationLog_updateOamMenu=Update Oam Menu -i18n_operationLog_removeOamMenu=Remove Oam Menu -i18n_operationLog_insertOamRole=Insert Oam Role -i18n_operationLog_updateOamRole=Update Oam Role -i18n_operationLog_removeOamRole=Remove Oam Role -i18n_operationLog_insertOamDept=Insert Oam Dept -i18n_operationLog_updateOamDept=Update Oam Dept -i18n_operationLog_removeOamDept=Remove Oam Dept -i18n_operationLog_insertOamStaff=Insert Oam User -i18n_operationLog_updateOamStaff=Update Oam User -i18n_operationLog_removeOamStaff=Remove Oam User -i18n_operationLog_updateOamStaffPassword=Update Oam Staff Password - -#\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F -i18n_alert_peopleUnderTheDepartmentError=There are people under the department, it is not allowed to delete the department! -i18n_alert_departmentNotDeactivatedError=The current department is not deactivated, deletion is not allowed\uFF01 -i18n_alert_userOrPhoneOrEmailIsExist=Username or mobile phone number or email address already exists -i18n_alert_userIsExist=User already exists -i18n_alert_oldPasswordIsWrong=The old password was entered incorrectly, please try again - -#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F -i18n_baseInfo_success=Success -i18n_baseInfo_failed=Failed diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties deleted file mode 100644 index 8411710..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties +++ /dev/null @@ -1,29 +0,0 @@ -#\u767B\u5F55\u4FE1\u606F -#\u64CD\u4F5C\u65E5\u5FD7\u4FE1\u606F -i18n_operationLog_systemLogin=\u7CFB\u7EDF\u7528\u6237\u767B\u5F55 -i18n_operationLog_systemLogout=\u7CFB\u7EDF\u7528\u6237\u9000\u51FA -i18n_operationLog_updateOamConfig=\u4FEE\u6539\u7CFB\u7EDF\u914D\u7F6E -i18n_operationLog_insertOamMenu=\u6DFB\u52A0OAM\u83DC\u5355 -i18n_operationLog_updateOamMenu=\u4FEE\u6539OAM\u83DC\u5355 -i18n_operationLog_removeOamMenu=\u5220\u9664OAM\u83DC\u5355 -i18n_operationLog_insertOamRole=\u6DFB\u52A0OAM\u89D2\u8272 -i18n_operationLog_updateOamRole=\u4FEE\u6539OAM\u89D2\u8272 -i18n_operationLog_removeOamRole=\u5220\u9664OAM\u89D2\u8272 -i18n_operationLog_insertOamDept=\u6DFB\u52A0OAM\u90E8\u95E8 -i18n_operationLog_updateOamDept=\u4FEE\u6539OAM\u90E8\u95E8 -i18n_operationLog_removeOamDept=\u5220\u9664OAM\u90E8\u95E8 -i18n_operationLog_insertOamStaff=\u6DFB\u52A0OAM\u7528\u6237 -i18n_operationLog_updateOamStaff=\u4FEE\u6539OAM\u7528\u6237 -i18n_operationLog_removeOamStaff=\u5220\u9664OAM\u7528\u6237 -i18n_operationLog_updateOamStaffPassword=\u4FEE\u6539OAM\u7528\u6237\u5BC6\u7801 - -#\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F -i18n_alert_peopleUnderTheDepartmentError=\u5F53\u524D\u90E8\u95E8\u4E0B\u6709\u4EBA\u5458\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664\u90E8\u95E8\uFF01 -i18n_alert_departmentNotDeactivatedError=\u5F53\u524D\u90E8\u95E8\u672A\u505C\u7528\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664\u90E8\u95E8\uFF01 -i18n_alert_userOrPhoneOrEmailIsExist=\u7528\u6237\u540D\u6216\u624B\u673A\u53F7\u6216\u90AE\u7BB1\u5DF2\u5B58\u5728 -i18n_alert_userIsExist=\u7528\u6237\u5DF2\u5B58\u5728 -i18n_alert_oldPasswordIsWrong=\u65E7\u5BC6\u7801\u8F93\u5165\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165 - -#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F -i18n_baseInfo_success=\u6210\u529F -i18n_baseInfo_failed=\u5931\u8D25 diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java deleted file mode 100644 index 7e0c2a6..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.cpop.mall.web; - -import com.cpop.core.utils.RsaUtils; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.Map; - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -class CpopMallWebApplicationTests { - - @Autowired - private CoreService coreService; - - @Autowired - private RsaUtils rsaUtils; - - @Test - void contextLoads() { - } - - /** - * 初始化密钥对 - */ - @Test - public void initKeyPair() { - String publicFileUrl = "E:/Cpop/Jambox-Union/Jambox-Core/src/main/resources/static/keypair/publicKey"; - String privateFileUrl = "E:/Cpop/Jambox-Union/Jambox-Core/src/main/resources/static/keypair/privateKey"; - Map keyPairMap = rsaUtils.initKeyPair(publicFileUrl,privateFileUrl); - String publicKey = keyPairMap.get("publicKey"); - String privateKey = keyPairMap.get("privateKey"); - System.out.println("公钥:"); - System.out.println(publicKey); - System.out.println(); - System.out.println("私钥:"); - System.out.println(privateKey); - System.out.println(); - String source = "Admin@123"; - System.out.println("待加密字符串:"+source); - System.out.println(); - String strEncrypt = rsaUtils.encrypt(source); - System.out.println("加密后的字符串:"); - System.out.println(strEncrypt); - System.out.println(); - String strDecrypt = rsaUtils.decrypt(strEncrypt); - System.out.println("解密后的字符串:"); - System.out.println(strDecrypt); - } - -} diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMiniUserSyncTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMiniUserSyncTests.java deleted file mode 100644 index f12ff19..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMiniUserSyncTests.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.cpop.mall.web; - -import com.alibaba.fastjson.JSONArray; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.List; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-24 16:34 - */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CpopMiniUserSyncTests { - - @Test - public void syncMiniUser() { - List list = DbChain.table("cp_mini_user").from("cp_mini_user").list(); - System.out.println(JSONArray.toJSONString(list)); - } -} diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java deleted file mode 100644 index 330eded..0000000 --- a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopWxPayTests.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.cpop.mall.web; - -import cn.hutool.core.util.IdUtil; -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.utils.uuid.IdUtils; -import com.cpop.pay.framewok.config.wxPay.WxPayProperties; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingQueryRequest; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingReceiverRequest; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingReturnRequest; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingUnfreezeRequest; -import com.github.binarywang.wxpay.bean.profitsharing.result.ProfitSharingQueryResult; -import com.github.binarywang.wxpay.bean.profitsharing.result.ProfitSharingV3Result; -import com.github.binarywang.wxpay.bean.request.WxPayOrderReverseRequest; -import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request; -import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult; -import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result; -import com.github.binarywang.wxpay.config.WxPayConfig; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.WxPayService; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author DB - * @createTime 2023/11/01 18:15 - * @description 微信支付 - */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class CpopWxPayTests { - - @Autowired - private WxPayService wxPayService; - - @Autowired - private WxPayProperties wxPayProperties; - - /** - * @descriptions 微信支付退款 - * @author DB - * @date 2023/11/01 18:20 - * @return: void - */ - @Test - public void refund() throws WxPayException { - //Brand brand = SpringUtils.getBean(BrandService.class).getById("75140168047210496"); - //Order order = SpringUtils.getBean(OrderService.class).getById("78954327589658624"); - WxPayRefundV3Request request = new WxPayRefundV3Request(); - WxPayRefundV3Request.Amount amount = new WxPayRefundV3Request.Amount(); - //退款金额(单位分) - //int refund = order.getTotalAmount().scaleByPowerOfTen(2).intValue(); - int refund = 1; - amount.setRefund(refund) - .setTotal(refund) - .setCurrency("CNY"); - request.setTransactionId("4200002123202402194880609914") - //.setOutTradeNo("1000000000202401121937112562856") - //.setTransactionId(order.getOutOrderNo()) - //.setOutTradeNo(order.getId()) - .setNotifyUrl(wxPayProperties.getNotifyRefund()) - .setOutRefundNo(IdUtil.getSnowflakeNextIdStr()) - .setSubMchid("1618925571") - .setReason("先学后付测试退款") - .setAmount(amount); - WxPayRefundV3Result result = wxPayService.refundV3(request); - System.out.println(result); - } - - /** - * @descriptions 分账退款 - * @author DB - * @date 2023/11/03 9:57 - * @return: void - */ - @Test - public void profitSharingRefund() throws WxPayException { - ProfitSharingReturnRequest profitSharingReturnRequest = new ProfitSharingReturnRequest(); - //ProfitSharing profitSharing = SpringUtils.getBean(ProfitSharingService.class).getById("77860920238751744"); - //profitSharingReturnRequest.setOrderId(profitSharing.getOutProfitSharingId()); - //profitSharingReturnRequest.setOutReturnNo(profitSharing.getId()); - profitSharingReturnRequest.setOrderId("30001803972024020160326538828"); - profitSharingReturnRequest.setOutReturnNo(IdUtil.getSnowflakeNextIdStr()); - profitSharingReturnRequest.setDescription("分账退款"); - profitSharingReturnRequest.setSubMchId("1661323640"); - profitSharingReturnRequest.setReturnAccount("1618884922"); - profitSharingReturnRequest.setReturnAccountType("MERCHANT_ID"); - //profitSharingReturnRequest.setAmount(profitSharing.getAmount()); - profitSharingReturnRequest.setReturnAmount(504); - wxPayService.getProfitSharingService().profitSharingReturn(profitSharingReturnRequest); - } - - /** - * 取消订单 - * @throws WxPayException - */ - @Test - public void reverse() throws WxPayException { - WxPayOrderReverseRequest wxPayOrderReverseRequest = new WxPayOrderReverseRequest(); - //wxPayOrderReverseRequest.setOutTradeNo("97945902236385280"); - wxPayOrderReverseRequest.setOutTradeNo("1732752269107220540"); - wxPayOrderReverseRequest.setSubMchId("1661323640"); - wxPayService.reverseOrder(wxPayOrderReverseRequest); - } - - /** - * @descriptions 添加分账接收方 - * @author DB - * @date 2023/11/03 10:17 - * @return: void - */ - @Test - public void addReceiver() throws WxPayException { - //固定商户信息 - Map mapReceiver = new HashMap<>(4); - mapReceiver.put("type", "MERCHANT_ID"); - mapReceiver.put("account", "1618884922"); - mapReceiver.put("relation_type", "SERVICE_PROVIDER"); - mapReceiver.put("name","果酱盒子"); - //添加分账接收方 - ProfitSharingReceiverRequest profitSharingReceiver = new ProfitSharingReceiverRequest(); - profitSharingReceiver.setReceiver(JSONObject.toJSONString(mapReceiver)); - WxPayConfig config = wxPayService.getConfig(); - config.setSubMchId("1618925571"); - wxPayService.getProfitSharingService().addReceiver(profitSharingReceiver); - } - - /** - * @descriptions 获取订单信息 - * @author DB - * @date 2023/11/17 17:14 - * @return: void - */ - @Test - public void getOrderInfo() throws WxPayException { - WxPayConfig config = wxPayService.getConfig(); - config.setSubMchId("1661323640"); - WxPayOrderQueryResult wxPayOrderQueryResult = wxPayService.queryOrder("4200002096202401188599394121", null); - System.out.println(JSONObject.toJSONString(wxPayOrderQueryResult)); - } - - /** - * @descriptions 查询分账结果 - * @author DB - * @date 2023/11/20 12:35 - * @return: void - */ - @Test - public void getSharingInfo() throws WxPayException { - ProfitSharingQueryRequest profitSharingQueryRequest = new ProfitSharingQueryRequest(); - profitSharingQueryRequest.setOutOrderNo("1736629608413073412").setTransactionId("4200002096202401188599394121"); - profitSharingQueryRequest.setSubMchId("1661323640"); - ProfitSharingQueryResult result = wxPayService.getProfitSharingService().profitSharingQuery(profitSharingQueryRequest); - System.out.println(result.getResultCode()); - } - - /** - * @descriptions 查询分账结果 - * @author DB - * @date 2023/11/17 17:56 - * @return: void - */ - @Test - public void getProfitSharingResult() throws WxPayException { - ProfitSharingV3Result profitSharingV3Result = wxPayService.getProfitSharingService().profitSharingQueryV3("1745800085756895232", "4200002127202401122097980590", "1661323640"); - System.out.println(profitSharingV3Result); - } - - /** - * 结束分账 - * @throws WxPayException - */ - @Test - public void profitSharingFinish() throws WxPayException { - ProfitSharingUnfreezeRequest profitSharingFinishRequest = new ProfitSharingUnfreezeRequest(); - profitSharingFinishRequest.setTransactionId("4200002122202401129346519359"); - profitSharingFinishRequest.setOutOrderNo("1745820005743910912"); - profitSharingFinishRequest.setDescription("结束分账"); - profitSharingFinishRequest.setSubMchId("1661323640"); - wxPayService.getProfitSharingService().profitSharingFinish(profitSharingFinishRequest); - } - - /** - * 获取微信支付分用户签约计划 - * @author DB - * @since 2023/12/15 - */ - @Test - public void getPayScoreUserSignPlans() throws WxPayException { - wxPayService.getConfig().setServiceId("00003053000000169450961228104460"); - wxPayService.getV3("https://api.mch.weixin.qq.com/v3/payscore/sign-plan/partner/user-sign-plans/merchant-sign-plan-no/1736679801829396540?sub_mchid=1661323640"); - } - -} diff --git a/Cpop-Mall/pom.xml b/Cpop-Mall/pom.xml deleted file mode 100644 index 18ac06f..0000000 --- a/Cpop-Mall/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - com.cpop - Cpop-Union - 1.1.0 - ../pom.xml - - Cpop-Mall - Cpop-Mall - Cpop-商城 - jar - - - - - com.cpop - Cpop-Core - - - com.cpop - Cpop-System - - - com.cpop - Cpop-Jambox - - - com.cpop - Cpop-Pay - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/AdvanceOrderBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/AdvanceOrderBo.java deleted file mode 100644 index 14866e6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/AdvanceOrderBo.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.cpop.mall.business.bo; - -import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.List; - -/** - * @author DB - * @createTime 2023/11/06 11:13 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城预订单对象") -public class AdvanceOrderBo implements Serializable { - - /** - * 总金额 - */ - @NotNull(message = "总金额不能为空") - @ApiModelProperty(value = "总金额",required = true) - private BigDecimal totalAmount; - - /** - * 总积分 - */ - @NotNull(message = "总积分不能为空") - @ApiModelProperty(value = "总积分",required = true) - private Long totalPoint; - - /** - * 当前订单所有产品名 - */ - @StringArrayConvert - @ApiModelProperty(value = "当前订单所有产品名") - private String productNames; - - /** - * 支付类型 - */ - @NotNull(message = "支付类型不能为空") - @ApiModelProperty(value = "支付方式(0:微信支付;1:积分支付)",required = true) - private Integer payType; - - /** - * 支付用户名 - */ - @ApiModelProperty(value = "支付用户名") - private String payUserName; - - /** - * 购物车ids - */ - @ApiModelProperty(value = "购物车ids") - private List shoppingCartIds; - - /** - * 订单详情 - */ - @NotEmpty(message = "订单详情不能为空") - @ApiModelProperty(value = "订单详情",required = true) - private List orderDetailList; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/CarouselBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/CarouselBo.java deleted file mode 100644 index 8063de1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/CarouselBo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cpop.mall.business.bo; - -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-15 13:44 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城轮播图对象") -public class CarouselBo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 产品id - */ - @NotBlank(message = "产品id不能为空") - @ApiModelProperty(value = "产品id",required = true) - private String productId; - - /** - * 图片地址 - */ - @ApiModelProperty(value = "图片地址",required = true) - @NotBlank(message = "图片地址不能为空") - private String picUrl; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空") - @ApiModelProperty(value = "排序",required = true) - private Integer orderNo; - - /** - * 上架状态(0:下架;1:上架) - */ - @NotNull(message = "上架状态不能为空") - @ApiModelProperty(value = "上架状态(0:下架;1:上架)",required = true) - private Boolean upStatus; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/LogisticsOrderBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/LogisticsOrderBo.java deleted file mode 100644 index c767107..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/LogisticsOrderBo.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @author DB - * @Description: - * @create 2023-10-28 15:25 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城物流订单") -public class LogisticsOrderBo implements Serializable { - - /** - * 订单主键 - */ - @NotBlank(message = "订单主键不能为空") - @ApiModelProperty(value = "订单主键",required = true) - private String id; - - /** - * 物流订单号 - */ - @NotBlank(message = "物流订单号不能为空") - @ApiModelProperty(value = "物流订单号",required = true) - private String logisticsOrder; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRoleBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRoleBo.java deleted file mode 100644 index f781a36..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRoleBo.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * @author DB - * @Description: - * @create 2023-10-19 22:23 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城Role对象", description = "角色表") -public class MallRoleBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 角色id - */ - @ApiModelProperty("角色id") - private String roleId; - - /** - * 角色名称 - */ - @NotBlank(message = "角色名称不能为空") - @ApiModelProperty("角色名称") - private String roleName; - - /** - * 角色值 - */ - @NotBlank(message = "角色值不能为空") - @ApiModelProperty("角色值") - private String roleValue; - - /** - * 状态 - */ - @NotNull(message = "状态不能为空") - @ApiModelProperty("状态") - private Boolean status; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remark; - - /** - * 排序 - */ - @NotNull(message = "排序不能为空") - @ApiModelProperty("排序") - private Integer orderNo; - - /** - * 菜单集合 - */ - @ApiModelProperty("菜单集合") - private List menuIds; - - /** - * 品牌id - */ - @ApiModelProperty(value = "品牌id") - private String brandId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRolePageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRolePageBo.java deleted file mode 100644 index 9cd2fe2..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/MallRolePageBo.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @Description: - * @create 2023-10-19 22:21 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城Role分页对象") -public class MallRolePageBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 角色名称 - */ - @ApiModelProperty("角色名称") - private String roleName; - - /** - * 状态 - */ - @ApiModelProperty("状态") - private Boolean status; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ModifyUserPasswordBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ModifyUserPasswordBo.java deleted file mode 100644 index 7991f9e..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ModifyUserPasswordBo.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * Description: 修改用户密码bo - * date: 2023/5/12 16:01 - * - * @Author ST - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "ModifyUserPasswordBo对象", description = "修改用户密码bo") -public class ModifyUserPasswordBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 用户id - */ - @NotBlank(message = "用户id不能为空") - @ApiModelProperty(value = "用户id",required = true) - private String userId; - - /** - * 旧密码 - */ - @NotBlank(message = "旧密码不能为空") - @ApiModelProperty(value = "旧密码",required = true) - private String oldPassword; - - /** - * 新密码 - */ - @NotBlank(message = "新密码不能为空") - @ApiModelProperty(value = "新密码",required = true) - private String newPassword; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderApplyRefundBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderApplyRefundBo.java deleted file mode 100644 index cc845e0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderApplyRefundBo.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/26 17:22 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "用户申请退款对象") -public class OrderApplyRefundBo implements Serializable { - - /** - * 订单id - */ - @NotBlank(message = "订单id不能为空") - @ApiModelProperty(value = "订单id",required = true) - private String orderId; - - /** - * 退款原因 - */ - @NotBlank(message = "退款原因不能为空") - @ApiModelProperty(value = "退款原因",required = true) - private String refundReason; - - /** - * openId - */ - @NotBlank(message = "openId不能为空") - @ApiModelProperty(value = "openId",required = true) - private String openId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderDetailBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderDetailBo.java deleted file mode 100644 index 854f245..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderDetailBo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/11/06 11:21 - * @description - */ -@Data -@ApiModel(value = "商城订单下单详情请求对象") -public class OrderDetailBo implements Serializable { - - /** - * 商品记录id - */ - @NotBlank(message = "商品规格记录id不能为空") - @ApiModelProperty(value = "商品规格记录id",required = true) - private String productRecordId; - - /** - * 金额 - */ - @NotNull(message = "金额不能为空") - @ApiModelProperty(value = "金额",required = true) - private BigDecimal amount; - - /** - * 积分 - */ - @NotNull(message = "积分不能为空") - @ApiModelProperty(value = "积分",required = true) - private Integer point; - - /** - * 下单数量 - */ - @NotNull(message = "下单数量不能为空") - @ApiModelProperty(value = "下单数量",required = true) - private Integer number; - - /** - * 店铺(校区)id - */ - @NotBlank(message = "店铺(校区)id不能为空") - @ApiModelProperty(value = "店铺(校区)id",required = true) - private String storeId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderEvaluateBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderEvaluateBo.java deleted file mode 100644 index 2cf7a78..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderEvaluateBo.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/26 17:13 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "用户评价订单") -public class OrderEvaluateBo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 产品id - */ - @NotBlank(message = "产品id不能为空") - @ApiModelProperty(value = "产品id",required = true) - private String productId; - - /** - * 订单id - */ - @NotBlank(message = "订单id不能为空") - @ApiModelProperty(value = "订单id",required = true) - private String orderId; - - /** - * 评价 - */ - @NotBlank(message = "评价不能为空") - @ApiModelProperty(value = "评价",required = true) - private String evaluate; - - /** - * 星 - */ - @NotBlank(message = "星不能为空") - @ApiModelProperty(value = "星",required = true) - private Double start; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderPageBo.java deleted file mode 100644 index 4cc7cf0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderPageBo.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/24 14:58 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单分页请求对象") -public class OrderPageBo implements Serializable { - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 收货人 - */ - @ApiModelProperty("收货人") - private String receiveName; - - /** - * 收货人手机号 - */ - @ApiModelProperty("收货人手机号") - private String receivePhone; - - /** - * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中) - */ - @ApiModelProperty("订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中)") - private Integer orderStatus; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java deleted file mode 100644 index de85af9..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRefundPageBo.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/27 17:33 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单退款分页请求对象") -public class OrderRefundPageBo implements Serializable { - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 支付用户 - */ - @ApiModelProperty("支付用户") - private String payUserName; - - /** - * 接收人手机号 - */ - @ApiModelProperty("接收人手机号") - private String receivePhone; - - /** - * 退款状态(0:申请中;1:通过;2:驳回) - */ - @ApiModelProperty("退款状态(0:申请中;1:通过;2:驳回)") - private Integer refundStatus; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRejectRefundBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRejectRefundBo.java deleted file mode 100644 index 25ef861..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/OrderRejectRefundBo.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/24 16:11 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单拒绝退款请求对象") -public class OrderRejectRefundBo implements Serializable { - - /** - * 订单号 - */ - @NotBlank(message = "订单号不能为空") - @ApiModelProperty(value = "订单号",required = true) - private String id ; - - /** - * 拒绝原因 - */ - @NotBlank(message = "拒绝原因不能为空") - @ApiModelProperty(value = "拒绝原因",required = true) - private String rejectReason; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java deleted file mode 100644 index 35a2691..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/PlaceOrderBo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/25 9:21 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单下单请求对象") -public class PlaceOrderBo implements Serializable { - - /** - * 主键 - */ - @NotBlank(message = "主键不能为空") - @ApiModelProperty(value = "主键",required = true) - private String id; - - /** - * 收货人名 - */ - @NotBlank(message = "收货人名不能为空") - @ApiModelProperty(value = "收货人名",required = true) - private String receiveName; - - /** - * 收货人电话 - */ - @NotBlank(message = "收货人电话不能为空") - @ApiModelProperty(value = "收货人电话",required = true) - private String receivePhone; - - /** - * 收货地址 - */ - @NotBlank(message = "收货地址不能为空") - @ApiModelProperty(value = "收货地址",required = true) - private String receiveAddress; - - /** - * 备注 - */ - @ApiModelProperty(value = "备注") - private String remarks; - - /** - * 支付类型 - */ - @NotNull(message = "支付类型不能为空") - @ApiModelProperty(value = "支付方式(0:微信支付;1:积分支付)",required = true) - private Integer payType; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java deleted file mode 100644 index 93bcaef..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductBo.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.cpop.mall.business.bo; - -import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * @author DB - * @createTime 2023/10/23 12:01 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品请求对象") -public class ProductBo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 商品名 - */ - @NotBlank(message = "商品名不能为空") - @ApiModelProperty(value = "商品名",required = true) - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他) - */ - @NotNull(message = "产品类型不能为空") - @ApiModelProperty(value = "产品类型(0:课卡;1:周边;2:优惠卷:3:其他)",required = true) - private Integer productType; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 支付方式(微信支付:0;积分支付:1) - */ - @ApiModelProperty("支付方式(微信支付:0;积分支付:1)") - private Integer payType; - - /** - * 商店(校区)集合 - */ - @StringArrayConvert - @NotBlank(message = "商店(校区)集合不能为空") - @ApiModelProperty("商店(校区)集合") - private String storeIds; - - /** - * 描述 - */ - @NotBlank(message = "描述不能为空") - @ApiModelProperty(value = "描述",required = true) - private String description; - - /** - * 商品图地址 - */ - @NotBlank(message = "商品图地址不能为空") - @ApiModelProperty(value = "商品图地址",required = true) - private String picUrl; - - /** - * 商品详情图地址 - */ - @NotBlank(message = "商品图地址不能为空") - @ApiModelProperty(value = "商品详情图地址",required = true) - private String picDetailUrl; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - @ApiModelProperty("购买限制(0:会员限制;1:新客限定;2:用户限购)") - private Integer buyRestrict; - - /** - * 限制数量 - */ - @ApiModelProperty("限制数量") - private Integer limitNum; - - /** - * 旧模板id - */ - @ApiModelProperty("旧课卡模板id") - private String cardTemplateId; - - /** - * 规格集合 - */ - @ApiModelProperty(value = "规格集合",required = true) - private List specificationList; - - /** - * 规格详情 - */ - @ApiModelProperty(value = "规格详情",required = true) - private List recordList; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java deleted file mode 100644 index d6646d7..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductPageBo.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/23 11:53 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品分页请求对象") -public class ProductPageBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他 - */ - @ApiModelProperty("产品类型(0:课卡;1:周边;2:优惠卷:3:其他") - private Integer productType; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - @ApiModelProperty("购买限制(0:会员限制;1:新客限定;2:用户限购)") - private Integer buyRestrict; - - /** - * 价格排序 - */ - @ApiModelProperty("价格排序(false:从低到高;true:从高到低)") - private Boolean priceOrder; - - /** - * 支付方式(0:微信支付;1:积分支付) - */ - @ApiModelProperty("支付方式(0:微信支付;1:积分支付)") - private Integer payType; - - /** - * 产品id - */ - @ApiModelProperty("产品id") - private String productId; - - /** - * 上下架 - */ - @ApiModelProperty("上下架") - private Boolean isUp; - - /** - * 授权校区 - */ - @ApiModelProperty("授权校区") - private String authorizedStoreId; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductRecordBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductRecordBo.java deleted file mode 100644 index 0d192c5..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductRecordBo.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cpop.mall.business.bo; - -import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/10/23 16:29 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品规格详情对象") -public class ProductRecordBo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 记录集合 - */ - @StringArrayConvert - @ApiModelProperty("记录集合") - private String recordNames; - - /** - * 数量 - */ - @ApiModelProperty("数量") - private Integer recordNum; - - /**关联 - * 记录消耗金额 - */ - @ApiModelProperty("记录消耗金额") - private BigDecimal recordPrice; - - /** - * 记录消耗积分 - */ - @ApiModelProperty("记录消耗积分") - private Integer recordPoints; - - /** - * 乐观锁字段 - */ - @ApiModelProperty("乐观锁字段") - private Integer version; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductSpecificationBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductSpecificationBo.java deleted file mode 100644 index 9fb93b0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ProductSpecificationBo.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.cpop.mall.business.bo; - -import com.cpop.core.anno.StringArrayConvert; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/23 16:41 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品规格对象") -public class ProductSpecificationBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 产品id - */ - @ApiModelProperty("产品id") - private String productId; - - /** - * 规格名 - */ - @ApiModelProperty("规格名") - @StringArrayConvert - private String specificationNames; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartBo.java deleted file mode 100644 index a804275..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartBo.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/11/06 14:12 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城购物车新增对象") -public class ShoppingCartBo implements Serializable { - - /** - * 商品记录id - */ - @NotBlank(message = "商品记录id不能为空") - @ApiModelProperty(value = "商品记录id",required = true) - private String productRecordId; - - /** - * 校区id - */ - @NotBlank(message = "校区id不能为空") - @ApiModelProperty(value = "校区id",required = true) - private String storeId; - - /** - * 金额 - */ - @NotNull(message = "金额不能为空") - @ApiModelProperty(value = "金额",required = true) - private BigDecimal amount; - - /** - * 积分 - */ - @NotNull(message = "积分不能为空") - @ApiModelProperty(value = "积分",required = true) - private Integer point; - - /** - * 数量 - */ - @NotNull(message = "数量不能为空") - @ApiModelProperty(value = "数量",required = true) - private Integer number; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartPageBo.java deleted file mode 100644 index 2fc7083..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/ShoppingCartPageBo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/11/06 13:52 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城购物车查询对象") -public class ShoppingCartPageBo implements Serializable { - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffBo.java deleted file mode 100644 index 7b017bf..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffBo.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - -/** - * 员工表Bo - * - * @author DB.lost - * @since 2023-05-11 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Staff对象", description = "员工表") -public class StaffBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 姓名不能为空 - */ - @NotBlank(message = "姓名不能为空") - @ApiModelProperty("姓名") - private String name; - - /** - * 品牌 - */ - @ApiModelProperty(value = "品牌") - private String brandId; - - /** - * 角色品牌id - */ - @ApiModelProperty("角色品牌id") - private String roleBrandId; - - /** - * 用户id - */ - @ApiModelProperty("用户id") - private String userId; - - /** - * 用户名 - */ - @NotBlank(message = "用户名不能为空") - @ApiModelProperty(value = "用户名",required = true) - private String userName; - - /** - * 密码 - */ - @NotBlank(message = "密码不能为空") - @ApiModelProperty(value = "密码",required = true) - private String password; - - /** - * 昵称 - */ - @NotBlank(message = "昵称不能为空") - @ApiModelProperty(value = "昵称",required = true) - private String nickName; - - /** - * 邮箱 - */ - @ApiModelProperty(value = "邮箱") - private String email; - - /** - * 手机号 - */ - @NotBlank(message = "手机号不能为空") - @ApiModelProperty(value = "手机号",required = true) - private String phoneNumber; - - /** - * 性别(0:男;1:女) - */ - @NotNull(message = "性别不能为空") - @ApiModelProperty(value = "性别(0:男;1:女)",required = true) - private Boolean sex; - - /** - * 头像 - */ - @ApiModelProperty(value = "头像") - private String avatar; - - /** - * 状态(0:停用;1:启用) - */ - @NotNull(message = "状态不能为空") - @ApiModelProperty(value = "状态(0:停用;1:启用)",required = true) - private Boolean status; - - /** - * 角色id - */ - @NotBlank(message = "角色id不能为空") - @ApiModelProperty(value = "角色id",required = true) - private String roleId; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffPageBo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffPageBo.java deleted file mode 100644 index 4b0fe1e..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/bo/StaffPageBo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cpop.mall.business.bo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/20 11:08 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城员工分页请求对象") -public class StaffPageBo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 姓名 - */ - @ApiModelProperty("姓名") - private String name; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageCarouselController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageCarouselController.java deleted file mode 100644 index 39d9b2b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageCarouselController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.bo.CarouselBo; -import com.cpop.mall.business.service.ProductService; -import com.cpop.mall.business.vo.CarouselPageVo; -import com.cpop.mall.business.vo.ProductSimpleVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.mall.business.service.CarouselService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -import java.util.List; - -import static com.cpop.mall.business.entity.table.CarouselTableDef.CAROUSEL; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; - -/** - * 商城轮播图 控制层。 - * - * @author DB - * @since 2024-01-15 - */ -@RestController -@Api(tags = "商城轮播图接口") -@RequestMapping("/backstage/carousel") -public class BackstageCarouselController { - - @Autowired - private CarouselService carouselService; - - /** - * 分页查询商城轮播图 - * @author DB - * @since 2024/1/15 - * @param upStatus 上架状态 - * @return R> - */ - @GetMapping("/getCarouselPage") - @ApiOperation("分页查询商城轮播图") - public R> getCarouselPage(@ApiParam("上架状态") @RequestParam(value = "upStatus", required = false) Boolean upStatus) { - Page page = carouselService.getCarouselPage(upStatus); - return R.ok(page); - } - - /** - * 新增轮播图 - * @author DB - * @since 2024/1/15 - * @param bo 请求参数 - * @return R - */ - @PostMapping("/insertCarousel") - @ApiOperation("新增商城轮播图") - public R insertCarousel(@RequestBody CarouselBo bo) { - carouselService.insertCarousel(bo); - return R.ok(); - } - - /** - * 更新轮播图 - * - * @param bo 请求参数 - * @return R - * @author DB - * @since 2024/1/15 - */ - @PutMapping("/updateCarousel") - @ApiOperation("修改商城轮播图") - public R updateCarousel(@RequestBody CarouselBo bo) { - carouselService.updateCarousel(bo); - return R.ok(); - } - - /** - * 轮播图上下架 - * @param id 主键 - * @return R - * @author DB - * @since 2024/1/15 - */ - @PutMapping("/carouselUnmount/{id}") - @ApiOperation("轮播图上下架") - public R carouselUnmount(@PathVariable String id) { - carouselService.updateChain() - .setRaw(CAROUSEL.UP_STATUS, "if(up_status = 0, 1, 0)") - .where(CAROUSEL.ID.eq(id)) - .update(); - return R.ok(); - } - - /** - * 删除轮播图 - * - * @param id 主键 - * @return R - * @author DB - * @since 2024/1/15 - */ - @DeleteMapping("/removeCarouselById/{id}") - @ApiOperation("删除轮播图") - public R removeCarouselById(@PathVariable String id) { - carouselService.updateChain().where(CAROUSEL.ID.eq(id)).remove(); - return R.ok(); - } - - /** - * 获取上架商品 - * @author DB - * @since 2024/1/15 - * @param brandId 品牌id - * @return R> - */ - @GetMapping("/getUpProductList") - @ApiOperation("获取上架商品") - public R> getUpProductList() { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - List productSimpleVos = SpringUtils.getBean(ProductService.class).listAs(QueryWrapper.create() - .select(PRODUCT.ID, PRODUCT.PRODUCT_NAME) - .where(PRODUCT.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .and(PRODUCT.IS_UP.eq(true)) - , ProductSimpleVo.class); - return R.ok(productSimpleVos); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java deleted file mode 100644 index 7a1f591..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageMallRoleController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.mall.business.bo.MallRoleBo; -import com.cpop.mall.business.bo.MallRolePageBo; -import com.cpop.mall.business.service.RoleBrandService; -import com.cpop.mall.business.vo.MallRolePageVo; -import com.cpop.system.business.bo.MenuListBo; -import com.cpop.system.business.bo.RoleStatusBo; -import com.cpop.system.business.service.MenuService; -import com.cpop.system.business.vo.MenuVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * @author DB - * @createTime 2023/10/19 18:14 - * @description - */ -@RestController -@Api(tags = "商城角色定制接口") -@RequestMapping("/backstage/mallRole") -public class BackstageMallRoleController { - - @Autowired - private RoleBrandService roleBrandService; - - @Autowired - private MenuService menuService; - - /** - * @descriptions 查询商城角色分页列表 - * @author DB - * @date 2023/09/10 16:51 - * @param bo 请求参数 - * @return R> - */ - @PreAuthorize("@aps.hasPermission('system:role:list')") - @ApiOperation("查询商城角色分页列表") - @GetMapping("/getMallRolePageList") - public R> getMallRolePageList(MallRolePageBo bo) { - Page pageVo = roleBrandService.getMallRolePageList(bo); - return R.ok(pageVo); - } - - /** - * @descriptions 新增角色 - * @author DB - * @date 2023/10/12 10:48 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @PreAuthorize("@aps.hasPermission('system:role:insert')") - @ApiOperation("新增商城角色") - @PostMapping("/insertMallRole") - public R insertMallRole(@RequestBody @Validated MallRoleBo bo) { - roleBrandService.insertMallRole(bo); - return R.ok(); - } - - /** - * @Description: 获取系统菜单树列表 - * @return: R> - * @Author: DB - * @Date: 2023/5/10 14:39 - **/ - @ApiOperation("获取菜单树列表") - @GetMapping("/getSysMenuTreeList") - public R> getSysMenuTreeList() { - List list = menuService.getSysMenuTreeList(new MenuListBo()); - //过滤掉没有权限的数据 - return R.ok(list); - } - - /** - * @descriptions 修改角色 - * @author DB - * @date 2023/09/10 17:45 - * @param bo 请求参数 - * @return com.jambox.core.base.R - */ - @PreAuthorize("@aps.hasPermission('system:role:update')") - @ApiOperation("修改商城角色") - @PutMapping("/updateMallRole") - public R updateMallRole(@RequestBody @Validated MallRoleBo bo) { - roleBrandService.updateMallRole(bo); - return R.ok(); - } - - /** - * @Description: 删除商城角色 - * @param id 主键 - * @return R - * @Author DB - * @Date: 2023/10/19 22:34 - */ - @PreAuthorize("@aps.hasPermission('system:role:remove')") - @ApiOperation("删除商城角色") - @DeleteMapping("/removeMallRole/{id}") - public R removeMallRole(@PathVariable("id") String id) { - roleBrandService.removeMallRole(id); - return R.ok(); - } - - /** - * @Description: 设置角色状态 - * @param bo 请求参数 - * @return: R - * @Author: DB - * @Date: 2023/5/9 14:13 - **/ - @PreAuthorize("@aps.hasPermission('system:role:update')") - @ApiOperation("设置商城角色状态") - @PutMapping("/setMallRoleStatus") - public R setMallRoleStatus(@RequestBody @Validated RoleStatusBo bo) { - roleBrandService.setMallRoleStatus(bo); - return R.ok(); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderController.java deleted file mode 100644 index c01c6d5..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.mall.business.bo.LogisticsOrderBo; -import com.cpop.mall.business.bo.OrderPageBo; -import com.cpop.mall.business.service.OrderService; -import com.cpop.mall.business.vo.OrderPageVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; - -/** - * 商城订单表 控制层。 - * - * @author DB - * @since 2023-10-24 - */ -@RestController -@Api(tags = "商城后台订单管理模块") -@RequestMapping("/backstage/order") -public class BackstageOrderController { - - @Autowired - private OrderService orderService; - - /** - * @descriptions 分页查询商城-订单 - * @author DB - * @date 2023/10/23 11:56 - * @param bo 分页参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getOrderPage") - @ApiOperation("分页查询商城-订单") - public R> getProductPage(@ApiParam("分页参数") OrderPageBo bo) { - Page page = orderService.getOrderPage(bo); - return R.ok(page); - } - - /** - * @descriptions 输入物流订单 - * @author DB - * @date 2023/10/12 10:48 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @ApiOperation("输入物流订单") - @PostMapping("/inputLogisticsOrder") - public R inputLogisticsOrder(@RequestBody @Validated LogisticsOrderBo bo) { - orderService.inputLogisticsOrder(bo); - return R.ok(); - } - - /** - * @Description: 转变订单状态 - * @param id 订单id - * @param orderStatus 订单状态 - * @return R - * @Author DB - * @Date: 2023/10/28 15:49 - */ - @PutMapping("/changeOrderStatus") - @ApiOperation("转变订单状态") - public R changeOrderStatus(@RequestParam("id") @ApiParam(value = "订单id",required = true) String id, - @RequestParam("orderStatus") @ApiParam(value = "订单状态") Integer orderStatus) { - orderService.updateChain() - .setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS) - .set(ORDER.ORDER_STATUS, orderStatus + 1) - .where(ORDER.ID.eq(id)).update(); - return R.ok(); - } - - /** - * @descriptions 后台确定订单完成 - * @author DB - * @date 2023/11/07 9:37 - * @param id 订单id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/orderFinish") - @ApiOperation("后台确定订单完成") - public R orderFinish(@RequestParam("id") @ApiParam(value = "订单id",required = true) String id) { - orderService.orderFinish(id); - return R.ok(); - } - - /** - * @Description: 删除订单 - * @param id 主键 - * @return R - * @Author DB - * @Date: 2023/10/28 16:20 - */ - @ApiOperation("删除订单") - @DeleteMapping("/removeOrderById/{id}") - public R removeOrderById(@PathVariable String id) { - orderService.removeById(id); - return R.ok(); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java deleted file mode 100644 index 1b0225d..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageOrderRefundController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.mall.business.bo.OrderRefundPageBo; -import com.cpop.mall.business.bo.OrderRejectRefundBo; -import com.cpop.mall.business.service.OrderRefundService; -import com.cpop.mall.business.vo.OrderRefundPageVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * 商城订单退款记录表 控制层。 - * - * @author DB - * @since 2023-10-24 - */ -@RestController -@Api(tags = "商城订单退款记录表接口") -@RequestMapping("/backstage/orderRefund") -public class BackstageOrderRefundController { - - @Autowired - private OrderRefundService orderRefundService; - - /** - * @descriptions 商城退款列表 - * @author DB - * @date 2023/10/27 17:33 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getOrderRefundPage") - @ApiOperation("分页查询商城-退款列表") - public R> getOrderRefundPage(@ApiParam("分页参数") OrderRefundPageBo bo) { - Page page = orderRefundService.getOrderRefundPage(bo); - return R.ok(page); - } - - /** - * @descriptions 同意退款 - * @author DB - * @date 2023/10/23 12:15 - * @param id 订单id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/agreeRefund/{id}") - @ApiOperation("同意退款") - public R agreeRefund(@PathVariable("id") String id) { - orderRefundService.agreeRefund(id); - return R.ok(); - } - - /** - * @descriptions 拒绝退款 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/rejectRefund") - @ApiOperation("拒绝退款") - public R rejectRefund(@RequestBody @Validated OrderRejectRefundBo bo) { - orderRefundService.rejectRefund(bo); - return R.ok(); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java deleted file mode 100644 index ea41507..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageProductController.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.bo.ProductBo; -import com.cpop.mall.business.bo.ProductPageBo; -import com.cpop.mall.business.service.ProductRecordService; -import com.cpop.mall.business.service.ProductService; -import com.cpop.mall.business.service.ProductSpecificationService; -import com.cpop.mall.framework.task.ShoppingCartAsyncTask; -import com.cpop.mall.business.vo.JamboxCardTemplateListVo; -import com.cpop.mall.business.vo.ProductInfoVo; -import com.cpop.mall.business.vo.ProductPageVo; -import com.cpop.mall.business.vo.StoreListVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ProductSpecificationTableDef.PRODUCT_SPECIFICATION; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; - -/** - * 商城-商品表 控制层。 - * - * @author DB - * @since 2023-10-23 - */ -@RestController -@Api(tags = "商城-商品管理") -@RequestMapping("/backstage/product") -public class BackstageProductController { - - @Autowired - private ProductService productService; - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:56 - * @param bo 分页参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getProductPage") - @ApiOperation("分页查询商城-商品") - public R> getProductPage(@ApiParam("分页参数") ProductPageBo bo) { - Page page = productService.getProductPage(bo); - return R.ok(page); - } - - /** - * @descriptions 查询商城-商品详情 - * @author DB - * @date 2023/11/09 11:00 - * @param id 主键 - * @return: com.cpop.core.base.entity.R - */ - @GetMapping("/getProductInfo/{id}") - @ApiOperation("查询商城-商品详情") - public R getProductInfo(@PathVariable @ApiParam("主键") String id) { - ProductInfoVo info = productService.getProductInfo(id); - return R.ok(info); - } - - /** - * @descriptions 选择品牌下的店铺/校区 - * @author DB - * @date 2023/10/23 11:56 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getStoreList") - @ApiOperation("选择品牌下的店铺/校区") - public R> getStoreList() { - List list = productService.getStoreList(); - return R.ok(list); - } - - /** - * @descriptions 获取果酱课卡模板 - * @author DB - * @date 2023/10/23 11:56 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getJamboxCardTemplate") - @ApiOperation("获取果酱课卡模板") - public R> getJamboxCardTemplate() { - List list = productService.getJamboxCardTemplate(); - return R.ok(list); - } - - /** - * @descriptions 创建规格 - * @author DB - * @date 2023/10/23 12:15 - * @param specificationGroups 规格集合 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/createSpecification") - @ApiOperation("创建规格") - public R> createSpecification(@RequestBody @ApiParam("规格集合") List> specificationGroups) { - List list = productService.createSpecification(specificationGroups); - return R.ok(list); - } - - /** - * @descriptions 保存商城-商品 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 商城-商品 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/insertProduct") - @ApiOperation("保存商城-商品") - public R insertProduct(@RequestBody @Validated @ApiParam("商城-商品") ProductBo bo) { - productService.insertProduct(bo); - return R.ok(); - } - - /** - * @descriptions 根据主键重置商城商品 - * @author DB - * @date 2023/10/23 12:15 - * @param id 商城-商品id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/resetProduct/{id}") - @ApiOperation("根据主键重置商城商品") - public R update(@PathVariable("id") String id) { - productService.resetProduct(id); - return R.ok(); - } - - /** - * @descriptions 根据主键重置商城商品 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 商城-商品 - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/updateProduct") - @ApiOperation("根据主键更新商城-商品") - public R updateProduct(@RequestBody @Validated @ApiParam("商城-商品") ProductBo bo) { - productService.updateProduct(bo); - return R.ok(); - } - - /** - * 根据主键删除商城-商品表。 - * - * @param id 主键 - * @return {@code true} 删除成功,{@code false} 删除失败 - */ - @DeleteMapping("/removeById/{id}") - @ApiOperation("根据主键删除商城-商品") - @Transactional(rollbackFor = Exception.class) - public R removeById(@PathVariable("id") @ApiParam("商城-商品主键") String id) { - productService.removeById(id); - //删规格 - ProductSpecificationService productSpecificationService = SpringUtils.getBean(ProductSpecificationService.class); - productSpecificationService.updateChain().where(PRODUCT_SPECIFICATION.PRODUCT_ID.eq(id)).remove(); - //删商品记录详情 - ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class); - specificationRecordService.updateChain().where(PRODUCT_RECORD.PRODUCT_ID.eq(id)).remove(); - //删除购物车 - SpringUtils.getBean(ShoppingCartAsyncTask.class).asyncRemoveShoppingCart(id); - return R.ok(); - } - - /** - * @descriptions 商城商品上架 - * @author DB - * @date 2023/10/23 12:15 - * @param productId 商城-商品id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/productUpOrDown") - @ApiOperation("商城商品上下架") - public R productUpOrDown(@RequestParam("productId") @ApiParam(value = "商城-商品Id",required = true) String productId) { - productService.updateChain().setRaw(PRODUCT.IS_UP, "if(is_up = 0, 1, 0)").where(PRODUCT.ID.eq(productId)).update(); - return R.ok(); - } - - /** - * @descriptions 商城商品置顶 - * @author DB - * @date 2023/10/23 12:15 - * @param productId 商城-商品id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/productIsTop") - @ApiOperation("商城商品置顶") - public R productIsTop(@RequestParam("productId") @ApiParam(value = "商城-商品Id",required = true) String productId) { - productService.updateChain().setRaw(PRODUCT.IS_TOP, "if(is_top = 0, 1, 0)").where(PRODUCT.ID.eq(productId)).update(); - return R.ok(); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageStaffController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageStaffController.java deleted file mode 100644 index fff137b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/backstage/BackstageStaffController.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.cpop.mall.business.controller.backstage; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.constant.Constants; -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.bo.ModifyUserPasswordBo; -import com.cpop.mall.business.bo.StaffBo; -import com.cpop.mall.business.bo.StaffPageBo; -import com.cpop.mall.business.entity.RoleBrand; -import com.cpop.mall.business.service.RoleBrandService; -import com.cpop.mall.business.vo.BrandListVo; -import com.cpop.mall.business.vo.StaffInfoVo; -import com.cpop.mall.business.vo.StaffPageVo; -import com.cpop.system.business.service.BrandService; -import com.cpop.system.business.vo.RoleVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.mall.business.service.StaffService; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import java.util.List; - -import static com.cpop.mall.business.entity.table.RoleBrandTableDef.ROLE_BRAND; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.RoleTableDef.ROLE; - -/** - * 员工表 控制层。 - * - * @author DB - * @since 2023-10-19 - */ -@RestController -@Api(tags = "商城员工接口") -@RequestMapping("/backstage/mallStaff") -public class BackstageStaffController { - - @Autowired - private StaffService staffService; - - @Autowired - private BrandService brandService; - - /** - * @descriptions 查询员工分页列表 - * @author DB - * @date 2023/09/07 18:07 - * @param bo 请求参数 - * @return R> - */ - @PreAuthorize("@aps.hasPermission('system:account:list')") - @ApiOperation("查询员工分页列表") - @GetMapping("/getStaffPageList") - public R> getStaffPageList(StaffPageBo bo) { - Page pageVo = staffService.getStaffPageList(bo); - return R.ok(pageVo); - } - - /** - * @descriptions 新增员工 - * @author DB - * @date 2023/09/08 14:04 - * @param bo 请求参数 - * @return com.jambox.core.base.R - */ - @PreAuthorize("@aps.hasPermission('system:account:insert')") - @ApiOperation("新增员工") - @PostMapping("/insertStaff") - public R insertStaff(@RequestBody @Validated StaffBo bo) { - staffService.insertStaff(bo); - return R.ok(); - } - - /** - * @descriptions 修改员工 - * @author DB - * @date 2023/09/08 15:20 - * @param bo 请求参数 - * @return com.jambox.core.base.R - */ - @PreAuthorize("@aps.hasPermission('system:account:update')") - @ApiOperation("修改员工") - @PutMapping("/updateStaff") - public R updateStaff(@RequestBody @Validated StaffBo bo) { - staffService.updateStaff(bo); - return R.ok(); - } - - /** - * @descriptions 删除员工 - * @author DB - * @date 2023/09/12 16:57 - * @param id 主键 - * @return com.jambox.core.base.R - */ - @PreAuthorize("@aps.hasPermission('system:account:remove')") - @ApiOperation("删除员工") - @DeleteMapping("/removeStaffById/{id}") - public R removeStaffById(@PathVariable String id) { - staffService.removeStaffById(id); - return R.ok(); - } - - /** - * 获取所有角色信息 - */ - @ApiOperation("获取所有角色信息") - @GetMapping("/getAllRoleList") - public R> getAllSysRoleList() { - //获取当前登陆用户所在品牌 - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - String roleBrandId = loginStaffInfo.getString("roleBrandId"); - RoleBrandService roleBrandService = SpringUtils.getBean(RoleBrandService.class); - RoleBrand roleBrand = roleBrandService.getById(roleBrandId); - List list = roleBrandService.listAs(QueryWrapper.create() - .from(ROLE_BRAND) - .leftJoin(ROLE).on(ROLE.ID.eq(ROLE_BRAND.ROLE_ID)) - .where(ROLE.STATUS.eq(true)) - .and(ROLE_BRAND.BRAND_ID.eq(roleBrand.getBrandId())) - .and(ROLE.ROLE_VALUE.ne(Constants.SUPER_ADMIN_VALUE)) - .orderBy(ROLE.ORDER_NO.asc()) - , RoleVo.class); - return R.ok(list); - } - - /** - * @Description: 用户名是否存在 - * @param username 用户名 - * @param id 主键 - * @return: R - * @Author: DB - * @Date: 2023/5/11 10:09 - **/ - @ApiOperation("用户名是否存在") - @GetMapping("/isAccountExist") - public R isAccountExist(@ApiParam("用户名") String username, @ApiParam("userId") String id) { - staffService.isAccountExist(username, id); - return R.ok(); - } - - /** - * @Description: 获取员工信息 - * @param id 主键 - * @return: R - * @Author: DB - * @Date: 2023/5/17 10:33 - **/ - @PreAuthorize("@aps.hasPermission('system:account:info')") - @ApiOperation("获取员工信息") - @GetMapping("/getStaffInfo/{id}") - public R getStaffInfo(@PathVariable String id) { - StaffInfoVo staffInfo = staffService.getStaffInfo(id); - return R.ok(staffInfo); - } - - /** - * @Description: 修改系统用户密码 - * @param bo 请求参数 - * @return: AjaxResult - * @Author: DB - * @Date: 2023/5/12 16:00 - **/ - @PreAuthorize("@aps.hasPermission('system:account:update')") - @ApiOperation("修改系统用户密码") - @PutMapping("/modifyUserPassword") - public R modifyUserPassword(@Validated @RequestBody ModifyUserPasswordBo bo) { - staffService.modifyUserPassword(bo); - return R.ok(); - } - - /** - * @descriptions 查询员工分页列表 - * @author DB - * @date 2023/09/07 18:07 - * @return R> - */ - @ApiOperation("查询品牌列表") - @GetMapping("/getBrandList") - public R> getBrandList(String query) { - List list = brandService.listAs(QueryWrapper.create().and(BRAND.BRAND_NAME.like(query)), BrandListVo.class); - return R.ok(list); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/CallbackWxPayController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/CallbackWxPayController.java deleted file mode 100644 index 44f8e90..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/CallbackWxPayController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.cpop.mall.business.controller.callback; - -import com.cpop.mall.business.service.OrderRefundService; -import com.cpop.mall.business.service.OrderService; -import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author DB - * @createTime 2023/10/27 15:57 - * @description - */ -@RestController -@RequestMapping("/callback/wxPay") -public class CallbackWxPayController { - - @Autowired - private OrderRefundService orderRefundService; - - @Autowired - private OrderService orderService; - - /** - * @descriptions 微信支付订单通知 - * @author DB - * @date 2023/10/27 16:04 - * @param xmlData 数据 - * @return: java.lang.String - */ - @PostMapping("/notify/order") - public String parseOrderNotifyResult(@RequestBody String xmlData){ - orderService.wxPayNotifyOrder(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * @descriptions 退款回调通知处理 - * @author DB - * @date 2023/10/27 18:21 - * @param xmlData 数据 - * @return: java.lang.String - */ - @PostMapping("/notify/refund") - public String parseRefundNotifyResult(@RequestBody String xmlData){ - orderRefundService.wxPayNotifyRefund(xmlData); - return WxPayNotifyResponse.success("成功"); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java deleted file mode 100644 index 9894b3f..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/callback/WxPayCallbackController.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.cpop.mall.business.controller.callback; - -import com.cpop.mall.business.service.OrderRefundService; -import com.cpop.mall.business.service.OrderService; -import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author DB - * @createTime 2023/10/27 15:57 - * @description - */ -@RestController -@RequestMapping("/wxPay/callback") -@Deprecated -public class WxPayCallbackController { - - @Autowired - private OrderRefundService orderRefundService; - - @Autowired - private OrderService orderService; - - /** - * @descriptions 微信支付订单通知 - * @author DB - * @date 2023/10/27 16:04 - * @param xmlData 数据 - * @return: java.lang.String - */ - @PostMapping("/notify/order") - public String parseOrderNotifyResult(@RequestBody String xmlData){ - orderService.wxPayNotifyOrder(xmlData); - return WxPayNotifyResponse.success("成功"); - } - - /** - * @descriptions 退款回调通知处理 - * @author DB - * @date 2023/10/27 18:21 - * @param xmlData 数据 - * @return: java.lang.String - */ - @PostMapping("/notify/refund") - public String parseRefundNotifyResult(@RequestBody String xmlData){ - orderRefundService.wxPayNotifyRefund(xmlData); - return WxPayNotifyResponse.success("成功"); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniBrandController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniBrandController.java deleted file mode 100644 index 8230ab2..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniBrandController.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.cpop.mall.business.controller.mini; - -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.service.BrandExtendService; -import com.cpop.mall.business.service.StaffService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -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 static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.mall.business.entity.table.RoleBrandTableDef.ROLE_BRAND; -import static com.cpop.mall.business.entity.table.StaffTableDef.STAFF; - -/** - * @author DB - * @createTime 2023/11/01 16:36 - * @description - */ -@RestController -@Api(tags = "小程序商城-品牌相关接口") -@RequestMapping("/mini/brand") -public class MiniBrandController { - - @Autowired - private BrandExtendService brandExtendService; - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:56 - * @param cloudBrandId 云品牌id - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/jamboxBrandIsInMall/{cloudBrandId}") - @ApiOperation("小程序-果酱品牌是否在商城内") - public R jamboxBrandIsInMall(@PathVariable String cloudBrandId) { - BrandExtend brandExtend = brandExtendService.queryChain().where(BRAND_EXTEND.BRAND_CLOUD_ID.eq(cloudBrandId)).one(); - if (brandExtend == null) { - return R.ok(false); - } - long count = SpringUtils.getBean(StaffService.class).queryChain() - .leftJoin(ROLE_BRAND).on(ROLE_BRAND.ID.eq(STAFF.ROLE_BRAND_ID)) - .where(ROLE_BRAND.BRAND_ID.eq(brandExtend.getBrandId())).count(); - return R.ok(count > 0); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java deleted file mode 100644 index 95872d6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniOrderController.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.cpop.mall.business.controller.mini; - -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.bo.*; -import com.cpop.mall.business.entity.OrderEvaluate; -import com.cpop.mall.business.service.OrderEvaluateService; -import com.cpop.mall.business.service.OrderService; -import com.cpop.mall.business.vo.OrderInfoVo; -import com.cpop.mall.business.vo.OrderPageVo; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; - -/** - * @author DB - * @createTime 2023/10/25 9:19 - * @description - */ -@RestController -@Api(tags = "小程序商城-订单管理") -@RequestMapping("/mini/order") -public class MiniOrderController { - - @Autowired - private OrderService orderService; - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:56 - * @param bo 分页参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getOrderPage") - @ApiOperation("小程序-我的订单列表") - public R> getOrderPage(@ApiParam("分页参数") OrderPageBo bo) { - Page page = orderService.getOrderPage(bo); - return R.ok(page); - } - - /** - * @descriptions 生成预订单 - * @author DB - * @date 2023/11/06 11:12 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/createAdvanceOrder") - @ApiOperation("商城-订单-生成预订单") - public R createAdvanceOrder(@RequestBody @Validated @ApiParam("商城-预订单参数") AdvanceOrderBo bo) { - return R.ok(orderService.createAdvanceOrder(bo)); - } - - /** - * @descriptions 商城-订单-下单 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 下单请求对象 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/placeOrder") - @ApiOperation("商城-订单-下单") - public R placeOrder(@RequestBody @Validated @ApiParam("商城-订单") PlaceOrderBo bo) { - return R.ok(orderService.placeOrder(bo)); - } - - /** - * @param bo 评价订单对象 - * @descriptions 评价订单 - * @author DB - * @date 2023/10/23 12:15 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/orderEvaluate") - @ApiOperation("评价订单") - @Transactional(rollbackFor = Exception.class) - public R orderEvaluate(@RequestBody @Validated @ApiParam("评价订单对象") OrderEvaluateBo bo) { - SpringUtils.getBean(OrderEvaluateService.class).save(BeanUtils.mapToClass(bo, OrderEvaluate.class)); - //修改订单 - orderService.updateChain().set(ORDER.HAVE_EVALUATE, true).where(ORDER.ID.eq(bo.getOrderId())).update(); - return R.ok(); - } - - /** - * @descriptions 申请退款 - * @author DB - * @date 2023/10/26 17:22 - * @param bo 申请退款对象 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/applyRefund") - @ApiOperation("申请退款") - @Transactional(rollbackFor = Exception.class) - public R applyRefund(@RequestBody @Validated @ApiParam("申请退款对象") OrderApplyRefundBo bo) { - orderService.applyRefund(bo); - return R.ok(); - } - - /** - * @descriptions 取消订单 - * @author DB - * @date 2023/10/27 17:16 - * @param orderId 商城-订单Id - * @return: com.cpop.core.base.entity.R - */ - @PutMapping("/cancelOrder") - @ApiOperation("取消订单") - public R cancelOrder(@RequestParam("orderId") @ApiParam("商城-订单Id") String orderId) { - orderService.cancelOrder(orderId); - return R.ok(); - } - - /** - * @descriptions 小程序-重新支付订单 - * @author DB - * @date 2023/11/03 15:53 - * @param orderId 订单id - * @return: com.cpop.core.base.entity.R> - */ - @Deprecated - @PutMapping("/rePayOrder/{orderId}") - @ApiOperation("小程序-重新支付订单") - public R rePayOrder(@PathVariable @ApiParam(value = "订单id", required = true) String orderId) { - return R.ok(orderService.rePayOrder(orderId)); - } - - /** - * @descriptions 小程序-获取订单详情 - * @author DB - * @date 2023/11/06 14:25 - * @param orderId 订单id - * @return: com.cpop.core.base.entity.R - */ - @GetMapping("/getOrderInfo/{orderId}") - @ApiOperation("小程序-获取订单详情") - public R getOrderInfo(@PathVariable @ApiParam(value = "订单id", required = true) String orderId) { - return R.ok(orderService.getOrderInfo(orderId)); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniProductController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniProductController.java deleted file mode 100644 index 86a81d6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniProductController.java +++ /dev/null @@ -1,141 +0,0 @@ -package com.cpop.mall.business.controller.mini; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.R; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.bo.ProductPageBo; -import com.cpop.mall.business.service.CarouselService; -import com.cpop.mall.business.service.ProductService; -import com.cpop.mall.business.vo.*; -import com.cpop.system.business.entity.Store; -import com.cpop.system.business.service.StoreService; -import com.mybatisflex.core.paginate.Page; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.Arrays; -import java.util.List; - -import static com.cpop.mall.business.entity.table.CarouselTableDef.CAROUSEL; - -/** - * 商城-商品表 控制层。 - * - * @author DB - * @since 2023-10-23 - */ -@RestController -@Api(tags = "小程序商城-商品管理") -@RequestMapping("/mini/product") -public class MiniProductController { - - @Autowired - private ProductService productService; - - @Autowired - private CarouselService carouselService; - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:56 - * @param bo 分页参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getMiniProductPage") - @ApiOperation("分页查询商城-商品") - public R> getMiniProductPage(@ApiParam("分页参数") ProductPageBo bo) { - Page page = productService.getMiniProductPage(bo); - return R.ok(page); - } - - /** - * @descriptions 查询商城同类型随机商品 - * @author DB - * @date 2023/11/13 16:24 - * @param productType 商品类型 - * @param id id - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getSameTypeRandomProduct") - @ApiOperation("查询商城同类型随机商品") - public R> getSameTypeRandomProduct(@RequestParam("productType") @ApiParam(value = "商品类型", required = true) Integer productType, @RequestParam("id") @ApiParam(value = "商品id", required = true) String id) { - Page page = productService.getSameTypeRandomProduct(id, productType); - return R.ok(page); - } - - /** - * @descriptions 下单需要选择店铺/校区 - * @author DB - * @date 2023/10/23 11:56 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getStoreList") - @ApiOperation("下单需要选择店铺/校区") - public R> getStoreList() { - List list = productService.getStoreList(); - return R.ok(list); - } - - /** - * @descriptions 查询商品评价分页列表 - * @author DB - * @date 2023/10/23 11:56 - * @param productId 商品id - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getOrderEvaluatePage/{productId}") - @ApiOperation("查询商品评价分页列表") - public R> getOrderEvaluatePage(@PathVariable @ApiParam("商品id") String productId) { - Page page = productService.getOrderEvaluatePage(productId); - return R.ok(page); - } - - /** - * @descriptions 根据校区ids获取校区信息 - * @author DB - * @date 2023/11/02 17:11 - * @param storeIds 校区id列表 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getStoreByIds") - @ApiOperation("根据校区ids获取校区信息") - public R> getMiniProductPage(@RequestParam("storeIds") String storeIds) { - List stores = SpringUtils.getBean(StoreService.class).listByIds(Arrays.asList(storeIds.split(","))); - List list = BeanUtils.mapToList(stores, StoreListVo.class); - return R.ok(list); - } - - /** - * @descriptions 获取商品详情 - * @author DB - * @date 2023/11/06 11:55 - * @param id 商品id - * @return: com.cpop.core.base.entity.R - */ - @GetMapping("/getProductInfo/{id}") - @ApiOperation("获取商品详情") - public R getProductInfo(@PathVariable("id") @ApiParam(value = "商品id", required = true) String id) { - ProductInfoVo info = productService.getProductInfo(id); - return R.ok(info); - } - - /** - * 获取商城轮播图 - * @author DB - * @since 2024/1/15 - * @return R> - */ - @GetMapping("/getCarouselList") - @ApiOperation("获取商城轮播图") - public R> getCarouselList() { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - List vos = carouselService.queryChain().where(CAROUSEL.BRAND_ID.eq(loginUserInfo.getString("brandId")) - .and(CAROUSEL.UP_STATUS.eq(true))).orderBy(CAROUSEL.ORDER_NO.asc()).listAs(CarouselListVo.class); - return R.ok(vos); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniShoppingCartController.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniShoppingCartController.java deleted file mode 100644 index 0f755f8..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/controller/mini/MiniShoppingCartController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cpop.mall.business.controller.mini; - -import com.cpop.core.base.entity.R; -import com.cpop.mall.business.bo.ShoppingCartBo; -import com.cpop.mall.business.bo.ShoppingCartPageBo; -import com.cpop.mall.business.vo.MiniShoppingCartPageVo; -import com.mybatisflex.core.paginate.Page; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import com.cpop.mall.business.service.ShoppingCartService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -import java.util.Arrays; - -/** - * 商城购物车表 控制层。 - * - * @author DB - * @since 2023-11-06 - */ -@RestController -@Api(tags = "小程序-商城购物车接口") -@RequestMapping("/mini/shoppingCart") -public class MiniShoppingCartController { - - @Autowired - private ShoppingCartService shoppingCartService; - - /** - * @descriptions 分页查询小程序-商城-购物车分页 - * @author DB - * @date 2023/11/06 14:10 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R> - */ - @GetMapping("/getMiniShoppingCartPage") - @ApiOperation("分页查询小程序-商城-购物车分页") - public R> getMiniShoppingCartPage(@ApiParam("分页参数") ShoppingCartPageBo bo) { - Page page = shoppingCartService.getMiniShoppingCartPage(bo); - return R.ok(page); - } - - /** - * @descriptions 小程序-商城-购物车添加商品 - * @author DB - * @date 2023/11/06 14:14 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @PostMapping("/insertShoppingCart") - @ApiOperation("小程序-商城-购物车添加商品") - public R insertShoppingCart(@RequestBody @Validated @ApiParam("商城-购物车新增参数") ShoppingCartBo bo) { - shoppingCartService.insertShoppingCart(bo); - return R.ok(); - } - - /** - * @descriptions 小程序-商城-购物车删除商 - * @author DB - * @date 2023/11/06 14:14 - * @param ids 主键 - * @return: com.cpop.core.base.entity.R - */ - @DeleteMapping("/removeShoppingCart") - @ApiOperation("小程序-商城-购物车删除商品") - public R removeShoppingCart(@RequestParam("ids") @ApiParam("商城-购物车新增参数") String[] ids) { - shoppingCartService.removeByIds(Arrays.asList(ids)); - return R.ok(); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/ProductAndRecordDto.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/ProductAndRecordDto.java deleted file mode 100644 index daa01a5..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/ProductAndRecordDto.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.cpop.mall.business.dto; - -import com.mybatisflex.annotation.Id; -import lombok.Data; - -/** - * @author DB - * @createTime 2023/11/03 12:56 - * @description - */ -@Data -public class ProductAndRecordDto { - - /** - * 主键 - */ - private String id; - - /** - * 商品名 - */ - private String productName; - - /** - * 产品描述 - */ - private String description; - - /** - * 产品记录id - */ - private String productRecordId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/UserPointDto.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/UserPointDto.java deleted file mode 100644 index 966158d..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/dto/UserPointDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cpop.mall.business.dto; - -import lombok.Data; - -/** - * @author DB - * @createTime 2023/11/10 16:33 - * @description - */ -@Data -public class UserPointDto { - - /** - * 总积分 - */ - private Integer totalPoint; - - /** - * 云品牌id - */ - private String brandCloudId; - - /** - * 旧用户id - */ - private String oldUserId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Carousel.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Carousel.java deleted file mode 100644 index 1a9f4e2..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Carousel.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城轮播图 实体类。 - * - * @author DB - * @since 2024-01-15 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_carousel", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Carousel extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 产品id - */ - @Id - private String productId; - - /** - * 品牌id - */ - @Id - private String brandId; - - /** - * 图片地址 - */ - private String picUrl; - - /** - * 排序 - */ - private Integer orderNo; - - /** - * 上架状态(0:下架;1:上架) - */ - private Boolean upStatus; - - - - - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Order.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Order.java deleted file mode 100644 index b1e1cfc..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Order.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * 商城订单表 实体类。 - * - * @author DB - * @since 2023-10-24 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_order", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Order extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中:5:订单取消;6:过期) - */ - private Integer orderStatus; - - /** - * 上一个状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中:5:订单取消;6:过期) - */ - private Integer previousStatus; - - /** - * 外部订单号 - */ - private String outOrderNo; - - /** - * 总金额 - */ - private BigDecimal totalAmount; - - /** - * 总积分 - */ - private Long totalPoint; - - /** - * 品牌id - */ - private String brandId; - - /** - * 模板id - */ - private String templateId; - - /** - * 产品名 - */ - private String productNames; - - /** - * 下单用户id - */ - private String payUserId; - - /** - * 下单人真实姓名 - */ - private String payUserName; - - /** - * 收货人名 - */ - private String receiveName; - - /** - * 收货人电话 - */ - private String receivePhone; - - /** - * 收货地址 - */ - private String receiveAddress; - - /** - * 物流订单号 - */ - private String logisticsOrder; - - /** - * 支付方式(0:微信支付;1:积分支付) - */ - private Integer payType; - - /** - * 备注 - */ - private String remarks; - - /** - * 是否评价(0否1是) - */ - private String haveEvaluate; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderDetail.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderDetail.java deleted file mode 100644 index 423a4b2..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderDetail.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * 商城订单详情表 实体类。 - * - * @author DB - * @since 2023-10-24 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_order_detail", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class OrderDetail extends BaseEntity implements Serializable { - - /** - * 订单id - */ - @Id - private String orderId; - - /** - * 商品记录id - */ - @Id - private String productRecordId; - - /** - * 金额 - */ - private BigDecimal amount; - - /** - * 积分 - */ - private Integer point; - - /** - * 下单数量 - */ - private Integer number; - - /** - * 店铺(校区)id - */ - private String storeId; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderEvaluate.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderEvaluate.java deleted file mode 100644 index 7e5f0e1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderEvaluate.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城-订单评价表 实体类。 - * - * @author DB - * @since 2023-10-26 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_order_evaluate", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class OrderEvaluate extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 产品id - */ - private String productId; - - /** - * 订单id - */ - private String orderId; - - /** - * 评价 - */ - private String evaluate; - - /** - * 星 - */ - private Double start; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderRefund.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderRefund.java deleted file mode 100644 index 7baac58..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/OrderRefund.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城订单退款记录表 实体类。 - * - * @author DB - * @since 2023-10-24 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_order_refund", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class OrderRefund extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 订单id - */ - private String orderId; - - /** - * 外部退款订单号 - */ - private String outRefundId; - - /** - * 退款状态(0:申请中;1:通过;2:驳回) - */ - private Integer refundStatus; - - /** - * 退款原因 - */ - private String refundReason; - - /** - * 拒绝原因 - */ - private String rejectReason; - - /** - * openId - */ - private String openId; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Product.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Product.java deleted file mode 100644 index 700e2c1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Product.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城-商品表 实体类。 - * - * @author DB - * @since 2023-10-23 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_product", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Product extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 商品名 - */ - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他) - */ - private Integer productType; - - /** - * 品牌id - */ - private String brandId; - - /** - * 商店(校区)集合 - */ - private String storeIds; - - /** - * 描述 - */ - private String description; - - /** - * 商品图地址 - */ - private String picUrl; - - /** - * 商品详情图地址 - */ - private String picDetailUrl; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - private Integer buyRestrict; - - /** - * 限购数量 - */ - private Integer limitNum; - - /** - * 支付方式(0:微信支付;1:积分支付) - */ - private Integer payType; - - /** - * 上下架 - */ - private Boolean isUp; - - /** - * 是否置顶 - */ - private Boolean isTop; - - /** - * 最高价/最高消耗积分 消费 - */ - private BigDecimal maxConsume; - - /** - * 最低价/最低消耗积分 - */ - private BigDecimal minConsume; - - /** - * 课卡模板id - */ - private String cardTemplateId; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductOut.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductOut.java deleted file mode 100644 index 8ba8625..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductOut.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城-商品外部拓展表 实体类。 - * - * @author DB - * @since 2023-10-26 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_product_out", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class ProductOut extends BaseEntity implements Serializable { - - /** - * 商品id - */ - private String productId; - - /** - * 外部关联id - */ - private String outJoinId; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductRecord.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductRecord.java deleted file mode 100644 index 80f8bf0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductRecord.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.math.BigDecimal; - -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城-商品-规格记录 实体类。 - * - * @author DB - * @since 2023-10-23 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_product_record", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class ProductRecord extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 商品id - */ - private String productId; - - /** - * 规格集合 - */ - private String recordNames; - - /** - * 数量(库存) - */ - private Integer recordNum; - - /** - * 记录消耗金额 - */ - private BigDecimal recordPrice; - - /** - * 记录消耗积分 - */ - private Integer recordPoints; - - /** - * 乐观锁标识 - */ - @Column(version = true) - private Integer version; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductSpecification.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductSpecification.java deleted file mode 100644 index 35b4f55..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ProductSpecification.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商城-商品-规格 实体类。 - * - * @author DB - * @since 2023-10-23 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_product_specification", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class ProductSpecification extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 产品id - */ - private String productId; - - /** - * 规格名 - */ - private String specificationNames; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/RoleBrand.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/RoleBrand.java deleted file mode 100644 index a70575c..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/RoleBrand.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 商城-角色-品牌id 实体类。 - * - * @author DB - * @since 2023-10-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_role_brand", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class RoleBrand extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 角色id - */ - private String roleId; - - /** - * 品牌id - */ - private String brandId; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ShoppingCart.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ShoppingCart.java deleted file mode 100644 index d2d44bf..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/ShoppingCart.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 商城购物车表 实体类。 - * - * @author DB - * @since 2023-11-06 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_shopping_cart", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class ShoppingCart extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 用户id - */ - private String userId; - - /** - * 商品记录id - */ - private String productRecordId; - - /** - * 店铺/校区id - */ - private String storeId; - - /** - * 金额 - */ - private BigDecimal amount; - - /** - * 积分 - */ - private Integer point; - - /** - * 数量 - */ - private Integer number; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Staff.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Staff.java deleted file mode 100644 index d769ebd..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/entity/Staff.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.cpop.mall.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Column; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import java.io.Serializable; - -import lombok.*; -import lombok.experimental.Accessors; - -/** - * 员工表 实体类。 - * - * @author DB - * @since 2023-10-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mall_staff", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class Staff extends BaseEntity implements Serializable { - - /** - * 主键 - */ - @Id - private String id; - - /** - * 姓名 - */ - private String name; - - /** - * 用户id - */ - private String userId; - - /** - * 用户来源 - */ - private String sourceType; - - /** - * 角色-品牌-id - */ - private String roleBrandId; - - /** - * 逻辑删除(0否1是) - */ - @Column(isLogicDelete = true) - private Boolean isDelete; - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/CarouselMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/CarouselMapper.java deleted file mode 100644 index 17f1ed1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/CarouselMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.Carousel; - -/** - * 商城轮播图 映射层。 - * - * @author DB - * @since 2024-01-15 - */ -public interface CarouselMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderDetailMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderDetailMapper.java deleted file mode 100644 index 1429875..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderDetailMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.OrderDetail; - -/** - * 商城订单详情表 映射层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderDetailMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderEvaluateMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderEvaluateMapper.java deleted file mode 100644 index e34edf0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderEvaluateMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.OrderEvaluate; - -/** - * 商城-订单评价表 映射层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface OrderEvaluateMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderMapper.java deleted file mode 100644 index 179b523..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.Order; - -/** - * 商城订单表 映射层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderRefundMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderRefundMapper.java deleted file mode 100644 index c38d79f..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/OrderRefundMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.OrderRefund; - -/** - * 商城订单退款记录表 映射层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderRefundMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductMapper.java deleted file mode 100644 index e30a256..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.Product; - -/** - * 商城-商品表 映射层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductOutMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductOutMapper.java deleted file mode 100644 index deeea72..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductOutMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.ProductOut; - -/** - * 商城-商品外部拓展表 映射层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface ProductOutMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductRecordMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductRecordMapper.java deleted file mode 100644 index 4c46143..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductRecordMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.ProductRecord; - -/** - * 商城-商品-规格记录 映射层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductRecordMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductSpecificationMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductSpecificationMapper.java deleted file mode 100644 index de111fc..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ProductSpecificationMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.ProductSpecification; - -/** - * 商城-商品-规格 映射层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductSpecificationMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/RoleBrandMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/RoleBrandMapper.java deleted file mode 100644 index 2be8996..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/RoleBrandMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.RoleBrand; - -/** - * 商城-角色-品牌id 映射层。 - * - * @author DB - * @since 2023-10-19 - */ -public interface RoleBrandMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ShoppingCartMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ShoppingCartMapper.java deleted file mode 100644 index 3f28993..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/ShoppingCartMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.ShoppingCart; - -/** - * 商城购物车表 映射层。 - * - * @author DB - * @since 2023-11-06 - */ -public interface ShoppingCartMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/StaffMapper.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/StaffMapper.java deleted file mode 100644 index a0ebbcd..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/mapper/StaffMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mall.business.entity.Staff; - -/** - * 员工表 映射层。 - * - * @author DB - * @since 2023-10-19 - */ -public interface StaffMapper extends BaseMapper { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/CarouselService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/CarouselService.java deleted file mode 100644 index dedae33..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/CarouselService.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.CarouselBo; -import com.cpop.mall.business.vo.CarouselPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.Carousel; - -/** - * 商城轮播图 服务层。 - * - * @author DB - * @since 2024-01-15 - */ -public interface CarouselService extends IService { - - /** - * 分页查询商城轮播图 - * @author DB - * @since 2024/1/15 - * @param upStatus 上架状态 - * @return Page - */ - Page getCarouselPage(Boolean upStatus); - - /** - * 新增轮播图 - * @author DB - * @since 2024/1/15 - * @param bo 请求参数 - */ - void insertCarousel(CarouselBo bo); - - /** - * 修改轮播图 - * @author DB - * @since 2024/1/15 - * @param bo 请求参数 - */ - void updateCarousel(CarouselBo bo); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderDetailService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderDetailService.java deleted file mode 100644 index f67681b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderDetailService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.OrderDetail; - -/** - * 商城订单详情表 服务层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderDetailService extends IService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderEvaluateService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderEvaluateService.java deleted file mode 100644 index 2a7ca19..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderEvaluateService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.OrderEvaluate; - -/** - * 商城-订单评价表 服务层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface OrderEvaluateService extends IService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderRefundService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderRefundService.java deleted file mode 100644 index 6ed5ad3..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderRefundService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.OrderRefundPageBo; -import com.cpop.mall.business.bo.OrderRejectRefundBo; -import com.cpop.mall.business.vo.OrderRefundPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.OrderRefund; - -/** - * 商城订单退款记录表 服务层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderRefundService extends IService { - - /** - * @descriptions 同意退款 - * @author DB - * @date 2023/10/24 16:10 - * @param id 订单id - * @return: void - */ - void agreeRefund(String id); - - /** - * @descriptions 拒绝退款 - * @author DB - * @date 2023/10/24 16:13 - * @param bo 请求参数 - * @return: void - */ - void rejectRefund(OrderRejectRefundBo bo); - - /** - * @descriptions 商城退款列表 - * @author DB - * @date 2023/10/27 17:34 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getOrderRefundPage(OrderRefundPageBo bo); - - /** - * @descriptions 退款回调通知处理 - * @author DB - * @date 2023/10/27 18:22 - * @param xmlData 请求数据 - * @return: void - */ - void wxPayNotifyRefund(String xmlData); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderService.java deleted file mode 100644 index f5fab41..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/OrderService.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.cpop.mall.business.service; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.mall.business.bo.*; -import com.cpop.mall.business.dto.UserPointDto; -import com.cpop.mall.business.entity.Order; -import com.cpop.mall.business.vo.OrderInfoVo; -import com.cpop.mall.business.vo.OrderPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; - -/** - * 商城订单表 服务层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface OrderService extends IService { - - /** - * @descriptions 分页查询商城-订单 - * @author DB - * @date 2023/10/24 15:19 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getOrderPage(OrderPageBo bo); - - /** - * @descriptions 生成预订单 - * @author DB - * @date 2023/11/06 11:17 - * @param bo 请求参数 - * @return: java.lang.Object - */ - String createAdvanceOrder(AdvanceOrderBo bo); - - /** - * @descriptions 商城-订单-下单 - * @author DB - * @date 2023/10/25 9:32 - * @param bo 下单请求对象 - * @return: void - */ - Object placeOrder(PlaceOrderBo bo); - - /** - * @descriptions 申请退款 - * @author DB - * @date 2023/10/26 17:24 - * @param bo 申请退款对象 - * @return: void - */ - void applyRefund(OrderApplyRefundBo bo); - - /** - * @descriptions 微信支付订单通知 - * @author DB - * @date 2023/10/27 16:04 - * @param xmlData 加密数据 - * @return: void - */ - void wxPayNotifyOrder(String xmlData); - - /** - * @descriptions 取消订单 - * @author DB - * @date 2023/10/27 17:17 - * @param orderId 订单id - * @return: void - */ - void cancelOrder(String orderId); - - /** - * @Description: 输入物流订单 - * @param bo 请求参数 - * @Author DB - * @Date: 2023/10/28 15:27 - */ - void inputLogisticsOrder(LogisticsOrderBo bo); - - /** - * @descriptions 小程序-重新支付订单 - * @author DB - * @date 2023/11/03 16:14 - * @param orderId 订单id - * @return: java.lang.Object - */ - Object rePayOrder(String orderId); - - /** - * @descriptions 小程序-获取订单详情 - * @author DB - * @date 2023/11/06 14:26 - * @param orderId 订单id - * @return: com.cpop.mall.business.vo.OrderInfoVo - */ - OrderInfoVo getOrderInfo(String orderId); - - /** - * @descriptions 后台确定订单完成 - * @author DB - * @date 2023/11/13 17:42 - * @param id 主键 - * @return: void - */ - void orderFinish(String id); - - /** - * 获取用户积分 - * @param loginUserInfo - * @return - */ - UserPointDto getUserPoint(JSONObject loginUserInfo); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductOutService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductOutService.java deleted file mode 100644 index 3d1f1b0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductOutService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.ProductOut; - -/** - * 商城-商品外部拓展表 服务层。 - * - * @author DB - * @since 2023-10-26 - */ -public interface ProductOutService extends IService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductRecordService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductRecordService.java deleted file mode 100644 index b8a5631..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductRecordService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.ProductRecord; - -/** - * 商城-商品-规格记录 服务层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductRecordService extends IService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductService.java deleted file mode 100644 index ef669ac..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductService.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.ProductBo; -import com.cpop.mall.business.bo.ProductPageBo; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.vo.*; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; - -import java.util.List; - -/** - * 商城-商品表 服务层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductService extends IService { - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:59 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getProductPage(ProductPageBo bo); - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/27 13:41 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getMiniProductPage(ProductPageBo bo); - - /** - * @descriptions 创建规格 - * @author DB - * @date 2023/10/23 12:43 - * @param specificationGroups 请求参数 - * @return: java.util.List - */ - List createSpecification(List> specificationGroups); - - /** - * @descriptions 保存商城-商品 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 请求参数 - * @return: void - */ - void insertProduct(ProductBo bo); - - /** - * @descriptions 根据主键更新商城-商品 - * @author DB - * @date 2023/10/23 16:51 - * @param bo 请求参数 - * @return: void - */ - void updateProduct(ProductBo bo); - - /** - * @descriptions 根据主键重置商城商品 - * @author DB - * @date 2023/10/23 17:21 - * @param id - * @return: void - */ - void resetProduct(String id); - - /** - * @descriptions 获取果酱课卡模板 - * @author DB - * @date 2023/10/23 18:11 - * @param - * @return: java.util.List - */ - List getJamboxCardTemplate(); - - /** - * @descriptions 下单需要选择店铺/校区 - * @author DB - * @date 2023/10/26 15:34 - * @return: java.util.List - */ - List getStoreList(); - - /** - * @descriptions 查询商品评价分页列表 - * @author DB - * @date 2023/10/26 17:02 - * @param productId 商品id - * @return: com.mybatisflex.core.paginate.Page - */ - Page getOrderEvaluatePage(String productId); - - /** - * @descriptions 获取商品详情 - * @author DB - * @date 2023/11/06 11:56 - * @param id 商品id - * @return: com.cpop.mall.business.vo.ProductInfoVo - */ - ProductInfoVo getProductInfo(String id); - - /** - * @descriptions 查询商城同类型随机商品 - * @author DB - * @date 2023/11/13 16:24 - * @param id 主键 - * @param productType 商品类型 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getSameTypeRandomProduct(String id, Integer productType); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductSpecificationService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductSpecificationService.java deleted file mode 100644 index a7a9bb8..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ProductSpecificationService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mall.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.ProductSpecification; - -/** - * 商城-商品-规格 服务层。 - * - * @author DB - * @since 2023-10-23 - */ -public interface ProductSpecificationService extends IService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/RoleBrandService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/RoleBrandService.java deleted file mode 100644 index 7565e7d..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/RoleBrandService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.MallRoleBo; -import com.cpop.mall.business.bo.MallRolePageBo; -import com.cpop.mall.business.entity.RoleBrand; -import com.cpop.mall.business.vo.MallRolePageVo; -import com.cpop.system.business.bo.RoleStatusBo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; - -/** - * 商城-角色-品牌id 服务层。 - * - * @author DB - * @since 2023-10-19 - */ -public interface RoleBrandService extends IService { - - /** - * @descriptions 查询商城角色分页列表 - * @author DB - * @date 2023/09/10 16:51 - * @param bo 请求参数 - * @return R> - */ - Page getMallRolePageList(MallRolePageBo bo); - - /** - * @descriptions 新增角色 - * @author DB - * @date 2023/10/12 10:48 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - void insertMallRole(MallRoleBo bo); - - /** - * @descriptions 修改角色 - * @author DB - * @date 2023/09/10 17:45 - * @param bo 请求参数 - * @return com.jambox.core.base.R - */ - void updateMallRole(MallRoleBo bo); - - /** - * @Description: 删除商城角色 - * @param id 主键 - * @return - * @Author DB - * @Date: 2023/10/19 22:34 - */ - void removeMallRole(String id); - - /** - * @Description: 设置角色状态 - * @param bo 请求参数 - * @return: R - * @Author: DB - * @Date: 2023/5/9 14:13 - **/ - void setMallRoleStatus(RoleStatusBo bo); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ShoppingCartService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ShoppingCartService.java deleted file mode 100644 index 8d143a3..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/ShoppingCartService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.ShoppingCartBo; -import com.cpop.mall.business.bo.ShoppingCartPageBo; -import com.cpop.mall.business.vo.MiniShoppingCartPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.ShoppingCart; - -/** - * 商城购物车表 服务层。 - * - * @author DB - * @since 2023-11-06 - */ -public interface ShoppingCartService extends IService { - - /** - * @descriptions 分页查询小程序-商城-购物车分页 - * @author DB - * @date 2023/11/06 14:02 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getMiniShoppingCartPage(ShoppingCartPageBo bo); - - /** - * @descriptions 小程序-商城-购物车添加商品 - * @author DB - * @date 2023/11/06 14:17 - * @param bo 请求参数 - * @return: void - */ - void insertShoppingCart(ShoppingCartBo bo); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/StaffService.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/StaffService.java deleted file mode 100644 index 99b31b6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/StaffService.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.cpop.mall.business.service; - -import com.cpop.mall.business.bo.ModifyUserPasswordBo; -import com.cpop.mall.business.bo.StaffBo; -import com.cpop.mall.business.bo.StaffPageBo; -import com.cpop.mall.business.vo.StaffInfoVo; -import com.cpop.mall.business.vo.StaffPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.service.IService; -import com.cpop.mall.business.entity.Staff; - -/** - * 员工表 服务层。 - * - * @author DB - * @since 2023-10-19 - */ -public interface StaffService extends IService { - - /** - * @descriptions 查询员工分页列表 - * @author DB - * @date 2023/10/20 11:12 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - Page getStaffPageList(StaffPageBo bo); - - /** - * @descriptions 新增员工 - * @author DB - * @date 2023/10/20 11:24 - * @param bo 请求参数 - * @return: void - */ - void insertStaff(StaffBo bo); - - /** - * @descriptions 修改员工 - * @author DB - * @date 2023/10/20 11:36 - * @param bo 请求参数 - * @return: void - */ - void updateStaff(StaffBo bo); - - /** - * @descriptions 删除员工 - * @author DB - * @date 2023/10/20 11:44 - * @param id 主键 - * @return: void - */ - void removeStaffById(String id); - - /** - * @descriptions 用户名是否存在 - * @author DB - * @date 2023/10/20 11:55 - * @param username 用户名 - * @param id 主键 - * @return: void - */ - void isAccountExist(String username, String id); - - /** - * @descriptions 获取员工信息 - * @author DB - * @date 2023/10/20 12:00 - * @param id 主键 - * @return: com.cpop.mall.business.vo.StaffInfoVo - */ - StaffInfoVo getStaffInfo(String id); - - /** - * @descriptions 修改系统用户密码 - * @author DB - * @date 2023/10/20 12:04 - * @param bo 请求体 - * @return: void - */ - void modifyUserPassword(ModifyUserPasswordBo bo); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/CarouselServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/CarouselServiceImpl.java deleted file mode 100644 index b5debac..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/CarouselServiceImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SqlUtils; -import com.cpop.mall.business.bo.CarouselBo; -import com.cpop.mall.business.vo.CarouselPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.Carousel; -import com.cpop.mall.business.mapper.CarouselMapper; -import com.cpop.mall.business.service.CarouselService; -import org.springframework.stereotype.Service; - -import static com.cpop.mall.business.entity.table.CarouselTableDef.CAROUSEL; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; - -/** - * 商城轮播图 服务层实现。 - * - * @author DB - * @since 2024-01-15 - */ -@Service("carouselService") -public class CarouselServiceImpl extends ServiceImpl implements CarouselService { - - /** - * 分页查询商城轮播图 - * @author DB - * @since 2024/1/15 - * @param upStatus 上架状态 - * @return Page - */ - @Override - public Page getCarouselPage(Boolean upStatus) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), - QueryWrapper.create() - .select(CAROUSEL.ID,CAROUSEL.PRODUCT_ID,CAROUSEL.PIC_URL,CAROUSEL.ORDER_NO,CAROUSEL.UP_STATUS) - .select(PRODUCT.PRODUCT_NAME) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(CAROUSEL.PRODUCT_ID)) - .where(CAROUSEL.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .and(CAROUSEL.UP_STATUS.eq(upStatus)) - .orderBy(CAROUSEL.ORDER_NO.asc()), - CarouselPageVo.class); - } - - /** - * 新增轮播图 - * @author DB - * @since 2024/1/15 - * @param bo 请求参数 - */ - @Override - public void insertCarousel(CarouselBo bo) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - Carousel carousel = BeanUtils.mapToClass(bo, Carousel.class); - carousel.setBrandId(loginUserInfo.getString("brandId")); - this.save(carousel); - } - - /** - * 修改轮播图 - * @author DB - * @since 2024/1/15 - * @param bo 请求参数 - */ - @Override - public void updateCarousel(CarouselBo bo) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - Carousel carousel = BeanUtils.mapToClass(bo, Carousel.class); - carousel.setBrandId(loginUserInfo.getString("brandId")); - this.updateById(carousel); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderDetailServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderDetailServiceImpl.java deleted file mode 100644 index b058974..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderDetailServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.OrderDetail; -import com.cpop.mall.business.mapper.OrderDetailMapper; -import com.cpop.mall.business.service.OrderDetailService; -import org.springframework.stereotype.Service; - -/** - * 商城订单详情表 服务层实现。 - * - * @author DB - * @since 2023-10-24 - */ -@Service("orderDetailService") -public class OrderDetailServiceImpl extends ServiceImpl implements OrderDetailService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderEvaluateServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderEvaluateServiceImpl.java deleted file mode 100644 index 29d464a..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderEvaluateServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.OrderEvaluate; -import com.cpop.mall.business.mapper.OrderEvaluateMapper; -import com.cpop.mall.business.service.OrderEvaluateService; -import org.springframework.stereotype.Service; - -/** - * 商城-订单评价表 服务层实现。 - * - * @author DB - * @since 2023-10-26 - */ -@Service("orderEvaluateService") -public class OrderEvaluateServiceImpl extends ServiceImpl implements OrderEvaluateService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderRefundServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderRefundServiceImpl.java deleted file mode 100644 index 91923cf..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderRefundServiceImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.SqlUtils; -import com.cpop.mall.business.bo.OrderRefundPageBo; -import com.cpop.mall.business.bo.OrderRejectRefundBo; -import com.cpop.mall.business.dto.UserPointDto; -import com.cpop.mall.business.entity.Order; -import com.cpop.mall.business.entity.OrderRefund; -import com.cpop.mall.business.mapper.OrderRefundMapper; -import com.cpop.mall.business.service.OrderRefundService; -import com.cpop.mall.business.service.OrderService; -import com.cpop.mall.business.vo.OrderRefundPageVo; -import com.cpop.pay.framewok.config.wxPay.WxPayProperties; -import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.cpop.system.business.entity.ProfitSharing; -import com.cpop.system.business.service.ProfitSharingService; -import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result; -import com.github.binarywang.wxpay.bean.profitsharing.request.ProfitSharingReturnRequest; -import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.annotation.KeyType; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.RowKey; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; - -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; -import static com.cpop.mall.business.entity.table.OrderRefundTableDef.ORDER_REFUND; -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.ProfitSharingTableDef.PROFIT_SHARING; - -/** - * 商城订单退款记录表 服务层实现。 - * - * @author DB - * @since 2023-10-24 - */ -@Service("orderRefundService") -public class OrderRefundServiceImpl extends ServiceImpl implements OrderRefundService { - - @Autowired - private WxPayHandler wxPayHandler; - - @Autowired - private WxPayProperties wxPayProperties; - - /** - * @descriptions 同意退款 - * @author DB - * @date 2023/10/24 16:10 - * @param id 订单id - * @return: void - */ - @Override - public void agreeRefund(String id) { - OrderRefund orderRefund = this.queryChain().where(ORDER_REFUND.ID.eq(id)).one(); - Order order = SpringUtils.getBean(OrderService.class).queryChain().where(ORDER.ID.eq(orderRefund.getOrderId())).one(); - //微信支付 - if (order.getPayType() == 0) { - try { - WxPayService wxPayService = wxPayHandler.getWxPayService(); - //分账记录 - ProfitSharingService profitSharingService = SpringUtils.getBean(ProfitSharingService.class); - ProfitSharing profitSharing = profitSharingService.queryChain().where(PROFIT_SHARING.ORDER_ID.eq(order.getId())) - .and(PROFIT_SHARING.ORDER_SOURCE.eq(OrderSource.MALL.toString())) - .and(PROFIT_SHARING.PROFIT_SHARING_STATUS.eq(1)) - .one(); - if (null != profitSharing) { - ProfitSharingReturnRequest profitSharingReturnRequest = new ProfitSharingReturnRequest(); - profitSharingReturnRequest.setOrderId(profitSharing.getOutProfitSharingId()); - profitSharingReturnRequest.setOutReturnNo(profitSharing.getId()); - profitSharingReturnRequest.setDescription("分账退款"); - profitSharingReturnRequest.setSubMchId(profitSharing.getPayAccount()); - profitSharingReturnRequest.setReturnAccount(wxPayProperties.getSharingAccount()); - profitSharingReturnRequest.setReturnAccountType("MERCHANT_ID"); - profitSharingReturnRequest.setReturnAmount(profitSharing.getAmount().intValue()); - wxPayService.getProfitSharingService().profitSharingReturn(profitSharingReturnRequest); - //分账退款记录设置退款 - profitSharingService.updateChain() - .set(PROFIT_SHARING.PROFIT_SHARING_STATUS, 2) - .where(PROFIT_SHARING.ID.eq(profitSharing.getId())) - .update(); - } - WxPayRefundV3Request request = new WxPayRefundV3Request(); - WxPayRefundV3Request.Amount amount = new WxPayRefundV3Request.Amount(); - //退款金额(单位分) - int refund = order.getTotalAmount().scaleByPowerOfTen(2).intValue(); - amount.setRefund(refund) - .setTotal(refund) - .setCurrency("CNY"); - request.setTransactionId(order.getOutOrderNo()) - .setSubMchid(wxPayService.getConfig().getSubMchId()) - .setNotifyUrl(wxPayProperties.getNotifyRefund()) - .setOutRefundNo(id) - .setReason(orderRefund.getRefundReason()) - .setAmount(amount); - wxPayService.refundV3(request); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } else if (order.getPayType() == 1){ - //扣除积分 - JSONObject loginUserInfo = new JSONObject(); - loginUserInfo.put("openId",orderRefund.getOpenId()); - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - loginUserInfo.put("brandId",loginStaffInfo.getString("brandId")); - UserPointDto userPoint = SpringUtils.getBean(OrderService.class).getUserPoint(loginUserInfo); - try { - LocalDateTime now = LocalDateTime.now(); - DataSourceKey.use("jambox"); - DbChain.table("t_point_record") - .setId(RowKey.of("record_id", KeyType.Auto)) - .set("user_id", userPoint.getOldUserId()) - .set("brand_id", userPoint.getBrandCloudId()) - .set("point_behaviour", 9) - .set("behaviour_record", "商城退款商品返回积分") - .set("point_change", order.getTotalPoint()) - .set("point_time", now) - .set("cumulative", userPoint.getTotalPoint() + order.getTotalPoint()) - .set("creation_by", userPoint.getOldUserId()) - .set("last_modified", userPoint.getOldUserId()) - .set("creation_time", now) - .save(); - } finally { - DataSourceKey.clear(); - } - } - - } - - /** - * @descriptions 拒绝退款 - * @author DB - * @date 2023/10/24 16:13 - * @param bo 请求参数 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void rejectRefund(OrderRejectRefundBo bo) { - //获取订单 - OrderRefund refund = this.queryChain().where(ORDER_REFUND.ID.eq(bo.getId())).one(); - this.updateChain().set(ORDER_REFUND.REFUND_STATUS, 2) - .set(ORDER_REFUND.REFUND_REASON, bo.getRejectReason()) - .where(ORDER_REFUND.ID.eq(bo.getId())) - .update(); - //更改订单为原状态 - SpringUtils.getBean(OrderService.class).updateChain().set(ORDER.ORDER_STATUS,ORDER.PREVIOUS_STATUS) - .where(ORDER.ID.eq(refund.getOrderId())).update(); - } - - /** - * @descriptions 商城退款列表 - * @author DB - * @date 2023/10/27 17:34 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getOrderRefundPage(OrderRefundPageBo bo) { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - QueryWrapper queryWrapper = QueryWrapper.create(); - if (null != bo.getRefundStatus()) { - if (-1 == bo.getRefundStatus()) { - queryWrapper.and(ORDER_REFUND.REFUND_STATUS.in(1, 2)); - } else { - queryWrapper.and(ORDER_REFUND.REFUND_STATUS.eq(bo.getRefundStatus())); - } - } - return this.mapper.paginateAs(pageDomain.getPageNum(),pageDomain.getPageSize(), - queryWrapper.select(ORDER_REFUND.REFUND_STATUS,ORDER_REFUND.REFUND_REASON,ORDER_REFUND.ID,ORDER_REFUND.ORDER_ID,ORDER_REFUND.CREATE_TIME) - //订单相关参数 - .select(ORDER.ORDER_STATUS,ORDER.OUT_ORDER_NO,ORDER.PAY_USER_ID,ORDER.PRODUCT_NAMES,ORDER.TOTAL_AMOUNT,ORDER.PAY_USER_NAME,ORDER.BRAND_ID,ORDER.RECEIVE_NAME, - ORDER.RECEIVE_PHONE,ORDER.RECEIVE_ADDRESS,ORDER.LOGISTICS_ORDER,ORDER.REMARKS) - //品牌/店铺或校区 - .select(BRAND.BRAND_NAME) - .from(ORDER_REFUND) - .leftJoin(ORDER).on(ORDER.ID.eq(ORDER_REFUND.ORDER_ID)) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(ORDER.PAY_USER_ID)) - .leftJoin(BRAND).on(BRAND.ID.eq(ORDER.BRAND_ID)) - .and(ORDER.PRODUCT_NAMES.like(bo.getProductName())) - .and(ORDER.PAY_USER_NAME.like(bo.getPayUserName())) - .and(ORDER.RECEIVE_PHONE.like(bo.getReceivePhone())) - .orderBy(ORDER_REFUND.CREATE_TIME.desc()), - OrderRefundPageVo.class); - } - - /** - * @descriptions 退款回调通知处理 - * @author DB - * @date 2023/10/27 18:22 - * @param xmlData 请求数据 - * @return: void - */ - @Override - public void wxPayNotifyRefund(String xmlData) { - try { - WxPayRefundNotifyV3Result result = wxPayHandler.getWxPayService().parseRefundNotifyV3Result(xmlData, null); - WxPayRefundNotifyV3Result.DecryptNotifyResult reqInfo = result.getResult(); - //获取退款单号 - this.updateChain().set(ORDER_REFUND.REFUND_STATUS, 1) - .set(ORDER_REFUND.OUT_REFUND_ID, reqInfo.getRefundId()) - .where(ORDER_REFUND.ID.eq(reqInfo.getOutRefundNo())) - .update(); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderServiceImpl.java deleted file mode 100644 index 245b1c3..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/OrderServiceImpl.java +++ /dev/null @@ -1,705 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.DateUtils; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.common.utils.ip.IpUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.base.enums.UserType; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysUser; -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.QuartzUtils; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.SqlUtils; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.service.BrandExtendService; -import com.cpop.mall.business.bo.*; -import com.cpop.mall.business.dto.UserPointDto; -import com.cpop.pay.framewok.config.wxPay.WxPayConfiguration; -import com.cpop.pay.framewok.core.dto.easyLearn.WxPayGoodsDetailDto; -import com.cpop.mall.business.entity.*; -import com.cpop.mall.business.mapper.OrderMapper; -import com.cpop.mall.business.service.*; -import com.cpop.mall.business.vo.OrderDetailVo; -import com.cpop.mall.business.vo.OrderInfoVo; -import com.cpop.mall.business.vo.OrderPageVo; -import com.cpop.mall.framework.constant.MallRedisConstant; -import com.cpop.mall.framework.enums.BuyRestrictEnums; -import com.cpop.mall.framework.enums.QuartzEnums; -import com.cpop.mall.framework.task.OrderDetailAsyncTask; -import com.cpop.mall.framework.task.OrderOverTimeUnPayTask; -import com.cpop.mall.framework.task.ProductRecordSyncStockTask; -import com.cpop.pay.framewok.task.WxPayAsyncTask; -import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; -import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; -import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; -import com.github.binarywang.wxpay.exception.WxPayException; -import com.github.binarywang.wxpay.service.WxPayService; -import com.mybatisflex.annotation.KeyType; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowKey; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.quartz.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.*; -import java.util.concurrent.locks.Lock; -import java.util.stream.Collectors; - -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.mall.business.entity.table.OrderDetailTableDef.ORDER_DETAIL; -import static com.cpop.mall.business.entity.table.OrderRefundTableDef.ORDER_REFUND; -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.mybatisflex.core.query.QueryMethods.sum; - - -/** - * 商城订单表 服务层实现。 - * - * @author DB - * @since 2023-10-24 - */ -@Service("orderService") -@Slf4j -public class OrderServiceImpl extends ServiceImpl implements OrderService { - - @Autowired - private WxPayHandler wxPayHandler; - - @Autowired - private Scheduler scheduler; - - @Autowired - private WxPayAsyncTask wxPayAsyncTask; - - /** - * @descriptions 分页查询商城-订单 - * @author DB - * @date 2023/10/24 15:19 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getOrderPage(OrderPageBo bo) { - //获取当前登陆用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //如果是商城员工 - QueryWrapper queryWrapper = QueryWrapper.create(); - UserType userType = UserType.valueOf(loginUserInfo.getString("userType")); - if (userType == UserType.MALL_USER){ - //只能查询当前用户品牌下所有订单 - queryWrapper.where(ORDER.BRAND_ID.eq(loginUserInfo.getString("brandId"))); - } - //如果是小程序用户 - if (userType == UserType.MINI_USER) { - //查询此用户订单 - queryWrapper.where(ORDER.PAY_USER_ID.eq(loginUserInfo.getString("userId"))); - } - //订单状态 - if (null != bo.getOrderStatus()) { - queryWrapper.and(ORDER.ORDER_STATUS.eq(bo.getOrderStatus())); - } else { - queryWrapper.and(ORDER.ORDER_STATUS.ne(6)); - } - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), - queryWrapper - .select(ORDER.ALL_COLUMNS) - .from(ORDER) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(ORDER.PAY_USER_ID)) - .and(ORDER.RECEIVE_NAME.like(bo.getReceiveName())) - .and(ORDER.RECEIVE_PHONE.like(bo.getReceivePhone())) - .and(ORDER.PRODUCT_NAMES.like(bo.getProductName())) - .and(SYS_USER.USER_TYPE.eq("MINI_USER")) - .orderBy(ORDER.CREATE_TIME.desc()), - OrderPageVo.class, - //子查询 - item -> item.field(OrderPageVo::getDetailList) - .queryWrapper(pageVo -> queryChain() - //产品 - .select(PRODUCT.PRODUCT_NAME, PRODUCT.PIC_URL, PRODUCT.PIC_DETAIL_URL) - //订单详情 - .select(ORDER_DETAIL.ORDER_ID, ORDER_DETAIL.PRODUCT_RECORD_ID, ORDER_DETAIL.AMOUNT, ORDER_DETAIL.POINT, ORDER_DETAIL.STORE_ID) - //规格 - .select(PRODUCT_RECORD.RECORD_NAMES) - //校区 - .select(STORE.STORE_NAME) - .from(ORDER_DETAIL) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.ID.eq(ORDER_DETAIL.PRODUCT_RECORD_ID)) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(PRODUCT_RECORD.PRODUCT_ID)) - .leftJoin(STORE).on(STORE.ID.eq(ORDER_DETAIL.STORE_ID)) - .where(ORDER_DETAIL.ORDER_ID.eq(pageVo.getId()))), - //查询退款状态 - item -> item.field(OrderPageVo::getOrderRefundVo) - .queryWrapper(refundVo -> queryChain() - .select(ORDER_REFUND.REFUND_STATUS, ORDER_REFUND.REFUND_REASON, ORDER_REFUND.ID, ORDER_REFUND.ORDER_ID, ORDER_REFUND.CREATE_TIME) - .from(ORDER_REFUND) - .where(ORDER_REFUND.ORDER_ID.eq(refundVo.getId())) - .orderBy(ORDER_REFUND.CREATE_TIME.desc()) - .limit(1))); - } - - /** - * @descriptions 生成预订单 - * @author DB - * @date 2023/11/06 11:17 - * @param bo 请求参数 - * @return: java.lang.Object - */ - @Override - public String createAdvanceOrder(AdvanceOrderBo bo) { - RedisService redisService = SpringUtils.getBean(RedisService.class); - //获取当前下单用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(MallRedisConstant.IDEMPOTENT_LOCK_CREATE_ADVANCE_ORDER + loginUserInfo.getString("userId")); - if (userIdLock.tryLock()) { - //检查库存 - Map recordNumIsEnough = null; - try { - //如果是积分商品,先检查积分 - if (bo.getPayType() == 1) { - UserPointDto userPoint = getUserPoint(loginUserInfo); - if (userPoint.getTotalPoint() < bo.getTotalPoint()) { - throw new ServiceException("您的积分不足!"); - } - } - Order order = BeanUtils.mapToClass(bo, Order.class); - List orderDetails = BeanUtils.mapToList(bo.getOrderDetailList(), OrderDetail.class); - //规格记录ids - Set recordIds = orderDetails.stream().map(OrderDetail::getProductRecordId).collect(Collectors.toSet()); - //获取涉及到的商品 - ProductService productService = SpringUtils.getBean(ProductService.class); - List productList = productService.queryChain() - .select(PRODUCT.ID, PRODUCT.PRODUCT_NAME, PRODUCT.DESCRIPTION, PRODUCT.BUY_RESTRICT, PRODUCT.LIMIT_NUM) - .from(PRODUCT) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.PRODUCT_ID.eq(PRODUCT.ID)) - .where(PRODUCT_RECORD.ID.in(recordIds)) - .list(); - //检查库存 - recordNumIsEnough= recordNumIsEnough(orderDetails); - //购买限制 - buyRestrict(productList, recordNumIsEnough); - //设置待付款 - order.setOrderStatus(0) - .setPreviousStatus(0) - //获取当前用户所属品牌 - .setBrandId(loginUserInfo.getString("brandId")) - .setProductNames(productList.stream().map(Product::getProductName).collect(Collectors.joining(","))) - //当前用户id,根据用户类型查询不同用户列表 - .setPayUserId(loginUserInfo.getString("userId")); - if (StringUtils.isBlank(bo.getPayUserName())) { - order.setPayUserName(loginUserInfo.getString("nickName")); - } - this.save(order); - // 通过JobBuilder构建JobDetail实例,JobDetail规定其job只能是实现Job接口的实例 - JobDetail jobDetail = JobBuilder.newJob(OrderOverTimeUnPayTask.class).withIdentity(QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getName() + order.getId(), - QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getGroup()) - .usingJobData("orderId", order.getId()) - .build(); - //添加定时修改订单状态任务 - QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class); - //设置15分钟后 - String cron = quartzUtils.convertToCron(DateUtils.addMinutes(new Date(), 15)); - CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cron); - // CronTrigger表达式触发器 继承于Trigger。TriggerBuilder 用于构建触发器实例 - CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getName() + order.getId(), - QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getGroup()) - .withSchedule(cronScheduleBuilder).build(); - scheduler.scheduleJob(jobDetail, cronTrigger); - //保存订单详情 - orderDetails.forEach(item -> { - item.setOrderId(order.getId()); - }); - SpringUtils.getBean(OrderDetailService.class).saveBatch(orderDetails); - //移除购物车 - if (null != bo.getShoppingCartIds()&& !bo.getShoppingCartIds().isEmpty()){ - SpringUtils.getBean(ShoppingCartService.class).removeByIds(bo.getShoppingCartIds()); - } - return order.getId(); - } catch (Exception e) { - //回滚库存 - if (recordNumIsEnough != null){ - recordNumIsEnough.forEach((key, value) -> { - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + key, value.longValue()); - }); - } - throw new ServiceException(e.getMessage()); - } finally { - //释放锁 - userIdLock.unlock(); - } - }else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复下单"); - } - } - - private void buyRestrict(List productList, Map recordNumIsEnough) { - //过滤出存在购买限制的商品 - List filterProduct = productList.stream().filter(item -> item.getBuyRestrict() != null).collect(Collectors.toList()); - //过滤之后不为空,存在购买限制 - if (!filterProduct.isEmpty()){ - filterProduct.forEach(item->{ - BuyRestrictEnums.getByCode(item.getBuyRestrict()).getBuyRestrictStrategy().buyRestrict(item, recordNumIsEnough); - }); - } - } - - /** - * @descriptions 商城-订单-下单 - * @author DB - * @date 2023/10/25 9:32 - * @param bo 下单请求对象 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Object placeOrder(PlaceOrderBo bo) { - //获取当前下单用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - //分布式锁进行幂等处理 - Lock userIdLock = redisService.distributedLock(MallRedisConstant.IDEMPOTENT_LOCK_USER_PAY + loginUserInfo.getString("userId")); - if (userIdLock.tryLock()){ - try { - //获取订单信息 - Order order = this.getById(bo.getId()); - //获取预订单详情信息 - OrderDetailService orderDetailService = SpringUtils.getBean(OrderDetailService.class); - List orderDetails = orderDetailService.queryChain().where(ORDER_DETAIL.ORDER_ID.eq(order.getId())).list(); - //获取涉及到的商品 - ProductService productService = SpringUtils.getBean(ProductService.class); - List productList = productService.queryChain() - .select(PRODUCT.ID, PRODUCT.PRODUCT_NAME, PRODUCT.DESCRIPTION, PRODUCT.PRODUCT_TYPE, PRODUCT.CARD_TEMPLATE_ID) - .from(PRODUCT) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.PRODUCT_ID.eq(PRODUCT.ID)) - .where(PRODUCT_RECORD.ID.in(orderDetails.stream().map(OrderDetail::getProductRecordId).collect(Collectors.toSet()))) - .list(); - Object result; - //微信支付 - if (bo.getPayType() == 0) { - //微信支付统一下单 - WxPayService wxPayService = wxPayHandler.getWxPayService(); - WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); - //需要分账 - if (order.getTotalAmount().scaleByPowerOfTen(2).intValue() >= Math.ceil(1 / OrderSource.MALL.getRate())) { - //需要分账 - orderRequest.setProfitSharing("Y"); - } - String description = productList.stream().map(Product::getDescription).collect(Collectors.joining(",")); - if (description.getBytes().length > 127) { - description = StringUtils.substringByte(description, 0, 126); - } - WxPayConfiguration configuration = SpringUtils.getBean(WxPayConfiguration.class); - orderRequest.setSpbillCreateIp(IpUtils.getHostIp()) - .setOpenid(loginUserInfo.getString("openId")) - //商品描述 - .setBody(description) - //商品详情,如果涉及到商品优惠需要重新涉及 - .setDetail(JSONObject.toJSONString(BeanUtils.mapToList(orderDetails, WxPayGoodsDetailDto.class))) - .setOutTradeNo(order.getId()) - //元转分 - .setTotalFee(order.getTotalAmount().scaleByPowerOfTen(2).intValue()) - .setTradeType("JSAPI"); - result = wxPayService.createOrder(orderRequest); - //删除定时器任务 - QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class); - quartzUtils.deleteJob(QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getName() + order.getId(), - QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getGroup()); - } else { - //统计支付商品情况 - Map recordNumIsEnough = orderDetails.stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber)); - result = pointPay(recordNumIsEnough, order, loginUserInfo); - //删除定时器任务 - QuartzUtils quartzUtils = SpringUtils.getBean(QuartzUtils.class); - quartzUtils.deleteJob(QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getName() + order.getId(), - QuartzEnums.ORDER_OVERTIME_UN_PAY_TASK.getGroup()); - } - //更新订单 - this.updateChain().set(ORDER.RECEIVE_PHONE, bo.getReceivePhone()) - .set(ORDER.RECEIVE_ADDRESS, bo.getReceiveAddress()) - .set(ORDER.RECEIVE_NAME, bo.getReceiveName()) - .where(ORDER.ID.eq(bo.getId())) - .update(); - return result; - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } finally { - //释放锁 - userIdLock.unlock(); - } - } else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复支付"); - } - } - - /** - * @Description: 积分支付 - * @Author DB - * @Date: 2023/10/28 9:33 - */ - private Object pointPay(Map recordNumIsEnough, Order order, JSONObject loginUserInfo) { - UserPointDto userPoint = getUserPoint(loginUserInfo); - if (userPoint.getTotalPoint() < order.getTotalPoint()) { - throw new ServiceException("您的积分不足!"); - } - //扣除积分 - try { - LocalDateTime now = LocalDateTime.now(); - DataSourceKey.use("jambox"); - DbChain.table("t_point_record") - .setId(RowKey.of("record_id", KeyType.Auto)) - .set("user_id", userPoint.getOldUserId()) - .set("brand_id", userPoint.getBrandCloudId()) - .set("point_behaviour", 9) - .set("behaviour_record", "商城购买商品") - .set("point_change", -order.getTotalPoint()) - .set("point_time", now) - .set("cumulative", userPoint.getTotalPoint() - order.getTotalPoint()) - .set("creation_by", userPoint.getOldUserId()) - .set("last_modified", userPoint.getOldUserId()) - .set("creation_time", now) - .save(); - } finally { - DataSourceKey.clear(); - } - ProductRecordService productRecordService = SpringUtils.getBean(ProductRecordService.class); - List productRecords = productRecordService.listByIds(recordNumIsEnough.keySet()); - productRecords.forEach(item -> { - item.setRecordNum(item.getRecordNum() - recordNumIsEnough.get(item.getId())); - }); - productRecordService.updateBatch(productRecords); - //修改订单状态 - return this.updateChain().set(ORDER.ORDER_STATUS, 1).where(ORDER.ID.eq(order.getId())).update(); - } - - /** - * @descriptions 获取当前用户积分 - * @author DB - * @date 2023/11/10 16:10 - * @param loginUserInfo 用户信息 - * @return: java.lang.Integer - */ - @Override - public UserPointDto getUserPoint(JSONObject loginUserInfo){ - //获取云品牌id - BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class) - .getOne(QueryWrapper.create() - .where(BRAND_EXTEND.BRAND_ID.eq(loginUserInfo.getString("brandId")))); - //修改用户积分 - try { - DataSourceKey.use("jambox"); - //获取旧用户信息 - List rows = DbChain.table("t_user_info") - .select("user_id") - .where("open_id = ?", loginUserInfo.getString("openId")) - .list(); - List userIds = rows.stream().map(item -> item.getString("userId")).collect(Collectors.toList()); - Row pointChange = DbChain.table("t_point_record") - .select(sum("point_change").as("pointChange")) - .in("user_id", userIds) - .and("brand_id = ?", brandExtend.getBrandCloudId()) - .one(); - if (null == pointChange.getInt("pointChange")) { - throw new ServiceException("您的积分不足!"); - }else { - UserPointDto userPointDto = new UserPointDto(); - userPointDto.setTotalPoint(pointChange.getInt("pointChange")); - userPointDto.setBrandCloudId(brandExtend.getBrandCloudId()); - userPointDto.setOldUserId(userIds.get(0)); - return userPointDto; - } - } finally { - DataSourceKey.clear(); - } - } - - /** - * @descriptions 库存是否足够 - * @author DB - * @date 2023/10/25 10:18 - * @param list 订单详情 - * @return: Map 预库存记录 - */ - private Map recordNumIsEnough(List list) throws ServiceException { - RedisService redisService = SpringUtils.getBean(RedisService.class); - Map stockNumMap = new HashMap<>(); - //遍历库存 - list.forEach(item -> { - Integer stockNum = redisService.getCacheObject(MallRedisConstant.STOCK_RECORD_NUM + item.getProductRecordId()); - ProductRecord record = null; - //从数据库中获取库存信息然后放入缓存 - if (stockNum == null) { - record = SpringUtils.getBean(ProductRecordService.class).getById(item.getProductRecordId()); - stockNum = record.getRecordNum(); - redisService.setCacheObject(MallRedisConstant.STOCK_RECORD_NUM + item.getProductRecordId(), stockNum); - } - //剩余库存 - Long surplusStock = redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + item.getProductRecordId(), -item.getNumber().longValue()); - boolean isEnough = surplusStock >= 0; - if (!isEnough) { - if (record == null) { - record = SpringUtils.getBean(ProductRecordService.class).getById(item.getProductRecordId()); - } - //回滚库存 - if (!stockNumMap.isEmpty()){ - stockNumMap.forEach((key, value) -> { - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + key, value.longValue()); - }); - } - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + item.getProductRecordId(), item.getNumber().longValue()); - throw new ServiceException("您购买的商品" + record.getRecordNames() + "库存不足,请联系客服并重新下单!"); - } else { - //此处录入预库存信息 - stockNumMap.put(item.getProductRecordId(), item.getNumber()); - } - }); - return stockNumMap; - } - - /** - * @descriptions 申请退款 - * @author DB - * @date 2023/10/26 17:24 - * @param bo 申请退款对象 - * @return: void - */ - @Override - public void applyRefund(OrderApplyRefundBo bo) { - //查询是否有进行中的退款申请 - OrderRefundService orderRefundService = SpringUtils.getBean(OrderRefundService.class); - long applying = orderRefundService.queryChain().where(ORDER_REFUND.ORDER_ID.eq(bo.getOrderId())) - .and(ORDER_REFUND.REFUND_STATUS.eq(0)).count(); - if (applying > 0) { - throw new ServiceException("你已申请此订单退款,现在暂在处理中,如需跟多信息请和客服联系"); - } - OrderRefund orderRefund = BeanUtils.mapToClass(bo, OrderRefund.class); - orderRefund.setRefundStatus(0); - orderRefundService.save(orderRefund); - //修改订单状态 - this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS) - .set(ORDER.ORDER_STATUS, 4).where(ORDER.ID.eq(bo.getOrderId())).update(); - } - - /** - * @descriptions 微信支付订单通知 - * @author DB - * @date 2023/10/27 16:04 - * @param xmlData 加密数据 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void wxPayNotifyOrder(String xmlData) { - try { - WxPayService wxPayService = wxPayHandler.getWxPayService(); - WxPayOrderNotifyResult notifyResult = wxPayService.parseOrderNotifyResult(xmlData); - if(!StringUtils.equals(notifyResult.getResultCode(),"SUCCESS")){ - throw new ServiceException(notifyResult.getReturnMsg()); - } - String orderId = notifyResult.getOutTradeNo(); - //修改订单状态 - this.updateChain().set(ORDER.OUT_ORDER_NO, notifyResult.getTransactionId()) - .set(ORDER.ORDER_STATUS, 1).where(ORDER.ID.eq(orderId)).update(); - //支付成功减库存 - List orderDetails = SpringUtils.getBean(OrderDetailService.class).queryChain() - .where(ORDER_DETAIL.ORDER_ID.eq(orderId)).list(); - //订单数量集合 - Map orderNumMap = orderDetails.stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber)); - //需要分账 - if (notifyResult.getTotalFee() >= Math.ceil(1 / OrderSource.MALL.getRate())) { - wxPayAsyncTask.asyncWxPayProfitSharing(orderId, notifyResult, wxPayService, OrderSource.MALL); - } - //异步更新 - SpringUtils.getBean(ProductRecordSyncStockTask.class).asyncUpdateRecords(orderNumMap); - } catch (WxPayException e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * @descriptions 取消订单 - * @author DB - * @date 2023/10/27 17:17 - * @param orderId 订单id - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void cancelOrder(String orderId) { - this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS) - .set(ORDER.ORDER_STATUS, 5).where(ORDER.ID.eq(orderId)).update(); - //获取订单详情 - List orderDetails = SpringUtils.getBean(OrderDetailService.class).queryChain().where(ORDER_DETAIL.ORDER_ID.eq(orderId)).list(); - Map orderReturnMap = orderDetails.stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber)); - //redis库存回滚 - RedisService redisService = SpringUtils.getBean(RedisService.class); - orderReturnMap.forEach((key, value) -> { - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + key, value.longValue()); - }); - } - - /** - * @Description: 输入物流订单 - * @param bo 请求参数 - * @Author DB - * @Date: 2023/10/28 15:27 - */ - @Override - public void inputLogisticsOrder(LogisticsOrderBo bo) { - this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS) - .set(ORDER.ORDER_STATUS, 2) - .set(ORDER.LOGISTICS_ORDER, bo.getLogisticsOrder()) - .where(ORDER.ID.eq(bo.getId())).update(); - } - - /** - * @descriptions 小程序-重新支付订单 - * @author DB - * @date 2023/11/03 16:14 - * @param orderId 订单id - * @return: java.lang.Object - */ - @Override - public Object rePayOrder(String orderId) { - Order order = this.getById(orderId); - //获取订单详情 - List orderDetails = SpringUtils.getBean(OrderDetailService.class).queryChain().where(ORDER_DETAIL.ORDER_ID.eq(orderId)).list(); - //获取当前下单用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - List productList = SpringUtils.getBean(ProductService.class).queryChain() - .select(PRODUCT.ID, PRODUCT.PRODUCT_NAME, PRODUCT.DESCRIPTION) - .from(PRODUCT) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.PRODUCT_ID.eq(PRODUCT.ID)) - .where(PRODUCT_RECORD.ID.in(orderDetails.stream().map(OrderDetail::getProductRecordId).collect(Collectors.toSet()))) - .list(); - //分布式锁进行幂等处理 - RedisService redisService = SpringUtils.getBean(RedisService.class); - Lock userIdLock = redisService.distributedLock(MallRedisConstant.IDEMPOTENT_LOCK_USER_PAY + loginUserInfo.getString("userId")); - if (userIdLock.tryLock()) { - //检查库存 - Map recordNumIsEnough = null; - try { - recordNumIsEnough= recordNumIsEnough(orderDetails); - //微信支付 - if (order.getPayType() == 0) { - //微信支付统一下单 - WxPayService wxPayService = wxPayHandler.getWxPayService(); - WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest(); - //查询是否是服务商系品牌 - String brandId = loginUserInfo.getString("brandId"); - //需要分账 - if (order.getTotalAmount().scaleByPowerOfTen(2).intValue() >= 10) { - //需要分账 - orderRequest.setProfitSharing("Y"); - } - orderRequest.setSpbillCreateIp(IpUtils.getHostIp()) - .setOpenid(loginUserInfo.getString("openId")) - //商品描述 - .setBody(productList.stream().map(Product::getDescription).collect(Collectors.joining(","))) - //商品详情,如果涉及到商品优惠需要重新涉及 - .setDetail(JSONObject.toJSONString(BeanUtils.mapToList(orderDetails, WxPayGoodsDetailDto.class))) - .setOutTradeNo(order.getId()) - //元转分 - .setTotalFee(order.getTotalAmount().scaleByPowerOfTen(2).intValue()) - .setTradeType("JSAPI"); - return wxPayService.createOrder(orderRequest); - } else { - return pointPay(recordNumIsEnough, order, loginUserInfo); - } - } catch (Exception e){ - //回滚库存 - if (recordNumIsEnough != null){ - recordNumIsEnough.forEach((key, value) -> { - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + key, value.longValue()); - }); - } - throw new ServiceException(e.getMessage()); - }finally { - userIdLock.unlock(); - } - }else { - //获取锁失败,直接返回空 - throw new ServiceException("请勿重复下单"); - } - } - - /** - * @descriptions 小程序-获取订单详情 - * @author DB - * @date 2023/11/06 14:26 - * @param orderId 订单id - * @return: com.cpop.mall.business.vo.OrderInfoVo - */ - @Override - public OrderInfoVo getOrderInfo(String orderId) { - OrderInfoVo orderInfoVo = this.mapper.selectOneWithRelationsByIdAs(orderId, OrderInfoVo.class); - //获取订单详情 - List orderDetailVos = SpringUtils.getBean(OrderDetailService.class).listAs(QueryWrapper.create() - .select(PRODUCT.PRODUCT_NAME, PRODUCT.PIC_URL, PRODUCT.PIC_DETAIL_URL) - //订单详情 - .select(ORDER_DETAIL.ORDER_ID, ORDER_DETAIL.PRODUCT_RECORD_ID, ORDER_DETAIL.AMOUNT, ORDER_DETAIL.POINT, ORDER_DETAIL.STORE_ID) - //规格 - .select(PRODUCT_RECORD.RECORD_NAMES) - //校区 - .select(STORE.STORE_NAME) - .from(ORDER_DETAIL) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.ID.eq(ORDER_DETAIL.PRODUCT_RECORD_ID)) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(PRODUCT_RECORD.PRODUCT_ID)) - .leftJoin(STORE).on(STORE.ID.eq(ORDER_DETAIL.STORE_ID)) - .where(ORDER_DETAIL.ORDER_ID.eq(orderId)), - OrderDetailVo.class); - orderInfoVo.setDetailList(orderDetailVos); - return orderInfoVo; - } - - /** - * @descriptions 后台确定订单完成 - * @author DB - * @date 2023/11/13 17:42 - * @param id 主键 - * @return: void - */ - @Override - public void orderFinish(String id) { - //获取订单信息 - Order order = this.getById(id); - //获取预订单详情信息 - OrderDetailService orderDetailService = SpringUtils.getBean(OrderDetailService.class); - List orderDetails = orderDetailService.queryChain().where(ORDER_DETAIL.ORDER_ID.eq(order.getId())).list(); - //获取涉及到的商品 - ProductService productService = SpringUtils.getBean(ProductService.class); - List productList = productService.queryChain() - .select(PRODUCT.ID, PRODUCT.PRODUCT_NAME, PRODUCT.DESCRIPTION, PRODUCT.PRODUCT_TYPE, PRODUCT.CARD_TEMPLATE_ID) - .from(PRODUCT) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.PRODUCT_ID.eq(PRODUCT.ID)) - .where(PRODUCT_RECORD.ID.in(orderDetails.stream().map(OrderDetail::getProductRecordId).collect(Collectors.toSet()))) - .list(); - this.updateChain() - .setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS) - .set(ORDER.ORDER_STATUS, 3) - .where(ORDER.ID.eq(id)).update(); - //异步处理订单详情 - SysUser sysUser = DbChain.table(SYS_USER).where(SYS_USER.ID.eq(order.getPayUserId())).oneAs(SysUser.class); - SpringUtils.getBean(OrderDetailAsyncTask.class).asyncProcessingOrderDetails(order, sysUser.getPhoneNumber(), sysUser.getNickName(), orderDetails, productList); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductOutServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductOutServiceImpl.java deleted file mode 100644 index 9823277..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductOutServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.ProductOut; -import com.cpop.mall.business.mapper.ProductOutMapper; -import com.cpop.mall.business.service.ProductOutService; -import org.springframework.stereotype.Service; - -/** - * 商城-商品外部拓展表 服务层实现。 - * - * @author DB - * @since 2023-10-26 - */ -@Service("productOutService") -public class ProductOutServiceImpl extends ServiceImpl implements ProductOutService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductRecordServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductRecordServiceImpl.java deleted file mode 100644 index cf39a66..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductRecordServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.mapper.ProductRecordMapper; -import com.cpop.mall.business.service.ProductRecordService; -import org.springframework.stereotype.Service; - -/** - * 商城-商品-规格记录 服务层实现。 - * - * @author DB - * @since 2023-10-23 - */ -@Service("productSpecificationRecordService") -public class ProductRecordServiceImpl extends ServiceImpl implements ProductRecordService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductServiceImpl.java deleted file mode 100644 index 3ea09d3..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductServiceImpl.java +++ /dev/null @@ -1,479 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.SqlUtils; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.service.BrandExtendService; -import com.cpop.jambox.business.service.CardTemplateService; -import com.cpop.mall.business.bo.ProductBo; -import com.cpop.mall.business.bo.ProductPageBo; -import com.cpop.mall.business.bo.ProductRecordBo; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.entity.ProductSpecification; -import com.cpop.mall.business.mapper.ProductMapper; -import com.cpop.mall.business.service.OrderEvaluateService; -import com.cpop.mall.business.service.ProductRecordService; -import com.cpop.mall.business.service.ProductService; -import com.cpop.mall.business.service.ProductSpecificationService; -import com.cpop.mall.framework.task.ShoppingCartAsyncTask; -import com.cpop.mall.business.vo.*; -import com.cpop.mall.framework.constant.MallRedisConstant; -import com.cpop.system.business.service.StoreService; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowUtil; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; -import static com.cpop.mall.business.entity.table.OrderDetailTableDef.ORDER_DETAIL; -import static com.cpop.mall.business.entity.table.OrderEvaluateTableDef.ORDER_EVALUATE; -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ProductSpecificationTableDef.PRODUCT_SPECIFICATION; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; -import static com.mybatisflex.core.query.QueryMethods.*; - -/** - * 商城-商品表 服务层实现。 - * - * @author DB - * @since 2023-10-23 - */ -@Service("productService") -public class ProductServiceImpl extends ServiceImpl implements ProductService { - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/23 11:59 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getProductPage(ProductPageBo bo) { - //获取当前用户品牌 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - QueryWrapper queryWrapper = QueryWrapper.create(); - //价格排序 - if (null != bo.getPriceOrder()){ - if (bo.getPriceOrder()) { - queryWrapper.orderBy(PRODUCT.MAX_CONSUME.desc()); - } else { - queryWrapper.orderBy(PRODUCT.MIN_CONSUME.asc()); - } - } - return this.mapper.paginateWithRelationsAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), - queryWrapper.select(PRODUCT.ALL_COLUMNS) - .from(PRODUCT) - //如果没有品牌会查询所有数据 - .where(PRODUCT.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .and(PRODUCT.PRODUCT_NAME.like(bo.getProductName())) - .and(PRODUCT.PRODUCT_TYPE.eq(bo.getProductType())) - .and(PRODUCT.BUY_RESTRICT.eq(bo.getBuyRestrict())) - .and(PRODUCT.IS_UP.eq(bo.getIsUp())) - .and(PRODUCT.STORE_IDS.like(bo.getAuthorizedStoreId())) - //置顶 - .orderBy(PRODUCT.IS_TOP.desc(),PRODUCT.UPDATE_TIME.desc()), - ProductPageVo.class, - //子查询 - item -> item.field(ProductPageVo::getTradeInfo) - .queryWrapper(tradeInfo -> queryChain() - //交易金额;交易数量 - .select(sum(ORDER_DETAIL.NUMBER).as(ProductPageVo.ProductTradeInfo::getTradeNum), sum(ORDER_DETAIL.AMOUNT).as(ProductPageVo.ProductTradeInfo::getTradePrice)) - .from(ORDER_DETAIL) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.ID.eq(ORDER_DETAIL.PRODUCT_RECORD_ID)) - .leftJoin(ORDER).on(ORDER.ID.eq(ORDER_DETAIL.ORDER_ID)) - .where(PRODUCT_RECORD.PRODUCT_ID.eq(tradeInfo.getId())) - //只能统计已完成 - .and(ORDER.ORDER_STATUS.eq(3))), - //授权校区查询 - item -> item.field(ProductPageVo::getAuthorizedStoreNames) - .queryWrapper(storeNames -> queryChain() - .select(groupConcat(STORE.STORE_NAME).as(ProductPageVo::getAuthorizedStoreNames)) - .from(STORE) - .where(STORE.ID.in(StringUtils.isNotBlank(storeNames.getStoreIds()) ? storeNames.getStoreIds().split(",") : "-1")) - .groupBy(STORE.BRAND_ID)) - ); - } - - /** - * @descriptions 分页查询商城-商品 - * @author DB - * @date 2023/10/27 13:41 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getMiniProductPage(ProductPageBo bo) { - //获取当前用户品牌 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - QueryWrapper queryWrapper = QueryWrapper.create(); - //价格排序 - if (null != bo.getPriceOrder()){ - if (bo.getPriceOrder()) { - queryWrapper.orderBy(PRODUCT.MAX_CONSUME.desc()); - } else { - queryWrapper.orderBy(PRODUCT.MIN_CONSUME.asc()); - } - } - if (null != bo.getProductType()){ - queryWrapper.and(PRODUCT.PRODUCT_TYPE.eq(bo.getProductType())); - queryWrapper.and(PRODUCT.ID.ne(bo.getProductId())); - } - return this.mapper.paginateWithRelationsAs(pageDomain.getPageNum(), pageDomain.getPageSize(), - queryWrapper - .where(PRODUCT.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .and(PRODUCT.IS_UP.eq(true)) - .and(PRODUCT.PRODUCT_NAME.like(bo.getProductName())) - .and(PRODUCT.BUY_RESTRICT.eq(bo.getBuyRestrict())) - .and(PRODUCT.PAY_TYPE.eq(bo.getPayType())) - .orderBy(PRODUCT.IS_TOP.desc(), PRODUCT.UPDATE_TIME.desc()), - MiniProductPageVo.class); - } - - /** - * @descriptions 创建规格 - * @author DB - * @date 2023/10/23 12:43 - * @param specificationGroups 请求参数 - * @return: java.util.List - */ - @Override - public List createSpecification(List> specificationGroups) { - return recursionCreateSpecification(specificationGroups, 0, "", new ArrayList<>()); - } - - /** - * @descriptions 递归创建 - * @author DB - * @date 2023/10/23 16:20 - * @param list 属性值列表 - * @param index 下标 - * @param str 初始化数据 - * @param newObjs 新obj - * @return: java.util.List - */ - private List recursionCreateSpecification(List> list, int index, String str, List newObjs) { - if (index == list.size()) { - newObjs.add(str); - return newObjs; - } - for (String dataStr : list.get(index)) { - if (StringUtils.isBlank(str)) { - recursionCreateSpecification(list, index + 1, str + dataStr, newObjs); - } else { - recursionCreateSpecification(list, index + 1, str + "," + dataStr, newObjs); - } - } - return newObjs; - } - - /** - * @descriptions 保存商城-商品 - * @author DB - * @date 2023/10/23 12:15 - * @param bo 请求参数 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void insertProduct(ProductBo bo) { - Product product = BeanUtils.mapToClass(bo, Product.class); - if (StringUtils.isBlank(bo.getBrandId())){ - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - product.setBrandId(loginStaffInfo.getString("brandId")); - } - //规格 - ProductSpecificationService productSpecificationService = SpringUtils.getBean(ProductSpecificationService.class); - List productSpecifications; - //记录 - ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class); - //保存商品记录 - List recordList; - //判断当前传入的是否是课卡 - if (bo.getProductType() == 0) { - //获取模板相关信息 - Row oldTemplateInfo = SpringUtils.getBean(CardTemplateService.class).getOldTemplateInfo(bo.getCardTemplateId(), product.getBrandId()); - product.setMaxConsume(oldTemplateInfo.getBigDecimal("price")).setMinConsume(oldTemplateInfo.getBigDecimal("price")); - this.save(product); - //课卡模板获取固定规格 - ProductSpecification productSpecification = new ProductSpecification(); - productSpecification.setSpecificationNames(oldTemplateInfo.getString("name")); - productSpecifications = new ArrayList(); - productSpecifications.add(productSpecification); - //记录 - recordList = new ArrayList(); - ProductRecord productRecord = new ProductRecord(); - productRecord.setRecordNum(2147483647).setRecordNames(productSpecification.getSpecificationNames()).setRecordPrice(oldTemplateInfo.getBigDecimal("price")).setRecordPoints(0); - recordList.add(productRecord); - } else { - //积分支付 - if (bo.getPayType() == 1) { - //计算最高最低价 - Integer maxPoint = bo.getRecordList().stream().map(ProductRecordBo::getRecordPoints).max(Comparator.comparing(x -> x)).orElse(0); - Integer minPoint = bo.getRecordList().stream().map(ProductRecordBo::getRecordPoints).min(Comparator.comparing(x -> x)).orElse(0); - product.setMaxConsume(BigDecimal.valueOf(maxPoint)).setMinConsume(BigDecimal.valueOf(minPoint)); - } else { - //计算最高最低价 - BigDecimal maxPrice = bo.getRecordList().stream().map(ProductRecordBo::getRecordPrice).max(Comparator.comparing(x -> x)).orElse(null); - BigDecimal minPrice = bo.getRecordList().stream().map(ProductRecordBo::getRecordPrice).min(Comparator.comparing(x -> x)).orElse(null); - product.setMaxConsume(maxPrice).setMinConsume(minPrice); - } - this.save(product); - productSpecifications = BeanUtils.mapToList(bo.getSpecificationList(), ProductSpecification.class); - //保存商品记录 - recordList = BeanUtils.mapToList(bo.getRecordList(), ProductRecord.class); - } - productSpecifications.forEach(item -> { - item.setProductId(product.getId()); - }); - //保存规格 - productSpecificationService.saveBatch(productSpecifications); - recordList.forEach(item -> { - item.setProductId(product.getId()); - }); - //保存记录 - specificationRecordService.saveBatch(recordList); - } - - /** - * @descriptions 根据主键更新商城-商品 - * @author DB - * @date 2023/10/23 16:51 - * @param bo 请求参数 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void updateProduct(ProductBo bo) { - Product product = BeanUtils.mapToClass(bo, Product.class); - //积分支付 - if (bo.getPayType() == 1) { - //计算最高最低价 - Integer maxPoint = bo.getRecordList().stream().map(ProductRecordBo::getRecordPoints).max(Comparator.comparing(x -> x)).orElse(0); - Integer minPoint = bo.getRecordList().stream().map(ProductRecordBo::getRecordPoints).min(Comparator.comparing(x -> x)).orElse(0); - product.setMaxConsume(BigDecimal.valueOf(maxPoint)).setMinConsume(BigDecimal.valueOf(minPoint)); - } else { - //计算最高最低价 - BigDecimal maxPrice = bo.getRecordList().stream().map(ProductRecordBo::getRecordPrice).max(Comparator.comparing(x -> x)).orElse(null); - BigDecimal minPrice = bo.getRecordList().stream().map(ProductRecordBo::getRecordPrice).min(Comparator.comparing(x -> x)).orElse(null); - product.setMaxConsume(maxPrice).setMinConsume(minPrice); - } - this.updateById(product); - //保存规格 - ProductSpecificationService productSpecificationService = SpringUtils.getBean(ProductSpecificationService.class); - List productSpecifications = BeanUtils.mapToList(bo.getSpecificationList(), ProductSpecification.class); - productSpecifications.forEach(item -> { - item.setProductId(product.getId()); - }); - productSpecificationService.updateBatch(productSpecifications); - //存商品记录详情 - List recordList = BeanUtils.mapToList(bo.getRecordList(), ProductRecord.class); - ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class); - RedisService redisService = SpringUtils.getBean(RedisService.class); - recordList.forEach(item -> { - item.setProductId(product.getId()); - //更新库存 - redisService.setCacheObject(MallRedisConstant.STOCK_RECORD_NUM + item.getId(), item.getRecordNum()); - }); - specificationRecordService.updateBatch(recordList); - //异步更新购物车价格 - SpringUtils.getBean(ShoppingCartAsyncTask.class).asyncUpdateShoppingCartAmount(product); - } - - /** - * @descriptions 根据主键重置商城商品 - * @author DB - * @date 2023/10/23 17:21 - * @param id 主键 - * @return: void - */ - @Override - public void resetProduct(String id) { - //删规格 - ProductSpecificationService productSpecificationService = SpringUtils.getBean(ProductSpecificationService.class); - productSpecificationService.updateChain().where(PRODUCT_SPECIFICATION.PRODUCT_ID.eq(id)).remove(); - //删商品记录详情 - ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class); - specificationRecordService.updateChain().where(PRODUCT_RECORD.PRODUCT_ID.eq(id)).remove(); - } - - /** - * @descriptions 获取果酱课卡模板 - * @author DB - * @date 2023/10/23 18:11 - * @return: java.util.List - */ - @Override - public List getJamboxCardTemplate() { - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //获取果酱品牌拓展信息 - BrandExtendService brandExtendService = SpringUtils.getBean(BrandExtendService.class); - BrandExtend brandExtend = brandExtendService.queryChain() - .leftJoin(BRAND).on(BRAND.ID.eq(BRAND_EXTEND.BRAND_ID)) - .where(BRAND.ID.eq(loginStaffInfo.getString("brandId"))).one(); - //多数据源 - List rowList; - List cardTemplateListVos; - try { - DataSourceKey.use("jambox"); - rowList = Db.selectListByQuery("t_card_template", QueryWrapper.create() - .select("tct.template_id AS id", "tct.brand_id", "tct.name") - .from("t_card_template").as("tct") - .leftJoin("t_brand_info").as("tbi").on("tbi.id = tct.brand_id") - .where("tbi.brand_id = ?", brandExtend.getBrandCloudId()) - .or("tct.brand_id = ?", brandExtend.getBrandCloudId()) - .like("tct.pay_type", 0) - //未被删除的模板 - .and("tct.deleted = 1") - .orderBy("tct.creation_time", false)); - cardTemplateListVos = RowUtil.toEntityList(rowList, JamboxCardTemplateListVo.class); - } finally { - DataSourceKey.clear(); - } - return cardTemplateListVos; - } - - /** - * @descriptions 下单需要选择店铺/校区 - * @author DB - * @date 2023/10/26 15:34 - * @return: java.util.List - */ - @Override - public List getStoreList() { - //获取当前用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - SourceType sourceType = SourceType.valueOf(loginUserInfo.getString("sourceType")); - switch (sourceType) { - //果酱 - case JAMBOX: - return getJamboxStore(loginUserInfo); - case COMMON: - return getCommonStore(loginUserInfo); - default: - } - return null; - } - - /** - * @descriptions 获取通用校区信息 - * @author DB - * @date 2023/10/26 15:54 - * @param loginUserInfo 登录用户信息 - * @return: java.util.List - */ - private List getCommonStore(JSONObject loginUserInfo) { - return SpringUtils.getBean(StoreService.class).queryChain() - .select(STORE.STORE_NAME, STORE.ID) - .from(STORE) - .leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) - .where(BRAND.ID.eq(loginUserInfo.getString("brandId"))) - .listAs(StoreListVo.class); - } - - /** - * @descriptions 获取果酱校区信息 - * @author DB - * @date 2023/10/26 15:54 - * @param loginUserInfo 登录用户信息 - * @return: java.util.List - */ - private List getJamboxStore(JSONObject loginUserInfo) { - return SpringUtils.getBean(StoreService.class).queryChain() - .select(STORE.STORE_NAME, STORE.ID) - .select(STORE_EXTEND.STORE_CLOUD_ID.as(StoreListVo::getOutId)) - .from(STORE) - .leftJoin(BRAND).on(BRAND.ID.eq(STORE.BRAND_ID)) - .leftJoin(STORE_EXTEND).on(STORE_EXTEND.STORE_ID.eq(STORE.ID)) - .where(BRAND.ID.eq(loginUserInfo.getString("brandId"))) - .listAs(StoreListVo.class); - } - - /** - * @descriptions 查询商品评价分页列表 - * @author DB - * @date 2023/10/26 17:02 - * @param productId 商品id - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getOrderEvaluatePage(String productId) { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - OrderEvaluateService evaluateService = SpringUtils.getBean(OrderEvaluateService.class); - return evaluateService.getMapper().paginateAs(pageDomain.getPageNum(),pageDomain.getPageSize(), - QueryWrapper.create() - .select(ORDER_EVALUATE.ALL_COLUMNS) - .from(ORDER_EVALUATE) - .leftJoin(ORDER).on(ORDER.ID.eq(ORDER_EVALUATE.ORDER_ID)) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(ORDER_EVALUATE.PRODUCT_ID)) - .where(PRODUCT.ID.eq(productId)), - ProductEvaluateVo.class); - } - - /** - * @descriptions 获取商品详情 - * @author DB - * @date 2023/11/06 11:56 - * @param id 商品id - * @return: com.cpop.mall.business.vo.ProductInfoVo - */ - @Override - public ProductInfoVo getProductInfo(String id) { - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - ProductInfoVo productInfoVo = this.mapper.selectOneWithRelationsByIdAs(id, ProductInfoVo.class); - if (productInfoVo.getProductType() == 0){ - try { - DataSourceKey.use("jambox"); - Row cardTemplate = SpringUtils.getBean(CardTemplateService.class).getOldTemplateInfo(productInfoVo.getCardTemplateId(), loginUserInfo.getString("brandId")); - productInfoVo.setCardTemplateName(cardTemplate.getString("name")); - } finally { - DataSourceKey.clear(); - } - } - return productInfoVo; - } - - /** - * @descriptions 查询商城同类型随机商品 - * @author DB - * @date 2023/11/13 16:24 - * @param id 主键 - * @param productType 商品类型 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getSameTypeRandomProduct(String id, Integer productType) { - //获取当前用户品牌 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateWithRelationsAs(pageDomain.getPageNum(), pageDomain.getPageSize(), - QueryWrapper.create().select() - .where(PRODUCT.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .and(PRODUCT.PRODUCT_TYPE.eq(productType)) - .and("id >= (((SELECT MAX(id) FROM cp_mall_product)-(SELECT MIN(id) FROM cp_mall_product)) * RAND() + (SELECT MIN(id) FROM cp_mall_product))") - .and(PRODUCT.IS_UP.eq(true)), - MiniProductPageVo.class); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductSpecificationServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductSpecificationServiceImpl.java deleted file mode 100644 index 5c69ab7..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ProductSpecificationServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.ProductSpecification; -import com.cpop.mall.business.mapper.ProductSpecificationMapper; -import com.cpop.mall.business.service.ProductSpecificationService; -import org.springframework.stereotype.Service; - -/** - * 商城-商品-规格 服务层实现。 - * - * @author DB - * @since 2023-10-23 - */ -@Service("productSpecificationService") -public class ProductSpecificationServiceImpl extends ServiceImpl implements ProductSpecificationService { - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/RoleBrandServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/RoleBrandServiceImpl.java deleted file mode 100644 index 37d83b6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/RoleBrandServiceImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.SqlUtils; -import com.cpop.mall.business.bo.MallRoleBo; -import com.cpop.mall.business.bo.MallRolePageBo; -import com.cpop.mall.business.entity.RoleBrand; -import com.cpop.mall.business.mapper.RoleBrandMapper; -import com.cpop.mall.business.service.RoleBrandService; -import com.cpop.mall.business.vo.MallRolePageVo; -import com.cpop.system.business.bo.RoleStatusBo; -import com.cpop.system.business.entity.Role; -import com.cpop.system.business.entity.RoleMenu; -import com.cpop.system.business.service.RoleMenuService; -import com.cpop.system.business.service.RoleService; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -import static com.cpop.mall.business.entity.table.RoleBrandTableDef.ROLE_BRAND; -import static com.cpop.mall.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.MenuTableDef.MENU; -import static com.cpop.system.business.entity.table.RoleMenuTableDef.ROLE_MENU; -import static com.cpop.system.business.entity.table.RoleTableDef.ROLE; -import static com.mybatisflex.core.query.QueryMethods.distinct; -import static com.mybatisflex.core.query.QueryMethods.groupConcat; - -/** - * 商城-角色-品牌id 服务层实现。 - * - * @author DB - * @since 2023-10-19 - */ -@Service("roleBrandService") -public class RoleBrandServiceImpl extends ServiceImpl implements RoleBrandService { - - /** - * @descriptions 查询商城角色分页列表 - * @author DB - * @date 2023/09/10 16:51 - * @param bo 请求参数 - * @return R> - */ - @Override - public Page getMallRolePageList(MallRolePageBo bo) { - //获取当前登录用户信息 - JSONObject staffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //获取分页参数 - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), - QueryWrapper.create() - .select(distinct(ROLE_BRAND.ALL_COLUMNS)) - //角色信息 - .select(ROLE.ROLE_NAME, ROLE.ROLE_VALUE, ROLE.STATUS, ROLE.REMARK, ROLE.ORDER_NO, ROLE.CREATE_TIME) - .select(groupConcat(MENU.ID).as(MallRolePageVo::getMenuIds)) - .leftJoin(STAFF).on(STAFF.ROLE_BRAND_ID.eq(ROLE_BRAND.ID)) - .leftJoin(ROLE).on(ROLE.ID.eq(ROLE_BRAND.ROLE_ID)) - //左联品牌表 - .leftJoin(BRAND).on(ROLE_BRAND.ID.eq(ROLE_BRAND.BRAND_ID)) - //角色菜单中甲表 - .leftJoin(ROLE_MENU).on(ROLE_MENU.ROLE_ID.eq(ROLE_BRAND.ROLE_ID)) - .leftJoin(MENU).on(MENU.ID.eq(ROLE_MENU.MENU_ID)) - .where(ROLE_BRAND.BRAND_ID.eq(staffInfo.getString("roleBrandId"))) - .and(ROLE.ROLE_NAME.like(bo.getRoleName())) - .and(ROLE.STATUS.eq(bo.getStatus())) - .groupBy(ROLE_BRAND.ID) - .orderBy(ROLE.ORDER_NO.asc()) - , MallRolePageVo.class); - } - - /** - * @descriptions 新增角色 - * @author DB - * @date 2023/10/12 10:48 - * @param bo 请求参数 - * @return: com.cpop.core.base.entity.R - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void insertMallRole(MallRoleBo bo) { - Role role = BeanUtils.mapToClass(bo, Role.class); - SpringUtils.getBean(RoleService.class).save(role); - //将菜单信息录入中间表 - if (!bo.getMenuIds().isEmpty()) { - List roleMenus = new ArrayList<>(); - bo.getMenuIds().forEach(item -> { - RoleMenu roleMenu = new RoleMenu(); - roleMenu.setMenuId(item); - roleMenu.setRoleId(role.getId()); - roleMenus.add(roleMenu); - }); - SpringUtils.getBean(RoleMenuService.class).saveBatch(roleMenus); - } - //录入商城角色品牌表 - RoleBrand roleBrand = new RoleBrand(); - if (StringUtils.isBlank(bo.getBrandId())){ - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - roleBrand.setRoleId(role.getId()) - .setBrandId(loginStaffInfo.getString("brandId")); - } else { - roleBrand.setRoleId(role.getId()) - .setBrandId(bo.getBrandId()); - } - this.save(roleBrand); - } - - /** - * @descriptions 修改角色 - * @author DB - * @date 2023/09/10 17:45 - * @param bo 请求参数 - * @return com.jambox.core.base.R - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void updateMallRole(MallRoleBo bo) { - Role entity = new Role(); - BeanUtils.copyBeanProp(entity, bo); - entity.setId(bo.getRoleId()); - SpringUtils.getBean(RoleService.class).updateById(entity); - //将菜单信息录入中间表 - if (!bo.getMenuIds().isEmpty()) { - //先删后存 - RoleMenuService sysRoleMenuService = SpringUtils.getBean(RoleMenuService.class); - sysRoleMenuService.remove(QueryWrapper.create() - .where(ROLE_MENU.ROLE_ID.eq(entity.getId()))); - List roleMenus = new ArrayList<>(); - bo.getMenuIds().forEach(item -> { - RoleMenu roleMenu = new RoleMenu(); - roleMenu.setMenuId(item); - roleMenu.setRoleId(entity.getId()); - roleMenus.add(roleMenu); - }); - sysRoleMenuService.saveBatch(roleMenus); - } - } - - /** - * @Description: 删除商城角色 - * @param id 主键 - * @return - * @Author DB - * @Date: 2023/10/19 22:34 - */ - @Override - public void removeMallRole(String id) { - //获取中间表 - RoleBrand roleBrand = this.queryChain().where(ROLE_BRAND.ID.eq(id)).one(); - //删除角色 - SpringUtils.getBean(RoleService.class).removeById(roleBrand.getRoleId()); - //删除相关联菜单 - SpringUtils.getBean(RoleMenuService.class).remove(QueryWrapper.create().where(ROLE_MENU.ROLE_ID.eq(roleBrand.getRoleId()))); - this.removeById(id); - } - - /** - * @Description: 设置角色状态 - * @param bo 请求参数 - * @return: R - * @Author: DB - * @Date: 2023/5/9 14:13 - **/ - @Override - public void setMallRoleStatus(RoleStatusBo bo) { - //获取中间表 - RoleBrand roleBrand = this.queryChain().where(ROLE_BRAND.ID.eq(bo.getId())).one(); - SpringUtils.getBean(RoleService.class).updateChain() - .set(ROLE.STATUS, bo.getStatus()) - .where(ROLE.ID.eq(roleBrand.getRoleId())) - .update(); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ShoppingCartServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ShoppingCartServiceImpl.java deleted file mode 100644 index 0f2955e..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/ShoppingCartServiceImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SqlUtils; -import com.cpop.mall.business.bo.ShoppingCartBo; -import com.cpop.mall.business.bo.ShoppingCartPageBo; -import com.cpop.mall.business.vo.MiniShoppingCartPageVo; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.ShoppingCart; -import com.cpop.mall.business.mapper.ShoppingCartMapper; -import com.cpop.mall.business.service.ShoppingCartService; -import org.springframework.stereotype.Service; - -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; -import static com.cpop.mall.business.entity.table.ShoppingCartTableDef.SHOPPING_CART; -import static com.cpop.system.business.entity.table.StoreTableDef.STORE; - -/** - * 商城购物车表 服务层实现。 - * - * @author DB - * @since 2023-11-06 - */ -@Service("shoppingCartService") -public class ShoppingCartServiceImpl extends ServiceImpl implements ShoppingCartService { - - /** - * @descriptions 分页查询小程序-商城-购物车分页 - * @author DB - * @date 2023/11/06 14:02 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getMiniShoppingCartPage(ShoppingCartPageBo bo) { - //获取当前用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(bo.getProductName())) { - queryWrapper.and(PRODUCT.PRODUCT_NAME.like(bo.getProductName())); - } - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), - queryWrapper.select(SHOPPING_CART.ALL_COLUMNS) - //记录 - .select(PRODUCT_RECORD.RECORD_NAMES) - //商品 - .select(PRODUCT.PRODUCT_NAME,PRODUCT.ID.as(MiniShoppingCartPageVo::getProductId),PRODUCT.PIC_URL,PRODUCT.PIC_DETAIL_URL,PRODUCT.PAY_TYPE,PRODUCT.IS_UP) - //校区 - .select(STORE.STORE_NAME) - .from(SHOPPING_CART) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.ID.eq(SHOPPING_CART.PRODUCT_RECORD_ID)) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(PRODUCT_RECORD.PRODUCT_ID)) - .leftJoin(STORE).on(STORE.ID.eq(SHOPPING_CART.STORE_ID)) - .where(SHOPPING_CART.USER_ID.eq(loginUserInfo.getString("userId"))) - .orderBy(SHOPPING_CART.CREATE_TIME.desc()), - MiniShoppingCartPageVo.class); - } - - /** - * @descriptions 小程序-商城-购物车添加商品 - * @author DB - * @date 2023/11/06 14:17 - * @param bo 请求参数 - * @return: void - */ - @Override - public void insertShoppingCart(ShoppingCartBo bo) { - //获取当前用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //查询用户购物车是否有同种商品 - long count = this.count(QueryWrapper.create().where(SHOPPING_CART.PRODUCT_RECORD_ID.eq(bo.getProductRecordId())) - .and(SHOPPING_CART.USER_ID.eq(loginUserInfo.getString("userId")))); - if (count > 0) { - throw new ServiceException("您当前购物车已有此商品,请勿重复添加"); - } - ShoppingCart shoppingCart = BeanUtils.mapToClass(bo, ShoppingCart.class); - shoppingCart.setUserId(loginUserInfo.getString("userId")); - this.save(shoppingCart); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/StaffServiceImpl.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/StaffServiceImpl.java deleted file mode 100644 index 4f61c52..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/service/impl/StaffServiceImpl.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.cpop.mall.business.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.common.constant.Constants; -import com.cpop.common.utils.StringUtils; -import com.cpop.common.utils.bean.BeanUtils; -import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.base.entity.loginInfo.MallStaffLoginInfo; -import com.cpop.system.framework.enums.InitRoleEnum; -import com.cpop.core.base.enums.UserType; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.base.table.SysUser; -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.*; -import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.uuid.IdUtils; -import com.cpop.mall.business.bo.ModifyUserPasswordBo; -import com.cpop.mall.business.bo.StaffBo; -import com.cpop.mall.business.bo.StaffPageBo; -import com.cpop.mall.business.entity.RoleBrand; -import com.cpop.mall.business.service.RoleBrandService; -import com.cpop.mall.business.vo.StaffInfoVo; -import com.cpop.mall.business.vo.StaffPageVo; -import com.cpop.system.business.entity.Brand; -import com.cpop.system.business.service.BrandService; -import com.mybatisflex.core.paginate.Page; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mall.business.entity.Staff; -import com.cpop.mall.business.mapper.StaffMapper; -import com.cpop.mall.business.service.StaffService; -import org.springframework.security.crypto.bcrypt.BCrypt; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; - -import static com.cpop.core.base.table.table.SysUserTableDef.SYS_USER; -import static com.cpop.mall.business.entity.table.RoleBrandTableDef.ROLE_BRAND; -import static com.cpop.mall.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.system.business.entity.table.RoleTableDef.ROLE; -import static com.mybatisflex.core.query.QueryMethods.distinct; -import static com.mybatisflex.core.query.QueryMethods.groupConcat; - -/** - * 员工表 服务层实现。 - * - * @author DB - * @since 2023-10-19 - */ -@Service("staffService") -public class StaffServiceImpl extends ServiceImpl implements StaffService { - - /** - * @descriptions 查询员工分页列表 - * @author DB - * @date 2023/10/20 11:12 - * @param bo 请求参数 - * @return: com.mybatisflex.core.paginate.Page - */ - @Override - public Page getStaffPageList(StaffPageBo bo) { - PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize() - , QueryWrapper.create() - //去重 - .select(distinct(STAFF.ALL_COLUMNS)) - .select(SYS_USER.USER_NAME, SYS_USER.NICK_NAME, SYS_USER.EMAIL, SYS_USER.PHONE_NUMBER, SYS_USER.SEX, SYS_USER.AVATAR, SYS_USER.STATUS, SYS_USER.PASSWORD) - .select(ROLE.ROLE_NAME) - .select(ROLE_BRAND.BRAND_ID) - .select(BRAND.BRAND_NAME) - .from(STAFF) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) - //关键中间表 - .leftJoin(ROLE_BRAND).on(ROLE_BRAND.ID.eq(STAFF.ROLE_BRAND_ID)) - .leftJoin(ROLE).on(ROLE.ID.eq(ROLE_BRAND.ROLE_ID)) - .leftJoin(BRAND).on(BRAND.ID.eq(ROLE_BRAND.BRAND_ID)) - //姓名 - .and(STAFF.NAME.like(bo.getName())) - .and(SYS_USER.USER_NAME.ne(Constants.SUPER_ADMIN).or(SYS_USER.USER_NAME.isNull())) - //不查询超级管理员 - .and(ROLE.ID.ne(InitRoleEnum.SUPER_MALL_ROLE.getId()).or(ROLE.ID.isNull())) - .groupBy(STAFF.ID) - , StaffPageVo.class); - } - - /** - * @descriptions 新增员工 - * @author DB - * @date 2023/10/20 11:24 - * @param bo 请求参数 - * @return: void - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void insertStaff(StaffBo bo) { - //先添加用户信息 - SysUser sysUser; - if (validatedUserInfo(bo)) { - throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist")); - } else { - //用户名-手机-邮箱都需要做唯一校验 - sysUser = BeanUtils.mapToClass(bo, SysUser.class); - //解密与重设密码 - decryptAndResetPasswords(sysUser); - sysUser.setId(IdUtils.fastSimpleUUID()); - //获取当前创建人员信息 - LoginUser loginUser = SecurityUtils.getInstance().getLoginUser(); - sysUser.setCreateUserId(loginUser.getUserId()); - sysUser.setUpdateUserId(loginUser.getUserId()); - sysUser.setUserType(UserType.MALL_USER.toString()); - SpringUtils.getBean(CoreService.class).insertSysUser(sysUser); - } - //再添加员工信息 - RoleBrand roleBrand = new RoleBrand(); - Staff staff = new Staff(); - RoleBrandService roleBrandService = SpringUtils.getBean(RoleBrandService.class); - //如果有传入品牌(超级管理员初始化管理账户) - if (StringUtils.isNotBlank(bo.getBrandId())) { - roleBrand.setBrandId(bo.getBrandId()); - } else { - //获取当前用户信息 - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - roleBrand.setBrandId(loginStaffInfo.getString("brandId")); - } - //获取品牌信息 - Brand brand = SpringUtils.getBean(BrandService.class).queryChain().where(BRAND.ID.eq(roleBrand.getBrandId())).one(); - roleBrand.setRoleId(bo.getRoleId()); - //设置中间表 - roleBrandService.save(roleBrand); - staff.setUserId(sysUser.getId()) - .setName(bo.getName()) - .setRoleBrandId(roleBrand.getId()) - .setSourceType(brand.getSourceType()); - this.save(staff); - } - - /** - * @descriptions 修改员工 - * @author DB - * @date 2023/10/20 11:36 - * @param bo 请求参数 - * @return: void - */ - @Override - public void updateStaff(StaffBo bo) { - //先修改系统用户信息 用户名-手机-邮箱都需要做唯一校验 - if (validatedUserInfo(bo)) { - throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist")); - } else { - SysUser sysUser = BeanUtils.mapToClass(bo, SysUser.class); - sysUser.setId(bo.getUserId()); - //密码在这里不做修改 - sysUser.setPassword(null); - sysUser.setUpdateUserId(SecurityUtils.getInstance().getLoginUser().getUserId()); - sysUser.setUpdateTime(LocalDateTime.now()); - SpringUtils.getBean(CoreService.class).updateSysUser(sysUser); - } - //角色品牌 - RoleBrandService roleBrandService = SpringUtils.getBean(RoleBrandService.class); - RoleBrand roleBrand = roleBrandService.getById(bo.getRoleBrandId()); - roleBrand.setRoleId(bo.getRoleId()); - roleBrandService.updateById(roleBrand); - //再修改员工信息 - Staff staff = new Staff(); - staff.setName(bo.getName()) - .setId(bo.getId()); - this.updateById(staff); - //获取缓存信息 - RedisService redisService = SpringUtils.getBean(RedisService.class); - JSONObject jsonObject = redisService.getCacheObject(UserType.MINI_USER.getKey() + bo.getUserName()); - if (jsonObject != null) { - LoginUser loginUser = jsonObject.getObject("user", LoginUser.class); - MallStaffLoginInfo staffLoginInfo = BeanUtils.mapToClass(bo, MallStaffLoginInfo.class); - loginUser.setUser(staffLoginInfo); - redisService.setCacheObject(UserType.MINI_USER.getKey() + loginUser.getIdentification(), loginUser); - } - } - - /** - * @Description: 用户名-手机-邮箱都需要做唯一校验 - * @param bo 请求参数 - * @return Boolean 通过/未通过 - * @Author DB - * @Date: 2023/5/11 11:02 - **/ - private Boolean validatedUserInfo(StaffBo bo) { - long count = this.count(QueryWrapper.create() - //用户名 - .where(SYS_USER.USER_NAME.eq(bo.getUserName())) - //手机号 - .or(SYS_USER.PHONE_NUMBER.eq(bo.getPhoneNumber())) - .and(SYS_USER.USER_TYPE.eq(UserType.MALL_USER)) - .from(SYS_USER)); - if (StringUtils.isNotBlank(bo.getUserId())) { - return count > 1; - } else { - return count > 0; - } - } - - /** - * @Description: 解密与重设密码 - * @param sysUser 系统用户 - * @Author: DB - * @Date: 2023/5/11 11:03 - **/ - private void decryptAndResetPasswords(SysUser sysUser) { - //先用rsa解密 - String password = SpringUtils.getBean(RsaUtils.class).decrypt(sysUser.getPassword()); - //再加密 - sysUser.setPassword(SpringUtils.getBean(PasswordEncoder.class).encode(password)); - } - - /** - * @descriptions 删除员工 - * @author DB - * @date 2023/10/20 11:44 - * @param id 主键 - * @return: void - */ - @Override - public void removeStaffById(String id) { - //先获取员工 - Staff staff = this.getById(id); - if (null == staff) { - throw new ServiceException("获取信息失败,请联系相关人员"); - } - //删除用户 - SpringUtils.getBean(CoreService.class).removeSysUserById(staff.getUserId()); - //删除中间表 - SpringUtils.getBean(RoleBrandService.class).removeById(staff.getRoleBrandId()); - //删除员工 - this.removeById(id); - } - - /** - * @descriptions 用户名是否存在 - * @author DB - * @date 2023/10/20 11:55 - * @param username 用户名 - * @param id 主键 - * @return: void - */ - @Override - public void isAccountExist(String username, String id) { - if (StringUtils.isBlank(username)){ - return; - } - if (this.count(QueryWrapper.create() - .where(SYS_USER.USER_NAME.eq(username)) - .and(SYS_USER.USER_TYPE.eq(UserType.MALL_USER)) - .and(SYS_USER.ID.ne(id))) > 0) { - throw new ServiceException(MessageUtils.message("i18n_alert_userIsExist")); - } - } - - /** - * @descriptions 获取员工信息 - * @author DB - * @date 2023/10/20 12:00 - * @param id 主键 - * @return: com.cpop.mall.business.vo.StaffInfoVo - */ - @Override - public StaffInfoVo getStaffInfo(String id) { - return this.getOneAs(QueryWrapper.create() - .select(STAFF.ALL_COLUMNS) - .select(SYS_USER.USER_NAME, SYS_USER.NICK_NAME, SYS_USER.SEX, SYS_USER.PHONE_NUMBER, SYS_USER.ID.as(StaffInfoVo::getUserId)) - .select(ROLE_BRAND.ROLE_ID) - .select(ROLE.ROLE_NAME) - .from(STAFF) - .leftJoin(ROLE_BRAND).on(ROLE_BRAND.ID.eq(STAFF.ROLE_BRAND_ID)) - .leftJoin(SYS_USER).on(SYS_USER.ID.eq(STAFF.USER_ID)) - .leftJoin(ROLE).on(ROLE.ID.eq(ROLE_BRAND.ROLE_ID)) - .where(STAFF.ID.eq(id)) - , StaffInfoVo.class); - } - - /** - * @descriptions 修改系统用户密码 - * @author DB - * @date 2023/10/20 12:04 - * @param bo 请求体 - * @return: void - */ - @Override - public void modifyUserPassword(ModifyUserPasswordBo bo) { - //只允许超级管理员或自己修改面膜 - JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); - String userName = loginStaffInfo.getString("userName"); - //同数据库密码进行比较 - SysUser user = DbChain.table(SYS_USER) - .where(SYS_USER.ID.eq(bo.getUserId())) - .oneAs(SysUser.class); - if (!StringUtils.equals(userName, Constants.SUPER_ADMIN) || !StringUtils.equals(userName, user.getUserName())) { - throw new ServiceException("非超级管理员不允许修改他人密码"); - } - //先用rsa解密 - RsaUtils rsaUtils = SpringUtils.getBean(RsaUtils.class); - String oldPassword = rsaUtils.decrypt(bo.getOldPassword()); - if (BCrypt.checkpw(oldPassword, user.getPassword())) { - //存入系统 - DbChain.table(SYS_USER) - .set(SYS_USER.PASSWORD,SpringUtils.getBean(PasswordEncoder.class).encode(rsaUtils.decrypt(bo.getNewPassword()))) - .where(SYS_USER.ID.eq(bo.getUserId())) - .update(); - } else { - throw new ServiceException(MessageUtils.message("i18n_alert_oldPasswordIsWrong")); - } - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/BrandListVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/BrandListVo.java deleted file mode 100644 index 47401ef..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/BrandListVo.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * Description: - * date: 2023/6/2 17:39 - * - * @author DB - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Brand对象", description = "品牌表") -public class BrandListVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 云函数id - */ - @ApiModelProperty("品牌名") - private String brandName; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselListVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselListVo.java deleted file mode 100644 index ddcb820..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselListVo.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-15 14:51 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Brand对象", description = "品牌表") -public class CarouselListVo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 产品id - */ - @ApiModelProperty(value = "产品id") - private String productId; - - /** - * 图片地址 - */ - @ApiModelProperty(value = "图片地址") - private String picUrl; - - /** - * 排序 - */ - @ApiModelProperty(value = "排序") - private Integer orderNo; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselPageVo.java deleted file mode 100644 index 6788069..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/CarouselPageVo.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-15 12:54 - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Brand对象", description = "品牌表") -public class CarouselPageVo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 产品id - */ - @ApiModelProperty(value = "产品id") - private String productId; - - /** - * 产品名称 - */ - @ApiModelProperty(value = "产品名称") - private String productName; - - /** - * 图片地址 - */ - @ApiModelProperty(value = "图片地址") - private String picUrl; - - /** - * 排序 - */ - @ApiModelProperty(value = "排序") - private Integer orderNo; - - /** - * 上架状态(0:下架;1:上架) - */ - @ApiModelProperty(value = "上架状态(0:下架;1:上架)") - private Boolean upStatus; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/JamboxCardTemplateListVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/JamboxCardTemplateListVo.java deleted file mode 100644 index 00d6967..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/JamboxCardTemplateListVo.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @Description: 果酱课卡返回 - * @create 2023-10-28 22:21 - */ -@Data -@Accessors(chain = true) -@ApiModel("果酱模板返回") -public class JamboxCardTemplateListVo implements Serializable { - - /** - * 果酱模板id - */ - @ApiModelProperty("果酱模板id") - private String id; - - /** - * 模板名 - */ - @ApiModelProperty(value = "模板名") - private String name; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MallRolePageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MallRolePageVo.java deleted file mode 100644 index 281d051..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MallRolePageVo.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.Column; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/10/19 18:28 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "Role分页返回对象") -public class MallRolePageVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 角色id - */ - @ApiModelProperty("角色id") - private String roleId; - - /** - * 角色名称 - */ - @ApiModelProperty("角色名称") - private String roleName; - - /** - * 角色值 - */ - @ApiModelProperty("角色值") - private String roleValue; - - /** - * 状态 - */ - @ApiModelProperty("状态") - private Boolean status; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remark; - - /** - * 排序 - */ - @ApiModelProperty("排序") - private Integer orderNo; - - /** - * 更新时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("更新时间") - private LocalDateTime updateTime; - - /** - * 角色所属菜单id集合 - */ - @StringArrayConvert - @ApiModelProperty("角色所属菜单id集合") - @Column(ignore = true) - private String menuIds; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniProductPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniProductPageVo.java deleted file mode 100644 index ac2f153..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniProductPageVo.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.RelationOneToMany; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author DB - * @createTime 2023/10/27 13:39 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品分页返回对象") -public class MiniProductPageVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他) - */ - @ApiModelProperty("产品类型(0:课卡;1:周边;2:优惠卷:3:其他)") - private Integer productType; - - /** - * 商店(校区)集合 - */ - @ApiModelProperty("商店(校区)集合") - private String storeIds; - - /** - * 描述 - */ - @ApiModelProperty("描述") - private String description; - - /** - * 商品图地址 - */ - @ApiModelProperty("商品图地址") - private String picUrl; - - /** - * 商品详情图地址 - */ - @ApiModelProperty("商品详情图地址") - private String picDetailUrl; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - @ApiModelProperty("购买限制(0:会员限制;1:新客限定;2:用户限购)") - private Integer buyRestrict; - - /** - * 最高价 - */ - @ApiModelProperty("最高价") - private BigDecimal maxConsume; - - /** - * 最低价 - */ - @ApiModelProperty("最低价") - private BigDecimal minConsume; - - /** - * 支付方式(微信支付:0;积分支付:1) - */ - @ApiModelProperty("支付方式(微信支付:0;积分支付:1)") - private Integer payType; - - /** - * 产品规格 - */ - @RelationOneToMany(selfField = "id", targetField = "productId",targetTable = "cp_mall_product_specification") - @ApiModelProperty("产品规格") - private List productSpecificationVos; - - /** - * 产品规格记录 - */ - @RelationOneToMany(selfField = "id", targetField = "productId",targetTable = "cp_mall_product_record") - @ApiModelProperty("产品规格记录") - private List productRecordVos; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniShoppingCartPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniShoppingCartPageVo.java deleted file mode 100644 index b3e9809..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/MiniShoppingCartPageVo.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/11/06 13:53 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "小程序-商城-购物车分页返回对象") -public class MiniShoppingCartPageVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 用户id - */ - @ApiModelProperty("用户id") - private String userId; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 规格名 - */ - @ApiModelProperty("规格名") - private String recordNames; - - /** - * 商品记录id - */ - @ApiModelProperty("商品记录id") - private String productRecordId; - - /** - * 店铺/校区id - */ - @ApiModelProperty("店铺/校区id") - private String storeId; - - /** - * 店铺/校区名 - */ - @ApiModelProperty("店铺/校区名") - private String storeName; - - /** - * 金额 - */ - @ApiModelProperty("金额") - private BigDecimal amount; - - /** - * 积分 - */ - @ApiModelProperty("积分") - private Integer point; - - /** - * 数量 - */ - @ApiModelProperty("数量") - private Integer number; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - /** - * 支付类型 - */ - @ApiModelProperty("支付类型") - private Integer payType; - - /** - *商品id - */ - @ApiModelProperty("商品id") - private String productId; - - - /** - * 商品图地址 - */ - @ApiModelProperty("商品图地址") - private String picUrl; - - /** - * 商品详情图地址 - */ - @ApiModelProperty("商品详情图地址") - private String picDetailUrl; - - /** - * 上下架(0下1上) - */ - @ApiModelProperty("上下架") - private Boolean isUp; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderDetailVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderDetailVo.java deleted file mode 100644 index e6a7dd0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderDetailVo.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/10/24 15:17 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单详情返回对象") -public class OrderDetailVo implements Serializable { - - /** - * 订单id - */ - @ApiModelProperty("订单id") - private String orderId; - - /** - * 商品记录id - */ - @ApiModelProperty("商品记录id") - private String productRecordId; - - /** - * 商品规格 - */ - @ApiModelProperty("商品规格") - private String recordNames; - - /** - * 店铺(校区)id - */ - @ApiModelProperty("店铺(校区)id") - private String storeId; - - /** - * 店铺名 - */ - @ApiModelProperty("店铺名") - private String storeName; - - /** - * 金额 - */ - @ApiModelProperty("金额") - private BigDecimal amount; - - /** - * 积分 - */ - @ApiModelProperty("积分") - private Integer point; - - /** - * 积分 - */ - @ApiModelProperty("产品名") - private String productName; - - /** - * 积分 - */ - @ApiModelProperty("微缩图") - private String picUrl; - - /** - * 积分 - */ - @ApiModelProperty("详情图") - private String picDetailUrl; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderInfoVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderInfoVo.java deleted file mode 100644 index 23c304b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderInfoVo.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.RelationOneToMany; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author DB - * @createTime 2023/11/03 15:54 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单详情返回对象") -public class OrderInfoVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中) - */ - @ApiModelProperty("订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中)") - private Integer orderStatus; - - /** - * 总金额 - */ - @ApiModelProperty("总金额") - private BigDecimal totalAmount; - - /** - * 总积分 - */ - @ApiModelProperty("总积分") - private Long totalPoint; - - /** - * 支付类型 - */ - @ApiModelProperty("支付类型") - private Integer payType; - - /** - * 下单用户名 - */ - @ApiModelProperty("下单用户名") - private String payUserName; - - /** - * 收货人名 - */ - @ApiModelProperty("收货人名") - private String receiveName; - - /** - * 收货人电话 - */ - @ApiModelProperty("收货人电话") - private String receivePhone; - - /** - * 收货地址 - */ - @ApiModelProperty("收货地址") - private String receiveAddress; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productNames; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remarks; - - /** - * 下单时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("下单时间") - private LocalDateTime createTime; - - /** - * 订单详情vo - */ - @ApiModelProperty("订单详情") - private List detailList; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderPageVo.java deleted file mode 100644 index 36ad359..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderPageVo.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author DB - * @createTime 2023/10/24 15:14 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单分页返回对象") -public class OrderPageVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中) - */ - @ApiModelProperty("订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中)") - private Integer orderStatus; - - /** - * 外部订单号 - */ - @ApiModelProperty("外部订单号") - private String outOrderNo; - - /** - * 总金额 - */ - @ApiModelProperty("总金额") - private BigDecimal totalAmount; - - /** - * 总积分 - */ - @ApiModelProperty("总积分") - private Long totalPoint; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 支付类型 - */ - @ApiModelProperty("支付类型") - private Integer payType; - - /** - * 下单用户id - */ - @ApiModelProperty("下单用户id") - private String payUserId; - - /** - * 下单用户名 - */ - @ApiModelProperty("下单用户名") - private String payUserName; - - /** - * 收货人名 - */ - @ApiModelProperty("收货人名") - private String receiveName; - - /** - * 收货人电话 - */ - @ApiModelProperty("收货人电话") - private String receivePhone; - - /** - * 收货地址 - */ - @ApiModelProperty("收货地址") - private String receiveAddress; - - /** - * 物流订单号 - */ - @ApiModelProperty("物流订单号") - private String logisticsOrder; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productNames; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remarks; - - /** - * 下单时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("下单时间") - private LocalDateTime createTime; - - /** - * 订单详情vo - */ - @ApiModelProperty("订单详情") - private List detailList; - - /** - * 订单退款相关参数 - */ - @ApiModelProperty("订单退款相关参数") - private OrderRefundVo orderRefundVo; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundPageVo.java deleted file mode 100644 index 2a3ddbf..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundPageVo.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/10/27 17:34 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城退款分页返回对象") -public class OrderRefundPageVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 订单id - */ - @ApiModelProperty("订单id") - private String orderId; - - /** - * 订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中) - */ - @ApiModelProperty("订单状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中)") - private Integer orderStatus; - - /** - * 外部订单号 - */ - @ApiModelProperty("外部订单号") - private String outOrderNo; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productNames; - - /** - * 总金额 - */ - @ApiModelProperty("总金额") - private BigDecimal totalAmount; - - /** - * 总积分 - */ - @ApiModelProperty("总积分") - private Long totalPoint; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 品牌名 - */ - @ApiModelProperty("品牌名") - private String brandName; - - /** - * 下单用户id - */ - @ApiModelProperty("下单用户id") - private String payUserId; - - /** - * 下单用户 - */ - @ApiModelProperty("下单用户") - private String payUserName; - - /** - * 收货人名 - */ - @ApiModelProperty("收货人名") - private String receiveName; - - /** - * 收货人电话 - */ - @ApiModelProperty("收货人电话") - private String receivePhone; - - /** - * 收货地址 - */ - @ApiModelProperty("收货地址") - private String receiveAddress; - - /** - * 物流订单号 - */ - @ApiModelProperty("物流订单号") - private String logisticsOrder; - - /** - * 备注 - */ - @ApiModelProperty("备注") - private String remarks; - - /** - * 申请退款时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("申请退款时间") - private LocalDateTime createTime; - - /** - * 退款原因 - */ - @ApiModelProperty("退款原因") - private String refundReason; - - /** - * 退款状态 - */ - @ApiModelProperty("退款状态") - private Integer refundStatus; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundVo.java deleted file mode 100644 index 65ca8e1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/OrderRefundVo.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/11/14 9:37 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城订单退款返回对象") -public class OrderRefundVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 退款状态 - */ - @ApiModelProperty("退款状态") - private Integer refundStatus; - - /** - * 订单id - */ - @ApiModelProperty("订单id") - private String orderId; - - /** - * 退款外部id - */ - @ApiModelProperty("退款外部id") - private String outRefundId; - - /** - * 退款原因 - */ - @ApiModelProperty("退款原因") - private String refundReason; - - /** - * 拒绝原因 - */ - @ApiModelProperty("拒绝原因") - private String rejectReason; - - /** - * 创建时间 - */ - @ApiModelProperty("创建时间") - private LocalDateTime createTime; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductEvaluateVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductEvaluateVo.java deleted file mode 100644 index e475a93..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductEvaluateVo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/10/26 17:02 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品评价分页返回对象") -public class ProductEvaluateVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 产品id - */ - @ApiModelProperty("产品id") - private String productId; - - /** - * 订单id - */ - @ApiModelProperty("订单id") - private String orderId; - - /** - * 评价 - */ - @ApiModelProperty("评价") - private String evaluate; - - /** - * 星 - */ - @ApiModelProperty("星") - private Double start; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductInfoVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductInfoVo.java deleted file mode 100644 index 4ced790..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductInfoVo.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.RelationOneToMany; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author DB - * @createTime 2023/11/06 11:55 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品详情返回对象") -public class ProductInfoVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他) - */ - @ApiModelProperty("产品类型(0:课卡;1:周边;2:优惠卷:3:其他)") - private Integer productType; - - /** - * 商店(校区)集合 - */ - @StringArrayConvert - @ApiModelProperty("商店(校区)集合") - private String storeIds; - - /** - * 模板id - */ - @ApiModelProperty("模板Id") - private String cardTemplateId; - - /** - * 模板名 - */ - @ApiModelProperty("模板名") - private String cardTemplateName; - - /** - * 描述 - */ - @ApiModelProperty("描述") - private String description; - - /** - * 商品图地址 - */ - @ApiModelProperty("商品图地址") - private String picUrl; - - /** - * 限购数量 - */ - @ApiModelProperty("限购数量") - private Integer limitNum; - - - /** - * 商品详情图地址 - */ - @ApiModelProperty("商品详情图地址") - private String picDetailUrl; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - @ApiModelProperty("购买限制(0:会员限制;1:新客限定;2:用户限购)") - private Integer buyRestrict; - - /** - * 最高价 - */ - @ApiModelProperty("最高消耗") - private BigDecimal maxConsume; - - /** - * 最低价 - */ - @ApiModelProperty("最低消耗") - private BigDecimal minConsume; - - /** - * 支付方式(微信支付:0;积分支付:1) - */ - @ApiModelProperty("支付方式(微信支付:0;积分支付:1)") - private Integer payType; - - /** - * 产品规格 - */ - @RelationOneToMany(selfField = "id", targetField = "productId",targetTable = "cp_mall_product_specification") - @ApiModelProperty("产品规格") - private List productSpecificationVos; - - /** - * 产品规格记录 - */ - @RelationOneToMany(selfField = "id", targetField = "productId",targetTable = "cp_mall_product_record") - @ApiModelProperty("产品规格记录") - private List productRecordVos; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductPageVo.java deleted file mode 100644 index e9eab1b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductPageVo.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.mybatisflex.annotation.RelationOneToMany; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/10/23 11:57 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品分页返回对象") -public class ProductPageVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 商品名 - */ - @ApiModelProperty("商品名") - private String productName; - - /** - * 产品类型(0:课卡;1:周边;2:优惠卷:3:其他) - */ - @ApiModelProperty("产品类型(0:课卡;1:周边;2:优惠卷:3:其他)") - private Integer productType; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 商店(校区)集合 - */ - @StringArrayConvert - @ApiModelProperty("商店(校区)集合") - private String storeIds; - - /** - * 商店(校区)集合 - */ - @ApiModelProperty("商店(校区)集合") - private String authorizedStoreNames; - - /** - * 描述 - */ - @ApiModelProperty("描述") - private String description; - - /** - * 上下架 - */ - @ApiModelProperty("上下架") - private Boolean isUp; - - /** - * 是否置顶 - */ - @ApiModelProperty("是否置顶") - private Boolean isTop; - - /** - * 商品图地址 - */ - @ApiModelProperty("商品图地址") - private String picUrl; - - /** - * 商品详情图片地址 - */ - @ApiModelProperty("商品详情图片地址") - private String picDetailUrl; - - /** - * 购买限制(0:会员限制;1:新客限定;2:用户限购) - */ - @ApiModelProperty("购买限制(0:会员限制;1:新客限定;2:用户限购)") - private Integer buyRestrict; - - /** - * 最高消费 - */ - @ApiModelProperty("最高消费") - private BigDecimal maxConsume; - - /** - * 最低消费 - */ - @ApiModelProperty("最低消费") - private BigDecimal minConsume; - - /** - * 限购数量 - */ - @ApiModelProperty("限购数量") - private Integer limitNum; - - /** - * 支付方式(微信支付:0;积分支付:1) - */ - @ApiModelProperty("支付方式(微信支付:0;积分支付:1)") - private Integer payType; - - /** - * 商品交易成功信息 - */ - @ApiModelProperty("商品交易成功信息") - private ProductTradeInfo tradeInfo; - - /** - * 创建时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - @ApiModelProperty("创建时间") - private LocalDateTime createTime; - - /** - * 商品交易成功信息 - */ - @Data - @ApiModel("商品交易成功信息") - public static class ProductTradeInfo implements Serializable{ - /** - * 交易数量 - */ - @ApiModelProperty("交易数量") - private Long tradeNum = 0L; - - /** - * 交易金额 - */ - @ApiModelProperty("交易金额") - private BigDecimal tradePrice = BigDecimal.ZERO; - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductRecordVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductRecordVo.java deleted file mode 100644 index ace7b87..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductRecordVo.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/10/23 17:36 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品记录返回对象") -public class ProductRecordVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 商品id - */ - @ApiModelProperty("商品id") - private String productId; - - /** - * 规格集合 - */ - @StringArrayConvert - @ApiModelProperty("规格集合") - private String recordNames; - - /** - * 数量 - */ - @ApiModelProperty("数量") - private Integer recordNum; - - /** - * 记录消耗金额 - */ - @ApiModelProperty("记录消耗金额") - private BigDecimal recordPrice; - - /** - * 记录消耗积分 - */ - @ApiModelProperty("记录消耗积分") - private Integer recordPoints; - - /** - * 标记 - */ - @ApiModelProperty("标记") - private Integer version; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSimpleVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSimpleVo.java deleted file mode 100644 index 053acce..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSimpleVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author DB - * @version 1.0.0 - * @since 2024-01-15 14:06 - */ -@Data -public class ProductSimpleVo { - - /** - * 主键 - */ - @ApiModelProperty(value = "主键") - private String id; - - /** - * 商品名称 - */ - @ApiModelProperty(value = "商品名称") - private String productName; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationCreateVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationCreateVo.java deleted file mode 100644 index 154d1f1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationCreateVo.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @author DB - * @createTime 2023/10/23 12:37 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品规格创建返回对象") -public class ProductSpecificationCreateVo implements Serializable { - - /** - * 规格名 - */ - @StringArrayConvert - @ApiModelProperty("规格名") - private String specificationNames; - - /** - * 数量 - */ - @ApiModelProperty("数量") - private Integer recordNum; - - /** - * 记录消耗金额 - */ - @ApiModelProperty("记录消耗金额") - private BigDecimal recordPrice; - - /** - * 记录消耗积分 - */ - @ApiModelProperty("记录消耗积分") - private Integer recordPoints; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationVo.java deleted file mode 100644 index 6aa46b1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/ProductSpecificationVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.cpop.core.anno.StringArrayConvert; -import com.mybatisflex.annotation.Id; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author DB - * @createTime 2023/10/23 17:33 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城商品规格返回对象") -public class ProductSpecificationVo implements Serializable { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 产品id - */ - @ApiModelProperty("产品id") - private String productId; - - /** - * 规格名 - */ - @ApiModelProperty("规格名") - @StringArrayConvert - private String specificationNames; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffInfoVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffInfoVo.java deleted file mode 100644 index 6bbe992..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffInfoVo.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * Description: - * date: 2023/5/17 10:34 - * - * @Author ST - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "StaffInfo对象", description = "员工信息") -public class StaffInfoVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 姓名 - */ - @ApiModelProperty("姓名") - private String name; - - /** - * 用户id - */ - @ApiModelProperty("用户id") - private String userId; - - /** - * 角色-品牌-id - */ - @ApiModelProperty("角色-品牌-id") - private String roleBrandId; - - /** - * 用户名 - */ - @ApiModelProperty(value = "用户名") - private String userName; - - /** - * 昵称 - */ - @ApiModelProperty(value = "昵称") - private String nickName; - - /** - * 手机号 - */ - @ApiModelProperty(value = "手机号") - private String phoneNumber; - - /** - * 性别(0:男;1:女) - */ - @ApiModelProperty(value = "性别(0:男;1:女)") - private Boolean sex; - - /** - * 角色id - */ - @ApiModelProperty(value = "角色id") - private String roleId; - - /** - * 角色名 - */ - @ApiModelProperty(value = "角色名") - private String roleName; - - /** - * 头像 - */ - @ApiModelProperty(value = "头像") - private String avatar; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffPageVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffPageVo.java deleted file mode 100644 index f1ff053..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StaffPageVo.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.cpop.mall.business.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * @author DB - * @createTime 2023/10/20 11:06 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "商城员工分页返回对象") -public class StaffPageVo implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id; - - /** - * 姓名 - */ - @ApiModelProperty("姓名") - private String name; - - /** - * 用户id - */ - @ApiModelProperty("用户id") - private String userId; - - /** - * 角色-品牌-id - */ - @ApiModelProperty("角色-品牌-id") - private String roleBrandId; - - /** - * 品牌id - */ - @ApiModelProperty("品牌id") - private String brandId; - - /** - * 品牌 - */ - @ApiModelProperty("品牌") - private String brandName; - - /** - * 用户名 - */ - @ApiModelProperty("用户名") - private String userName; - - /** - * 昵称 - */ - @ApiModelProperty("昵称") - private String nickName; - - /** - * 邮箱 - */ - @ApiModelProperty("邮箱") - private String email; - - /** - * 手机号 - */ - @ApiModelProperty("手机号") - private String phoneNumber; - - /** - * 性别(0:男;1:女) - */ - @ApiModelProperty("性别(0:男;1:女)") - private Boolean sex; - - /** - * 头像 - */ - @ApiModelProperty("头像") - private String avatar; - - /** - * 状态(0:停用;1:启用) - */ - @ApiModelProperty("状态(0:停用;1:启用)") - private Boolean status; - - /** - * 角色id - */ - @ApiModelProperty("角色id") - private String roleId; - - /** - * 角色名 - */ - @ApiModelProperty("角色名") - private String roleName; - - /** - * 更新时间 - */ - @ApiModelProperty("更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") - private LocalDateTime updateTime; - - /** - * 密码 - */ - @ApiModelProperty("密码") - private String password; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StoreListVo.java b/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StoreListVo.java deleted file mode 100644 index 21da582..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/business/vo/StoreListVo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cpop.mall.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * @author DB - * @createTime 2023/10/26 15:30 - * @description - */ -@Data -@Accessors(chain = true) -@ApiModel(value = "店铺/校区返回对象") -public class StoreListVo { - - /** - * 主键 - */ - @ApiModelProperty("主键") - private String id ; - - /** - * 店铺/校区名 - */ - @ApiModelProperty("店铺/校区名") - private String storeName; - - /** - * 外部id - */ - @ApiModelProperty("外部id") - private String outId; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/constant/MallRedisConstant.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/constant/MallRedisConstant.java deleted file mode 100644 index ffce9d5..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/constant/MallRedisConstant.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.cpop.mall.framework.constant; - -/** - * 商城redis实体类 - */ -public interface MallRedisConstant { - - /** - * 库存记录redis - */ - String STOCK_RECORD_NUM = "mall:stock:recordNum:"; - - /** - * 用户创建预订单(用户id) - */ - String IDEMPOTENT_LOCK_CREATE_ADVANCE_ORDER = "mall:idempotentLock:createAdvanceOrder:"; - - /** - * 用户下单幂等锁(用户id) - */ - String IDEMPOTENT_LOCK_USER_PAY = "mall:idempotentLock:userPay:"; -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/BuyRestrictEnums.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/BuyRestrictEnums.java deleted file mode 100644 index d5a4ac4..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/BuyRestrictEnums.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.cpop.mall.framework.enums; - -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.framework.strategy.buyRestrict.BuyRestrictStrategy; -import com.cpop.mall.framework.strategy.buyRestrict.MemberRestrictStrategy; -import com.cpop.mall.framework.strategy.buyRestrict.NewCustomerRestrictStrategy; -import com.cpop.mall.framework.strategy.buyRestrict.UserRestrictStrategy; -import lombok.Getter; - -import javax.swing.*; -import java.util.HashMap; -import java.util.Map; - -/** - * @author DB - * @createTime 2023/11/06 15:21 - * @description 购买限制枚举 - */ -@Getter -public enum BuyRestrictEnums { - /** - * 会员限制 - */ - MEMBER_RESTRICT(0, "会员限制", SpringUtils.getBean(MemberRestrictStrategy.class)), - /** - * 新客限定 - */ - NEW_CUSTOMER_RESTRICT(1, "新客限定", SpringUtils.getBean(NewCustomerRestrictStrategy.class)), - /** - * 用户限购 - */ - USER_RESTRICT(2, "用户限购", SpringUtils.getBean(UserRestrictStrategy.class)) - ; - - private Integer code; - - private String name; - - private BuyRestrictStrategy buyRestrictStrategy; - - BuyRestrictEnums(Integer code, String name, BuyRestrictStrategy buyRestrictStrategy) { - this.code = code; - this.name = name; - this.buyRestrictStrategy = buyRestrictStrategy; - } - - public void setCode(Integer code) { - this.code = code; - } - - public void setName(String name) { - this.name = name; - } - - /** - * 放入map中,通过键取值 - */ - private static Map buyRestrictMap = new HashMap<>(); - - static { - for (BuyRestrictEnums value : BuyRestrictEnums.values()) { - buyRestrictMap.put(value.getCode(), value); - } - } - - /** - * 根据code获取枚举 - * @param code - * @return - */ - public static BuyRestrictEnums getByCode(Integer code) { - return buyRestrictMap.get(code); - } - -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/QuartzEnums.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/QuartzEnums.java deleted file mode 100644 index a3f0785..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/enums/QuartzEnums.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.cpop.mall.framework.enums; - -import lombok.Getter; - -@Getter -public enum QuartzEnums { - - /** - * 订单超时未支付过期定时任务 - */ - ORDER_OVERTIME_UN_PAY_TASK("OrderOvertimeUnPayTask:", "Order"); - - QuartzEnums(String name, String group) { - this.name = name; - this.group = group; - } - - /** - * 名 - */ - private String name; - - /** - * 组 - */ - private String group; - - public void setName(String name) { - this.name = name; - } - - public void setGroup(String group) { - this.group = group; - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/BuyRestrictStrategy.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/BuyRestrictStrategy.java deleted file mode 100644 index ed267d0..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/BuyRestrictStrategy.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.cpop.mall.framework.strategy.buyRestrict; - -import com.cpop.mall.business.entity.Product; - -import java.util.Map; - -/** - * 购买策略接口 - */ -public interface BuyRestrictStrategy { - - /** - * @descriptions 购买限制 - * @author DB - * @date 2023/11/06 15:21 - * @return: void - */ - void buyRestrict(Product product, Map recordNumIsEnough); -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/MemberRestrictStrategy.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/MemberRestrictStrategy.java deleted file mode 100644 index b35a179..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/MemberRestrictStrategy.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.cpop.mall.framework.strategy.buyRestrict; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.BrandExtend; -import com.cpop.jambox.business.service.BrandExtendService; -import com.cpop.mall.business.entity.Product; -import com.mybatisflex.core.datasource.DataSourceKey; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import org.springframework.stereotype.Component; - -import java.time.LocalDate; -import java.util.Map; - -import static com.cpop.jambox.business.entity.table.BrandExtendTableDef.BRAND_EXTEND; - -/** - * @author DB - * @createTime 2023/11/06 15:26 - * @description - */ -@Component -public class MemberRestrictStrategy implements BuyRestrictStrategy{ - - /** - * @descriptions 会员购买策略 - * @author DB - * @date 2023/11/06 15:47 - * @param product 商品 - * @return: void - */ - @Override - public void buyRestrict(Product product, Map recordNumIsEnough) { - // 获取当前用户信息 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - //获取品牌信息 - BrandExtend brandExtend = SpringUtils.getBean(BrandExtendService.class).queryChain() - .where(BRAND_EXTEND.BRAND_ID.eq(loginUserInfo.getString("brandId"))) - .one(); - //查询当前用户是否是会员 - try { - DataSourceKey.use("jambox"); - long count = Db.selectCountByQuery("j_membership", QueryWrapper.create() - .select() - .leftJoin("t_brand_info").on("t_brand_info.brand_id = j_membership.brand_id") - //手机号 - .where("j_membership.phone = ?", loginUserInfo.getString("phoneNumber")) - //品牌id - .and("t_brand_info.brand_id = ?", brandExtend.getBrandCloudId()) - //会员时间未过期 - .and("j_membership.end_time >= ?", LocalDate.now()) - .and("j_membership.deleted = 1")); - //没有会员 - if (count == 0) { - throw new ServiceException("你尚未成为会员,无法购买商品:" + product.getProductName()); - } - } finally { - DataSourceKey.clear(); - } - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/NewCustomerRestrictStrategy.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/NewCustomerRestrictStrategy.java deleted file mode 100644 index c1ec8a8..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/NewCustomerRestrictStrategy.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cpop.mall.framework.strategy.buyRestrict; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.service.OrderService; -import com.mybatisflex.core.logicdelete.LogicDeleteManager; -import org.springframework.stereotype.Component; - -import java.util.Map; - -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; - - -/** - * @author DB - * @createTime 2023/11/06 16:16 - * @description 新客限定策略 - */ -@Component -public class NewCustomerRestrictStrategy implements BuyRestrictStrategy{ - - /** - * 购买限制 - * @param product 产品 - */ - @Override - public void buyRestrict(Product product, Map recordNumIsEnough) { - //查询当前用户是否有购买记录 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - OrderService orderService = SpringUtils.getBean(OrderService.class); - //跳过逻辑删除 - LogicDeleteManager.execWithoutLogicDelete(() -> { - long count = orderService.queryChain() - .where(ORDER.PAY_USER_ID.eq(loginUserInfo.getString("userId"))) - .count(); - if (count > 0) { - //存在过购买记录 - throw new ServiceException("您已不是新客,无法购买商品" + product.getProductName()); - } - }); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/UserRestrictStrategy.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/UserRestrictStrategy.java deleted file mode 100644 index 3c2707d..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/strategy/buyRestrict/UserRestrictStrategy.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.cpop.mall.framework.strategy.buyRestrict; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.service.OrderDetailService; -import com.cpop.mall.business.service.ProductRecordService; -import com.mybatisflex.core.logicdelete.LogicDeleteManager; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import static com.cpop.mall.business.entity.table.OrderDetailTableDef.ORDER_DETAIL; -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ProductTableDef.PRODUCT; - -/** - * @author DB - * @createTime 2023/11/06 16:42 - * @description 用户限购 - */ -@Component -public class UserRestrictStrategy implements BuyRestrictStrategy{ - - @Override - public void buyRestrict(Product product, Map recordNumIsEnough) { - //查询用户已购买的数量 - JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo(); - OrderDetailService orderDetailService = SpringUtils.getBean(OrderDetailService.class); - ProductRecordService productRecordService = SpringUtils.getBean(ProductRecordService.class); - //产品记录 - List productRecordList = productRecordService.queryChain().where(PRODUCT_RECORD.PRODUCT_ID.eq(product.getId())).list(); - Set recordSet = productRecordList.stream().map(ProductRecord::getId).collect(Collectors.toSet()); - //跳过逻辑删除 - LogicDeleteManager.execWithoutLogicDelete(() -> { - //已存在订单数 - long count = orderDetailService.queryChain() - .leftJoin(ORDER).on(ORDER.ID.eq(ORDER_DETAIL.ORDER_ID)) - .leftJoin(PRODUCT_RECORD).on(PRODUCT_RECORD.ID.eq(ORDER_DETAIL.PRODUCT_RECORD_ID)) - .leftJoin(PRODUCT).on(PRODUCT.ID.eq(PRODUCT_RECORD.PRODUCT_ID)) - .where(ORDER.PAY_USER_ID.eq(loginUserInfo.getString("userId"))) - .and(PRODUCT.ID.eq(product.getId())) - .count(); - //产品购买数量 - AtomicInteger num = new AtomicInteger(); - recordNumIsEnough.forEach((key, value) -> { - if (recordSet.contains(key)) { - num.addAndGet(value); - } - }); - if (product.getLimitNum() - count < num.get()) { - //存在过购买记录 - throw new ServiceException("您购买的商品已超出限制,无法购买商品" + product.getProductName()); - } - }); - - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderDetailAsyncTask.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderDetailAsyncTask.java deleted file mode 100644 index 9a063b1..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderDetailAsyncTask.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.cpop.mall.framework.task; - -import com.alibaba.fastjson.JSONObject; -import com.cpop.system.framework.enums.OrderSource; -import com.cpop.core.utils.SpringUtils; -import com.cpop.jambox.business.entity.StoreExtend; -import com.cpop.jambox.business.service.StoreExtendService; -import com.cpop.jambox.framework.constant.JamboxCloudUrl; -import com.cpop.mall.business.entity.Order; -import com.cpop.mall.business.entity.OrderDetail; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.service.ProductRecordService; -import okhttp3.*; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.jambox.business.entity.table.StoreExtendTableDef.STORE_EXTEND; - -/** - * @author DB - * @createTime 2023/11/10 17:11 - * @description 订单详情异步任务 - */ -@Component -public class OrderDetailAsyncTask { - - /** - * 云地址 - */ - @Value("${mall.cloudBaseUrl}") - private String cloudBaseUrl; - - /** - * @descriptions 订单详情异步任务 - * @author DB - * @date 2023/11/13 15:37 - * @param order 订单 - * @param loginUserInfo 用户详情 - * @param orderDetails 订单详情 - * @param productList 产品列表 - * @return: void - */ - @Async("customAsyncThreadPool") - public void asyncProcessingOrderDetails(Order order, String phoneNumber,String nickName, List orderDetails, List productList) { - Map productMap = productList.stream().collect(Collectors.toMap(Product::getId, item -> item)); - List productRecords = SpringUtils.getBean(ProductRecordService.class).listByIds(orderDetails.stream().map(OrderDetail::getProductRecordId).collect(Collectors.toSet())); - Map productRecordMap = productRecords.stream().collect(Collectors.toMap(ProductRecord::getId, item -> item)); - //获取云校区id - List storeExtendList = SpringUtils.getBean(StoreExtendService.class).queryChain() - .where(STORE_EXTEND.STORE_ID.in(orderDetails.stream().map(OrderDetail::getStoreId).collect(Collectors.toSet()))) - .list(); - Map storeCloudMap = storeExtendList.stream().collect(Collectors.toMap(StoreExtend::getStoreId, StoreExtend::getStoreCloudId)); - orderDetails.forEach(item -> { - //获取当前订单记录的商品信息 - ProductRecord productRecord = productRecordMap.get(item.getProductRecordId()); - Product product = productMap.get(productRecord.getProductId()); - //课卡 - if (product.getProductType() == 0) { - //课卡信息 - JSONObject jsonBody = new JSONObject(); - jsonBody.put("_type", "addPeriod"); - //订单id - jsonBody.put("mallOrderId", order.getId()); - //办卡实收金额 - jsonBody.put("money", productRecord.getRecordPrice()); - //店铺/校区 - jsonBody.put("storeId", storeCloudMap.get(item.getStoreId())); - //手机号 - jsonBody.put("phone", phoneNumber); - //客户名称 - jsonBody.put("customerName", nickName); - //模板id - jsonBody.put("templateId", product.getCardTemplateId()); - //订单来源 - jsonBody.put("orderSource", OrderSource.MALL.toString()); - //模板对应实际地址 - jsonBody.put("templateUrl", cloudBaseUrl); - //获取课卡信息 - SpringUtils.getBean(RestTemplate.class).postForObject(JamboxCloudUrl.COMMON_CARD_URL, jsonBody, JSONObject.class); - } - }); - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderOverTimeUnPayTask.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderOverTimeUnPayTask.java deleted file mode 100644 index 493271a..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/OrderOverTimeUnPayTask.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.cpop.mall.framework.task; - -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.entity.Order; -import com.cpop.mall.business.entity.OrderDetail; -import com.cpop.mall.business.service.OrderDetailService; -import com.cpop.mall.business.service.OrderService; -import com.cpop.mall.framework.constant.MallRedisConstant; -import org.quartz.Job; -import org.quartz.JobDataMap; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.mall.business.entity.table.OrderDetailTableDef.ORDER_DETAIL; -import static com.cpop.mall.business.entity.table.OrderTableDef.ORDER; - -/** - * @author DB - * @createTime 2023/11/03 14:56 - * @description 订单超时未支付任务 - */ -public class OrderOverTimeUnPayTask implements Job { - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - //获取工单id - JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap(); - String orderId = jobDataMap.getString("orderId"); - OrderService orderService = SpringUtils.getBean(OrderService.class); - Order order = orderService.getById(orderId); - //订单存在并且订单仍然是未支付,修改订单为超时 - if (null != order && order.getOrderStatus() == 0) { - orderService.updateChain().set(ORDER.ORDER_STATUS, 6).set(ORDER.PREVIOUS_STATUS, 0).where(ORDER.ID.eq(orderId)).update(); - //redis库存回滚 - RedisService redisService = SpringUtils.getBean(RedisService.class); - Map orderReturnMap = SpringUtils.getBean(OrderDetailService.class).queryChain() - .where(ORDER_DETAIL.ORDER_ID.eq(orderId)) - .list() - .stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber)); - orderReturnMap.forEach((key, value) -> { - redisService.longIncrement(MallRedisConstant.STOCK_RECORD_NUM + key, value.longValue()); - }); - } - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ProductRecordSyncStockTask.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ProductRecordSyncStockTask.java deleted file mode 100644 index 2a59fe6..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ProductRecordSyncStockTask.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.cpop.mall.framework.task; - -import com.cpop.core.service.RedisService; -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.service.ProductRecordService; -import com.cpop.mall.framework.constant.MallRedisConstant; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; - -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; - -/** - * @author DB - * @createTime 2023/10/27 17:26 - * @description 凌晨同步库存任务 - */ - -@Component -@Slf4j -public class ProductRecordSyncStockTask { - - /** - * @Description: 每天1点05分进行库存同步 - * @Author DB - * @Date: 2023/10/28 10:08 - */ - @Scheduled(cron="0 5 1 * * ?") - public void syncMysqlStockToRedis(){ - log.info("===============================开始<--库存信息同步-->开始==============================="); - //获取所有库存 - List productRecords = SpringUtils.getBean(ProductRecordService.class).list(); - RedisService redisService = SpringUtils.getBean(RedisService.class); - productRecords.forEach(item->{ - redisService.setCacheObject(MallRedisConstant.STOCK_RECORD_NUM + item.getId(), item.getRecordNum()); - log.info("商品记录id为:{};商品库存为:{}", item.getId(), item.getRecordNum()); - }); - log.info("===============================结束<--库存信息结束-->结束==============================="); - } - - /** - * @Description: 异步更新数据库 - * @param orderNumMap 产品记录库存 - * @Author DB - * @Date: 2023/11/1 0:09 - */ - @Async("customAsyncThreadPool") - public void asyncUpdateRecords(Map orderNumMap) { - loopUpdateStock(orderNumMap); - } - - /** - * @param orderNumMap 库存修改记录 - * @descriptions 循环插入库存修改记录 - * @author DB - * @date 2023/11/01 17:01 - * @return: void - */ - @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED) - protected void loopUpdateStock(Map orderNumMap) { - ProductRecordService productRecordService = SpringUtils.getBean(ProductRecordService.class); - //用迭代器 - Iterator> iterator = orderNumMap.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry next = iterator.next(); - boolean update = productRecordService.updateChain() - .setRaw(PRODUCT_RECORD.RECORD_NUM, "record_num -" + next.getValue()) - .where(PRODUCT_RECORD.ID.eq(next.getKey())).update(); - //如果更新成功,移除 - if (update) { - iterator.remove(); - } - } - //存在更新失败(乐观锁),需要重新更新,直到全部成功 - if (!orderNumMap.isEmpty()) { - //获取最新数据进行下一次循环 - loopUpdateStock(orderNumMap); - } - } -} diff --git a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ShoppingCartAsyncTask.java b/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ShoppingCartAsyncTask.java deleted file mode 100644 index 62b3e6b..0000000 --- a/Cpop-Mall/src/main/java/com/cpop/mall/framework/task/ShoppingCartAsyncTask.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.cpop.mall.framework.task; - -import com.cpop.core.utils.SpringUtils; -import com.cpop.mall.business.entity.Product; -import com.cpop.mall.business.entity.ProductRecord; -import com.cpop.mall.business.service.ProductRecordService; -import com.cpop.mall.business.service.ShoppingCartService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.cpop.mall.business.entity.table.ProductRecordTableDef.PRODUCT_RECORD; -import static com.cpop.mall.business.entity.table.ShoppingCartTableDef.SHOPPING_CART; - -/** - * @author DB - * @createTime 2023/11/09 16:42 - * @description - */ -@Component -@Slf4j -public class ShoppingCartAsyncTask { - - /** - * @Description: 异步更新购物车价格 - * @param product 商品 - * @Author DB - * @Date: 2023/11/1 0:09 - */ - @Async("customAsyncThreadPool") - public void asyncUpdateShoppingCartAmount(Product product) { - //获取商品记录 - List recordList = SpringUtils.getBean(ProductRecordService.class).queryChain() - .where(PRODUCT_RECORD.PRODUCT_ID.eq(product.getId())) - .list(); - //批量修改购物车产品价格 - ShoppingCartService cartService = SpringUtils.getBean(ShoppingCartService.class); - recordList.forEach(item->{ - cartService.updateChain().setRaw(SHOPPING_CART.AMOUNT, item.getRecordPrice() + " * number") - .setRaw(SHOPPING_CART.POINT, item.getRecordPoints() + " * number") - .where(SHOPPING_CART.PRODUCT_RECORD_ID.eq(item.getId())).update(); - }); - } - - /** - * @Description: 异步删除购物车 - * @param productId 商品Id - * @Author DB - * @Date: 2023/11/1 0:09 - */ - @Async("customAsyncThreadPool") - public void asyncRemoveShoppingCart(String productId) { - //获取商品记录 - List recordList = SpringUtils.getBean(ProductRecordService.class).queryChain() - .where(PRODUCT_RECORD.PRODUCT_ID.eq(productId)) - .list(); - //批量修改购物车产品价格 - if (!recordList.isEmpty()){ - ShoppingCartService cartService = SpringUtils.getBean(ShoppingCartService.class); - cartService.updateChain() - .where(SHOPPING_CART.PRODUCT_RECORD_ID.in(recordList.stream().map(ProductRecord::getId).collect(Collectors.toSet()))) - .remove(); - } - } -} diff --git a/Cpop-Mall/src/main/resources/application-mall.yml b/Cpop-Mall/src/main/resources/application-mall.yml deleted file mode 100644 index 8b13789..0000000 --- a/Cpop-Mall/src/main/resources/application-mall.yml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Cpop-Mall/src/main/resources/mapper/OrderDetailMapper.xml b/Cpop-Mall/src/main/resources/mapper/OrderDetailMapper.xml deleted file mode 100644 index 3a62127..0000000 --- a/Cpop-Mall/src/main/resources/mapper/OrderDetailMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/OrderEvaluateMapper.xml b/Cpop-Mall/src/main/resources/mapper/OrderEvaluateMapper.xml deleted file mode 100644 index 4848e9b..0000000 --- a/Cpop-Mall/src/main/resources/mapper/OrderEvaluateMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/OrderMapper.xml b/Cpop-Mall/src/main/resources/mapper/OrderMapper.xml deleted file mode 100644 index 8b885c4..0000000 --- a/Cpop-Mall/src/main/resources/mapper/OrderMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/OrderRefundMapper.xml b/Cpop-Mall/src/main/resources/mapper/OrderRefundMapper.xml deleted file mode 100644 index 487cc75..0000000 --- a/Cpop-Mall/src/main/resources/mapper/OrderRefundMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/ProductMapper.xml b/Cpop-Mall/src/main/resources/mapper/ProductMapper.xml deleted file mode 100644 index 59aa0be..0000000 --- a/Cpop-Mall/src/main/resources/mapper/ProductMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/ProductOutMapper.xml b/Cpop-Mall/src/main/resources/mapper/ProductOutMapper.xml deleted file mode 100644 index d749e62..0000000 --- a/Cpop-Mall/src/main/resources/mapper/ProductOutMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/ProductRecordMapper.xml b/Cpop-Mall/src/main/resources/mapper/ProductRecordMapper.xml deleted file mode 100644 index 508c175..0000000 --- a/Cpop-Mall/src/main/resources/mapper/ProductRecordMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/ProductSpecificationMapper.xml b/Cpop-Mall/src/main/resources/mapper/ProductSpecificationMapper.xml deleted file mode 100644 index 3bfa3e2..0000000 --- a/Cpop-Mall/src/main/resources/mapper/ProductSpecificationMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/ShoppingCartMapper.xml b/Cpop-Mall/src/main/resources/mapper/ShoppingCartMapper.xml deleted file mode 100644 index 93899d8..0000000 --- a/Cpop-Mall/src/main/resources/mapper/ShoppingCartMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mall/src/main/resources/mapper/StaffMapper.xml b/Cpop-Mall/src/main/resources/mapper/StaffMapper.xml deleted file mode 100644 index 8ed58b4..0000000 --- a/Cpop-Mall/src/main/resources/mapper/StaffMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mini/pom.xml b/Cpop-Mini/pom.xml deleted file mode 100644 index 7215dbd..0000000 --- a/Cpop-Mini/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - com.cpop - Cpop-Union - 1.1.0 - ../pom.xml - - Cpop-Mini - Cpop-Mini - Cpop-Mini 小程序系统通用包 - jar - - - - - com.cpop - Cpop-Core - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java deleted file mode 100644 index 5cfa21e..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUserMidSys.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.cpop.mini.business.entity; - -import com.cpop.core.base.entity.BaseEntity; -import com.cpop.core.base.entity.BaseInsertListener; -import com.cpop.core.base.entity.BaseUpdateListener; -import com.mybatisflex.annotation.Id; -import com.mybatisflex.annotation.Table; -import lombok.*; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * 小程序用户-系统用户中间表 实体类。 - * - * @author DB - * @since 2024-01-24 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -@Table(value = "cp_mini_user_mid_sys", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class MiniUserMidSys extends BaseEntity implements Serializable { - - /** - * 小程序用户id - */ - @Id - private String miniId; - - /** - * 用户id - */ - @Id - private String userId; - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMapper.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMapper.java deleted file mode 100644 index fb426d4..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mini.business.mapper; - -import com.mybatisflex.core.BaseMapper; -import com.cpop.mini.business.entity.MiniUser; - -/** - * 小程序用户信息 映射层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface MiniUserMapper extends BaseMapper { - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMidSysMapper.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMidSysMapper.java deleted file mode 100644 index d927973..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/mapper/MiniUserMidSysMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mini.business.mapper; - -import com.cpop.mini.business.entity.MiniUserMidSys; -import com.mybatisflex.core.BaseMapper; - -/** - * 小程序用户-系统用户中间表 映射层。 - * - * @author DB - * @since 2024-01-24 - */ -public interface MiniUserMidSysMapper extends BaseMapper { - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserMidSysService.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserMidSysService.java deleted file mode 100644 index 0afc23e..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserMidSysService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mini.business.service; - -import com.cpop.mini.business.entity.MiniUserMidSys; -import com.mybatisflex.core.service.IService; - -/** - * 小程序用户-系统用户中间表 服务层。 - * - * @author DB - * @since 2024-01-24 - */ -public interface MiniUserMidSysService extends IService { - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserService.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserService.java deleted file mode 100644 index ee5269e..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/MiniUserService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.cpop.mini.business.service; - -import com.mybatisflex.core.service.IService; -import com.cpop.mini.business.entity.MiniUser; - -/** - * 小程序用户信息 服务层。 - * - * @author DB - * @since 2023-10-24 - */ -public interface MiniUserService extends IService { - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserMidSysServiceImpl.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserMidSysServiceImpl.java deleted file mode 100644 index 454080b..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserMidSysServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mini.business.service.impl; - -import com.cpop.mini.business.entity.MiniUserMidSys; -import com.cpop.mini.business.mapper.MiniUserMidSysMapper; -import com.cpop.mini.business.service.MiniUserMidSysService; -import com.mybatisflex.spring.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * 小程序用户-系统用户中间表 服务层实现。 - * - * @author DB - * @since 2024-01-24 - */ -@Service("userMidSysService") -public class MiniUserMidSysServiceImpl extends ServiceImpl implements MiniUserMidSysService { - -} diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserServiceImpl.java b/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserServiceImpl.java deleted file mode 100644 index 35fa881..0000000 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/service/impl/MiniUserServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.cpop.mini.business.service.impl; - -import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.mini.business.entity.MiniUser; -import com.cpop.mini.business.mapper.MiniUserMapper; -import com.cpop.mini.business.service.MiniUserService; -import org.springframework.stereotype.Service; - -/** - * 小程序用户信息 服务层实现。 - * - * @author DB - * @since 2023-10-24 - */ -@Service("miniUserService") -public class MiniUserServiceImpl extends ServiceImpl implements MiniUserService { - -} diff --git a/Cpop-Mini/src/main/resources/application-mini.yml b/Cpop-Mini/src/main/resources/application-mini.yml deleted file mode 100644 index 8b13789..0000000 --- a/Cpop-Mini/src/main/resources/application-mini.yml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Cpop-Mini/src/main/resources/mapper/MiniUserMapper.xml b/Cpop-Mini/src/main/resources/mapper/MiniUserMapper.xml deleted file mode 100644 index 71b4002..0000000 --- a/Cpop-Mini/src/main/resources/mapper/MiniUserMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Mini/src/main/resources/mapper/MiniUserMidSysMapper.xml b/Cpop-Mini/src/main/resources/mapper/MiniUserMidSysMapper.xml deleted file mode 100644 index df0893f..0000000 --- a/Cpop-Mini/src/main/resources/mapper/MiniUserMidSysMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Cpop-Oam/Cpop-Oam-Web/pom.xml b/Cpop-Oam/Cpop-Oam-Web/pom.xml index b747d3c..de7053b 100644 --- a/Cpop-Oam/Cpop-Oam-Web/pom.xml +++ b/Cpop-Oam/Cpop-Oam-Web/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../../pom.xml Cpop-Oam-Web diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java index 21cd1d7..4f7081e 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopApiTests.java @@ -1,13 +1,13 @@ package com.cpop.oam.web; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.RSA; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.tencent.location.handler.TencentLocationHandler; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; -import com.cpop.core.utils.RsaUtils; +import com.cpop.core.config.CpopConfig; import com.cpop.core.utils.SpringUtils; -import com.cpop.oam.business.bo.ApiTenantRequest; import com.cpop.pay.framewok.handler.ecpp.EcppHandler; -import okhttp3.Response; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -46,10 +46,9 @@ public class CpopApiTests { @Test public void rsaDecrypt(){ - RsaUtils rsaUtils = SpringUtils.getBean(RsaUtils.class); - String jambox0831 = rsaUtils.encrypt("jambox0831"); - String decrypt = rsaUtils.decrypt(jambox0831); - System.out.println(decrypt); + RSA loginRsa = SpringUtils.getBean(CpopConfig.class).getLoginRsa(); + String encryptBase64 = loginRsa.encryptBase64("jambox0831", KeyType.PublicKey); + System.out.println(encryptBase64); } @Test diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCloudDbTests.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCloudDbTests.java index 05b8c91..89d96fc 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCloudDbTests.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopCloudDbTests.java @@ -1,6 +1,6 @@ package com.cpop.oam.web; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.dto.CloudCourseStudentListDto; import com.cpop.api.cloudDb.core.dto.CloudCustomerDto; import com.cpop.api.cloudDb.core.dto.CloudOrderDto; @@ -15,8 +15,6 @@ import com.mybatisflex.core.row.Row; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import java.util.List; - /** * @author DB * @version 1.0.0 diff --git a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java index c574485..8d85835 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java +++ b/Cpop-Oam/Cpop-Oam-Web/src/test/java/com/cpop/oam/web/CpopEasyLearnDataAnalyseTest.java @@ -1,6 +1,6 @@ package com.cpop.oam.web; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONObject; import com.cpop.api.cloudDb.core.constant.CloudDbUrl; import com.cpop.core.utils.SpringUtils; import com.cpop.pay.framewok.handler.wxPay.WxPayHandler; diff --git a/Cpop-Oam/pom.xml b/Cpop-Oam/pom.xml index 744a183..b5f2a2f 100644 --- a/Cpop-Oam/pom.xml +++ b/Cpop-Oam/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-Oam diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java index 6fec08a..f9d65cd 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/DutyBo.java @@ -1,11 +1,13 @@ package com.cpop.oam.business.bo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotEmpty; import lombok.Data; import lombok.experimental.Accessors; +import java.time.LocalDate; import java.util.List; /** @@ -44,7 +46,8 @@ public class DutyBo { */ @NotEmpty(message = "值班日期不能为空") @Schema(description = "值班日期", requiredMode = Schema.RequiredMode.REQUIRED) - private List dutyDate; + @JsonFormat(pattern = "yyyy-MM-dd") + private List dutyDate; /** * 备注 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/NavigationBo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/NavigationBo.java new file mode 100644 index 0000000..71041f3 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/bo/NavigationBo.java @@ -0,0 +1,40 @@ +package com.cpop.oam.business.bo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-05-20 11:03 + */ +@Data +@Accessors(chain = true) +@Schema( description = "导航栏请求参数") +public class NavigationBo { + + /** + * 主键 + */ + @Schema(description = "主键") + private String id; + + /** + * 导航栏名称 + */ + @Schema(description = "导航栏名称") + private String navigationName; + + /** + * 路径 + */ + @Schema(description = "路径") + private String path; + + /** + * 父级ID + */ + @Schema(description = "父级ID") + private Integer parentId; +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictDataController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictDataController.java index 38c66ad..be394c9 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictDataController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictDataController.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.controller.backstage; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.R; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.DictDataBo; import com.cpop.oam.business.bo.DictDataPageBo; import com.cpop.oam.business.vo.DictDataListVo; @@ -79,7 +79,7 @@ public class BackstageDictDataController { @Operation(summary = "根据字典类型获取字典数据") public R> getDictDataByDictType(@PathVariable @Parameter(description = "字典数据类型") String dictType) { List dataList = dictDataService.getDictDataByDictType(dictType); - return R.ok(BeanUtils.mapToList(dataList, DictDataListVo.class)); + return R.ok(BeanUtil.copyToList(dataList, DictDataListVo.class)); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictTypeController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictTypeController.java index 9a9da36..a718da9 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictTypeController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDictTypeController.java @@ -1,10 +1,10 @@ package com.cpop.oam.business.controller.backstage; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.R; import com.cpop.core.base.enums.UserType; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.DictTypeBo; import com.cpop.oam.business.vo.DictTypePageVo; import com.cpop.oam.business.vo.DictTypeVo; @@ -88,7 +88,7 @@ public class BackstageDictTypeController { if (!dictTypeService.checkDictTypeUnique(bo)) { throw new ServiceException("新增字典'" + bo.getDictName() + "'失败,字典类型已存在"); } - DictType dictType = BeanUtils.mapToClass(bo, DictType.class); + DictType dictType = BeanUtil.toBean(bo, DictType.class); dictType.setUserType((UserType) StpUtil.getSession().get("userType")); dictTypeService.save(dictType); return R.ok(); @@ -108,7 +108,7 @@ public class BackstageDictTypeController { if (!dictTypeService.checkDictTypeUnique(bo)) { throw new ServiceException("修改字典'" + bo.getDictName() + "'失败,字典类型已存在"); } - dictTypeService.updateById(BeanUtils.mapToClass(bo, DictType.class)); + dictTypeService.updateById(BeanUtil.toBean(bo, DictType.class)); return R.ok(); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java index a4643c4..baa76b9 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageDutyController.java @@ -1,5 +1,6 @@ package com.cpop.oam.business.controller.backstage; +import cn.dev33.satoken.annotation.SaCheckPermission; import com.cpop.core.base.entity.R; import com.cpop.oam.business.bo.DutyBo; import com.cpop.oam.business.bo.DutyListBo; @@ -57,6 +58,7 @@ public class BackstageDutyController { * @author DB * @since 2023/5/18 9:50 **/ + @SaCheckPermission("dutyCalendar.duty.manage") @Operation(summary = "新增值班") @PostMapping("/insertDuty") public R insertDuty(@RequestBody @Validated DutyBo bo) { diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java index 29ea9fb..1b3dfa2 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageFinanceReimburseController.java @@ -1,7 +1,8 @@ package com.cpop.oam.business.controller.backstage; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.R; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.entity.FinanceReimburseType; import com.cpop.oam.business.service.FinanceReimburseService; @@ -103,6 +104,7 @@ public class BackstageFinanceReimburseController { * @author DB * @since : 2023/5/30 15:44 **/ + @SaCheckPermission("financial.audit.list") @Operation(summary = "财务报销模块-报销审核分页列表") @GetMapping("/getReimburseAuditPage") public R> getReimburseAuditPage(FinanceReimburseAuditPageBo bo) { @@ -133,7 +135,7 @@ public class BackstageFinanceReimburseController { @Operation(summary = "新增报销类型") @PostMapping("/insertReimburseType") public R insertReimburseApplication(@RequestBody @Validated ReimburseTypeBo bo) { - financeReimburseTypeService.save(BeanUtils.mapToClass(bo, FinanceReimburseType.class)); + financeReimburseTypeService.save(BeanUtil.toBean(bo, FinanceReimburseType.class)); return R.ok(); } @@ -147,7 +149,7 @@ public class BackstageFinanceReimburseController { @Operation(summary = "修改报销类型") @PutMapping("/updateReimburseType") public R updateReimburseType(@RequestBody @Validated ReimburseTypeBo bo) { - financeReimburseTypeService.updateById(BeanUtils.mapToClass(bo, FinanceReimburseType.class)); + financeReimburseTypeService.updateById(BeanUtil.toBean(bo, FinanceReimburseType.class)); return R.ok(); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java index 500aa78..42f8fea 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageLoginController.java @@ -11,7 +11,6 @@ import com.cpop.core.service.OperationLogService; import com.cpop.core.utils.MessageUtils; import com.cpop.core.utils.ServletUtils; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.ip.IpUtils; import com.cpop.oam.business.bo.LoginForm; import com.cpop.oam.business.service.LoginService; import com.cpop.oam.business.vo.loginInfo.SysStaffLoginInfo; @@ -52,7 +51,7 @@ public class BackstageLoginController { StpUtil.login(login.getId(),"PC"); SaSession session = StpUtil.getSession(); session.set("id", login.getId()) - .set("loginIp", IpUtils.getIpAddr(ServletUtils.getRequest())) + .set("loginIp", ServletUtils.getIpAddr(ServletUtils.getRequest())) .set("username", login.getUsername()) .set("userId", login.getUserId()) .set("name", login.getName()) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageNavigationController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageNavigationController.java new file mode 100644 index 0000000..ff3c61a --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageNavigationController.java @@ -0,0 +1,92 @@ +package com.cpop.oam.business.controller.backstage; + +import cn.hutool.core.bean.BeanUtil; +import com.cpop.core.base.entity.R; +import com.cpop.oam.business.bo.NavigationBo; +import com.cpop.oam.business.entity.Navigation; +import com.cpop.oam.business.entity.WebMapData; +import com.cpop.oam.business.service.NavigationService; +import com.cpop.oam.business.service.WebMapDataService; +import com.cpop.oam.business.vo.NavigationVo; +import com.cpop.oam.business.vo.WebItemStyleVo; +import com.cpop.oam.business.vo.WebMapRegionDataVo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * 果酱模块化官网 导航栏表 控制层。 + * + * @author Yxz + * @since 2024-01-19 + */ +@RestController +@Tag(name = "果酱模块化官网 导航栏表接口") +@RequestMapping("/backstage/navigation") +public class BackstageNavigationController { + + @Autowired + private NavigationService navigationService; + + @Autowired + private WebMapDataService webMapDataService; + + /** + * 根据主键更新果酱模块化官网 导航栏表。 + * + * @param bo 果酱模块化官网 导航栏表 + * @return {@code true} 更新成功,{@code false} 更新失败 + */ + @PutMapping("/update") + @Operation(summary = "根据主键更新果酱模块化官网 导航栏表") + public R update(@RequestBody @Parameter(description = "果酱模块化官网 导航栏表主键") NavigationBo bo) { + navigationService.updateById(BeanUtil.toBean(bo, Navigation.class)); + return R.ok(); + } + + /** + * 查询所有果酱模块化官网 导航栏表。 + * + * @return 所有数据 + */ + @GetMapping("/list") + @Operation(summary = "查询所有果酱模块化官网 导航栏表") + public R> list() { + List navigationVoList = navigationService.getList(); + return R.ok(navigationVoList); + } + + /** + * 获取3D地图数据 + * + * @author Yxz + * @since 2024/3/1 14:44 + * @return com.cpop.core.base.R + **/ + @Operation(summary = "获取3D地图数据") + @GetMapping("/getMapData") + public R> getMapData(){ + List webMapDataList = webMapDataService.list(); + List regionDataList = webMapDataList.stream().map(entity ->{ + WebMapRegionDataVo regionData = new WebMapRegionDataVo(); + regionData.setName(entity.getDistrictName()); + List site = new ArrayList<>(); + site.add(entity.getLongitude()); + site.add(entity.getLatitude()); + regionData.setValue(site); + WebItemStyleVo webItemStyleVo = new WebItemStyleVo(); + webItemStyleVo.setColor(entity.getColor()); + regionData.setItemStyle(webItemStyleVo); + regionData.setCampusNum(entity.getCampusNum()); + regionData.setIsCentralPoint(entity.getIsCentralPoint()); + return regionData; + }).toList(); + return R.ok(regionDataList); + } + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java index 150c033..cda6e8b 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSignGoalController.java @@ -1,13 +1,13 @@ package com.cpop.oam.business.controller.backstage; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.table.Config; import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.SignGoalBo; import com.cpop.oam.business.bo.SignGoalConfigInfoBo; import com.cpop.oam.business.service.CommonService; @@ -115,7 +115,7 @@ public class BackstageSignGoalController { Map configMap = new HashMap<>(8); Arrays.asList(OamConfigKey.SIGN_GOAL).forEach(item -> { String cacheInfo = redisService.getCacheObject(commonService.getCacheKey(item)); - if (StringUtils.isNotBlank(cacheInfo)) { + if (StrUtil.isNotBlank(cacheInfo)) { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item); configMap.put(sysConfigEnum.getField(), cacheInfo); @@ -130,7 +130,7 @@ public class BackstageSignGoalController { } }); SignGoalConfigInfoVo signGoalConfigInfoVo = new SignGoalConfigInfoVo(); - BeanUtils.mapToObj(configMap, signGoalConfigInfoVo); + BeanUtil.copyProperties(configMap, signGoalConfigInfoVo); return R.ok(signGoalConfigInfoVo); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java index b083506..596d1e6 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageSysCommonController.java @@ -1,8 +1,7 @@ package com.cpop.oam.business.controller.backstage; import com.cpop.core.base.entity.R; -import com.cpop.core.utils.file.FileUploadUtils; -import com.cpop.core.utils.file.FileUtils; +import com.cpop.core.handler.UploadHandler; import com.cpop.oam.business.vo.SysFileVo; import com.cpop.oam.framework.handler.tencentCos.TencentCosHandler; import com.qcloud.cos.model.UploadResult; @@ -29,6 +28,9 @@ public class BackstageSysCommonController { @Autowired private TencentCosHandler tencentCosHandler; + @Autowired + private UploadHandler uploadHandler; + /** * cdn加速上传 * @author DB @@ -40,11 +42,11 @@ public class BackstageSysCommonController { @PostMapping("/cdnUpload") public R cdnUpload(MultipartFile file) { UploadResult uploadResult = tencentCosHandler.cdnUpload(file); - String filename = FileUploadUtils.getInstance().extractFilename(file); + String filename = uploadHandler.extractFilename(file); SysFileVo sysFileVo = new SysFileVo(); sysFileVo.setUrl( "https://" + uploadResult.getBucketName() + tencentCosHandler.getCdnUrl() + uploadResult.getKey()) .setFileName(filename) - .setNewFileName(FileUtils.getInstance().getName(filename)) + .setNewFileName(uploadHandler.getName(filename)) .setOriginalFilename(file.getOriginalFilename()); return R.ok(sysFileVo); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTechnologyToolController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTechnologyToolController.java index c9d348f..bd1eba3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTechnologyToolController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageTechnologyToolController.java @@ -1,6 +1,6 @@ package com.cpop.oam.business.controller.backstage; -import com.cpop.core.utils.bean.BeanUtils; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.entity.R; import com.cpop.core.utils.SqlUtils; @@ -45,7 +45,7 @@ public class BackstageTechnologyToolController { @Operation(summary = "技术工具分页查询") public R> getTechnologyToolPage(@RequestParam("toolType") @Parameter(description = "工具类型", required = true) String toolType) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page page = technologyToolService.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + Page page = technologyToolService.pageAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create().select(TECHNOLOGY_TOOL.ALL_COLUMNS) .select(STAFF.NAME.as(TechnologyToolPageVo::getCreateUser)) .leftJoin(USER).on(USER.ID.eq(TECHNOLOGY_TOOL.CREATE_USER_ID)) @@ -65,7 +65,7 @@ public class BackstageTechnologyToolController { @PostMapping("/insertTool") @Operation(summary = "保存技术工具") public R insertTool(@RequestBody @Validated TechnologyToolBo bo) { - technologyToolService.save(BeanUtils.mapToClass(bo, TechnologyTool.class)); + technologyToolService.save(BeanUtil.toBean(bo, TechnologyTool.class)); return R.ok(); } @@ -79,7 +79,7 @@ public class BackstageTechnologyToolController { @PutMapping("/updateTool") @Operation(summary = "根据主键更新技术工具") public R update(@RequestBody @Validated TechnologyToolBo bo) { - technologyToolService.updateById(BeanUtils.mapToClass(bo, TechnologyTool.class)); + technologyToolService.updateById(BeanUtil.toBean(bo, TechnologyTool.class)); return R.ok(); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java index 090d566..dcdba77 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/backstage/BackstageWxOpenController.java @@ -56,7 +56,9 @@ public class BackstageWxOpenController { /** * 获取授权链接 - * @return R + * + * @return {@link R }<{@link String }> + * @throws WxErrorException Wx错误异常 * @author DB * @since 2023/6/14 21:47 */ @@ -68,11 +70,11 @@ public class BackstageWxOpenController { } - /** + * 绑定开户 + * * @param appid 绑定小程序appid - * @return R - * 小程序绑定开放平台 + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/14 21:47 */ @@ -89,8 +91,9 @@ public class BackstageWxOpenController { /** * 解除绑定开放平台帐号 + * * @param appid 绑定小程序appid - * @return R + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/14 21:47 */ @@ -106,8 +109,9 @@ public class BackstageWxOpenController { } /** - * @return R>> * 获取授权小程序列表 + * + * @return {@link R }<{@link Page }<{@link WxOpenMiniVo }>> * @author DB * @since 2023/6/14 0014 17:00 */ @@ -116,9 +120,9 @@ public class BackstageWxOpenController { public R> getAuthorizerList() { try { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - WxOpenAuthorizerListResult authorizerList = wxOpenService.getWxOpenComponentService().getAuthorizerList((pageDomain.getPageNum() - 1) * pageDomain.getPageSize(), pageDomain.getPageSize()); + WxOpenAuthorizerListResult authorizerList = wxOpenService.getWxOpenComponentService().getAuthorizerList((pageDomain.getPage() - 1) * pageDomain.getPageSize(), pageDomain.getPageSize()); List list = wxOpenMiniService.getAuthorizerList(authorizerList); - Page page = Page.of(pageDomain.getPageNum(), pageDomain.getPageSize(), authorizerList.getTotalCount()); + Page page = Page.of(pageDomain.getPage(), pageDomain.getPageSize(), authorizerList.getTotalCount()); page.setRecords(list); return R.ok(page); } catch (WxErrorException e) { @@ -128,7 +132,9 @@ public class BackstageWxOpenController { /** * 数据同步 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -146,8 +152,9 @@ public class BackstageWxOpenController { /** * 获取授权小程序详情 + * * @param authorizerAppid 授权小程序appid - * @return R> + * @return {@link R }<{@link WxOpenAuthorizerInfoResult }> * @author DB * @since 2023/6/15 0015 16:38 */ @@ -164,8 +171,9 @@ public class BackstageWxOpenController { /** * 上传代码并生成体验版 + * * @param bo 请求参数 - * @return R + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -183,8 +191,9 @@ public class BackstageWxOpenController { /** * 获取体验版二维码 + * * @param bo 请求参数 - * @return R + * @return {@link R }<{@link String }> * @author DB * @since 2023/6/16 0016 17:35 */ @@ -208,7 +217,9 @@ public class BackstageWxOpenController { /** * 提交代码审核 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link WxOpenMaSubmitAuditResult }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -225,10 +236,12 @@ public class BackstageWxOpenController { /** * 查询审核单状态 + * + * @param authorizerAppid 授权appid + * @param auditId 审核id + * @return {@link R }<{@link WxOpenMaQueryAuditResult }> * @author DB * @since 2023/10/10 17:41 - * @param authorizerAppid 授权appid - * @param auditId 审核id */ @Operation(summary = "查询审核单状态") @GetMapping("/getAuditStatus") @@ -243,7 +256,9 @@ public class BackstageWxOpenController { /** * 撤回代码审核 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -260,7 +275,9 @@ public class BackstageWxOpenController { /** * 发布已通过审核的小程序 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -277,7 +294,9 @@ public class BackstageWxOpenController { /** * 撤回代码审核 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -294,7 +313,10 @@ public class BackstageWxOpenController { /** * 加急代码审核 - * @return R + * + * @param authorizerAppid 授权人appid + * @param auditId 审计id + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -311,7 +333,9 @@ public class BackstageWxOpenController { /** * 查询小程序版本信息 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link WxOpenVersioninfoResult }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -328,7 +352,9 @@ public class BackstageWxOpenController { /** * 查询最新一次审核单状态 - * @return R + * + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link WxOpenMaQueryAuditResult }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -345,7 +371,10 @@ public class BackstageWxOpenController { /** * 上传提审素材 - * @return R + * + * @param file 文件 + * @param authorizerAppid 授权人appid + * @return {@link R }<{@link WxMaAuditMediaUploadResult }> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -362,9 +391,11 @@ public class BackstageWxOpenController { /** * 获取模板列表 + * + * @param templateType 模板类型 + * @return {@link R }<{@link List }<{@link WxOpenMaCodeTemplate }>> * @author DB * @since 2023/10/10 18:17 - * @param templateType 模板类型 */ @Operation(summary = "获取模板列表") @GetMapping("/getTemplateList") @@ -379,7 +410,8 @@ public class BackstageWxOpenController { /** * 获取草稿箱列表 - * @return R + * + * @return {@link R }<{@link List }<{@link WxOpenMaCodeTemplate }>> * @author DB * @since 2023/6/16 0016 17:34 */ @@ -396,6 +428,9 @@ public class BackstageWxOpenController { /** * 将草稿添加到模板库 + * + * @param bo 薄 + * @return {@link R }<{@link Void }> * @author DB * @since 2023/10/10 18:16 */ @@ -412,8 +447,9 @@ public class BackstageWxOpenController { /** * 删除代码模板 + * * @param templateId 模板id - * @return R + * @return {@link R }<{@link Void }> * @author DB * @since 2023/6/27 0027 14:28 */ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxCpController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxCpController.java index b5836ea..5fe3cc4 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxCpController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxCpController.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.controller.callback; -import com.cpop.core.utils.JsonUtils; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; import com.cpop.oam.business.service.OamWxCpService; import com.cpop.oam.framework.config.wxCp.WxCpConfiguration; import io.swagger.v3.oas.annotations.tags.Tag; @@ -41,7 +41,7 @@ public class CallbackWxCpController { timestamp, nonce, echostr); - if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) { + if (StrUtil.hasBlank(signature, timestamp, nonce, echostr)) { throw new IllegalArgumentException("请求参数非法,请核实!"); } final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId); @@ -69,7 +69,7 @@ public class CallbackWxCpController { final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId); WxCpXmlMessage inMessage = WxCpXmlMessage .fromEncryptedXml(requestBody, wxCpService.getWxCpConfigStorage(), timestamp, nonce, signature); - this.logger.debug("\n消息解密后内容为:\n{} ", JsonUtils.toJson(inMessage)); + this.logger.debug("\n消息解密后内容为:\n{} ", JSONUtil.toJsonStr(inMessage)); WxCpXmlOutMessage outMessage = this.route(agentId, inMessage); if (outMessage == null) { return ""; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxOpenController.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxOpenController.java index 11d84e7..19642d8 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxOpenController.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/controller/callback/CallbackWxOpenController.java @@ -1,8 +1,8 @@ package com.cpop.oam.business.controller.callback; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.R; import com.cpop.core.base.exception.ServiceException; -import com.cpop.core.utils.StringUtils; import com.cpop.oam.framework.handler.wxOpen.WxOpenHandler; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -49,7 +49,7 @@ public class CallbackWxOpenController { @RequestParam("nonce") String nonce, @RequestParam("signature") String signature, @RequestParam(name = "encrypt_type", required = false) String encType, @RequestParam(name = "msg_signature", required = false) String msgSignature) { - if (!StringUtils.equalsIgnoreCase("aes", encType) || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { + if (!StrUtil.equalsIgnoreCase("aes", encType) || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { throw new ServiceException("非法请求,可能属于伪造的请求!"); } // aes加密的消息 @@ -103,17 +103,17 @@ public class CallbackWxOpenController { @RequestParam("openid") String openid, @RequestParam("encrypt_type") String encType, @RequestParam("msg_signature") String msgSignature) { - if (!StringUtils.equalsIgnoreCase("aes", encType) || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { + if (!StrUtil.equalsIgnoreCase("aes", encType) || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { throw new ServiceException("非法请求,可能属于伪造的请求!"); } String out = ""; // aes加密的消息 WxMpXmlMessage inMessage = WxOpenXmlMessage.fromEncryptedMpXml(requestBody, wxOpenService.getWxOpenConfigStorage(), timestamp, nonce, msgSignature); // 全网发布测试用例 - if (StringUtils.equalsAnyIgnoreCase(appId, "wxd101a85aa106f53e", "wx570bc396a51b8ff8")) { + if (StrUtil.equalsAnyIgnoreCase(appId, "wxd101a85aa106f53e", "wx570bc396a51b8ff8")) { try { - if (StringUtils.equals(inMessage.getMsgType(), "text")) { - if (StringUtils.equals(inMessage.getContent(), "TESTCOMPONENT_MSG_TYPE_TEXT")) { + if (StrUtil.equals(inMessage.getMsgType(), "text")) { + if (StrUtil.equals(inMessage.getContent(), "TESTCOMPONENT_MSG_TYPE_TEXT")) { out = WxOpenXmlMessage.wxMpOutXmlMessageToEncryptedXml( WxMpXmlOutMessage.TEXT().content("TESTCOMPONENT_MSG_TYPE_TEXT_callback") .fromUser(inMessage.getToUser()) @@ -121,12 +121,12 @@ public class CallbackWxOpenController { .build(), wxOpenService.getWxOpenConfigStorage() ); - } else if (StringUtils.startsWith(inMessage.getContent(), "QUERY_AUTH_CODE:")) { + } else if (StrUtil.startWith(inMessage.getContent(), "QUERY_AUTH_CODE:")) { String msg = inMessage.getContent().replace("QUERY_AUTH_CODE:", "") + "_from_api"; WxMpKefuMessage kefuMessage = WxMpKefuMessage.TEXT().content(msg).toUser(inMessage.getFromUser()).build(); wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appId).getKefuService().sendKefuMessage(kefuMessage); } - } else if (StringUtils.equals(inMessage.getMsgType(), "event")) { + } else if (StrUtil.equals(inMessage.getMsgType(), "event")) { WxMpKefuMessage kefuMessage = WxMpKefuMessage.TEXT().content(inMessage.getEvent() + "from_callback").toUser(inMessage.getFromUser()).build(); wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appId).getKefuService().sendKefuMessage(kefuMessage); } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Navigation.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Navigation.java similarity index 95% rename from Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Navigation.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Navigation.java index d28ebfb..202eb48 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/entity/website/Navigation.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/Navigation.java @@ -1,4 +1,4 @@ -package com.cpop.jambox.business.entity.website; +package com.cpop.oam.business.entity; import com.cpop.core.base.entity.BaseEntity; import com.cpop.core.base.entity.BaseInsertListener; @@ -6,11 +6,11 @@ import com.cpop.core.base.entity.BaseUpdateListener; import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import java.io.Serializable; - import lombok.*; import lombok.experimental.Accessors; +import java.io.Serializable; + /** * 果酱模块化官网 导航栏表 实体类。 * @@ -44,10 +44,6 @@ public class Navigation extends BaseEntity implements Serializable { */ private Integer parentId; - - - - /** * 逻辑删除(0否1是) */ diff --git a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUser.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WebMapData.java similarity index 52% rename from Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUser.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WebMapData.java index ee9e587..21b5832 100644 --- a/Cpop-Mini/src/main/java/com/cpop/mini/business/entity/MiniUser.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/entity/WebMapData.java @@ -1,4 +1,5 @@ -package com.cpop.mini.business.entity; +package com.cpop.oam.business.entity; + import com.cpop.core.base.entity.BaseEntity; import com.cpop.core.base.entity.BaseInsertListener; @@ -6,16 +7,16 @@ import com.cpop.core.base.entity.BaseUpdateListener; import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; -import java.io.Serializable; - import lombok.*; import lombok.experimental.Accessors; +import java.io.Serializable; + /** - * 小程序用户信息 实体类。 + * 果酱模块化官网 地图数据表 实体类。 * * @author DB - * @since 2023-10-24 + * @since 2024-03-01 */ @Data @EqualsAndHashCode(callSuper=false) @@ -23,49 +24,46 @@ import lombok.experimental.Accessors; @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) -@Table(value = "cp_mini_user", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) -public class MiniUser extends BaseEntity implements Serializable { +@Table(value = "cp_j_web_map_data", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false) +public class WebMapData extends BaseEntity implements Serializable { - /** - * 主键 - */ @Id private String id; /** - * 所在小程序openId + * 地区名称 */ - private String openId; + private String districtName; /** - * 所在小程序appid + * 经度 */ - private String appId; + private Double longitude; /** - * 品牌id + * 纬度 */ - private String brandId; + private Double latitude; /** - * 小程序昵称 + * 颜色 */ - private String nickName; + private String color; /** - * 头像 + * 是否中心点(0否1是) */ - private String avatar; + private Boolean isCentralPoint; /** - * 来源类型 + * 校区数量 */ - private String sourceType; + private Integer campusNum; /** * 逻辑删除(0否1是) */ @Column(isLogicDelete = true) - private Boolean isDelete; + private Integer isDelete; } diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/NavigationMapper.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/NavigationMapper.java similarity index 67% rename from Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/NavigationMapper.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/NavigationMapper.java index e6c158d..5ab5729 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/mapper/NavigationMapper.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/NavigationMapper.java @@ -1,7 +1,7 @@ -package com.cpop.jambox.business.mapper; +package com.cpop.oam.business.mapper; +import com.cpop.oam.business.entity.Navigation; import com.mybatisflex.core.BaseMapper; -import com.cpop.jambox.business.entity.website.Navigation; /** * 果酱模块化官网 导航栏表 映射层。 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/WebMapDataMapper.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/WebMapDataMapper.java new file mode 100644 index 0000000..beab352 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/mapper/WebMapDataMapper.java @@ -0,0 +1,12 @@ +package com.cpop.oam.business.mapper; + +import com.cpop.oam.business.entity.WebMapData; +import com.mybatisflex.core.BaseMapper; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-05-20 13:59 + */ +public interface WebMapDataMapper extends BaseMapper { +} diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/NavigationService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/NavigationService.java similarity index 76% rename from Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/NavigationService.java rename to Cpop-Oam/src/main/java/com/cpop/oam/business/service/NavigationService.java index 0c2dddd..d0dcc33 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/NavigationService.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/NavigationService.java @@ -1,8 +1,8 @@ -package com.cpop.jambox.business.service; +package com.cpop.oam.business.service; -import com.cpop.jambox.business.vo.NavigationVo; +import com.cpop.oam.business.entity.Navigation; +import com.cpop.oam.business.vo.NavigationVo; import com.mybatisflex.core.service.IService; -import com.cpop.jambox.business.entity.website.Navigation; import java.util.List; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/WebMapDataService.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/WebMapDataService.java new file mode 100644 index 0000000..15be08b --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/WebMapDataService.java @@ -0,0 +1,12 @@ +package com.cpop.oam.business.service; + +import com.cpop.oam.business.entity.WebMapData; +import com.mybatisflex.core.service.IService; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-05-20 13:59 + */ +public interface WebMapDataService extends IService { +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java index 2baeb42..6c61bbd 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BrandManagerServiceImpl.java @@ -42,7 +42,7 @@ public class BrandManagerServiceImpl extends ServiceImpl getBrandManagerPage(BrandManagerPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), + return this.pageAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), QueryWrapper.create() //品管 .select(distinct(BRAND_MANAGER.ID, BRAND_MANAGER.NAME, BRAND_MANAGER.PHONE, BRAND_MANAGER.CREATE_TIME)) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java index b4dcc1e..ae5be42 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/BusinessServiceImpl.java @@ -2,17 +2,17 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.session.SaSession; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.listener.ReadListener; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.BusinessDisposeBo; import com.cpop.oam.business.bo.BusinessDistributeBo; import com.cpop.oam.business.bo.BusinessInfoPageBo; @@ -83,7 +83,7 @@ public class BusinessServiceImpl extends ServiceImpl i queryWrapper.leftJoin(BUSINESS_STAFF).on(BUSINESS_STAFF.BUSINESS_ID.eq(BUSINESS.ID)) .and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id"))); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), queryWrapper.select(BUSINESS.ID, BUSINESS.BUSINESS_LEVEL, BUSINESS.BUSINESS_TYPE, BUSINESS.DESC, BUSINESS.START_DATE, BUSINESS.END_DATE, BUSINESS.ALL_SURPLUS_QUANTITY, BUSINESS.REMARK, BUSINESS.STATUS) //员工表 .select(STAFF.NAME.as(BusinessPageVo::getInitiatorName)) @@ -101,7 +101,7 @@ public class BusinessServiceImpl extends ServiceImpl i @Override @Transactional(rollbackFor = Exception.class) public void businessDistribute(BusinessDistributeBo bo) { - Business business = BeanUtils.mapToClass(bo, Business.class); + Business business = BeanUtil.toBean(bo, Business.class); business.setInitiatorId(StpUtil.getSession().getString("id")) .setStartDate(bo.getStartAndEnd().get(0)) .setEndDate(bo.getStartAndEnd().get(1)); @@ -159,7 +159,7 @@ public class BusinessServiceImpl extends ServiceImpl i throw new ServiceException("导入的excel存在空文件,请检查后重新操作"); } //负责员工 - BusinessStaff businessStaff = BeanUtils.mapToClass(item, BusinessStaff.class); + BusinessStaff businessStaff = BeanUtil.toBean(item, BusinessStaff.class); businessStaff.setBusinessId(businessId).setSurplusQuantity(businessDistributeDataList.size()).setStaffId(item.getStaffId()); businessStaffService.save(businessStaff); List businessDetails; @@ -215,7 +215,7 @@ public class BusinessServiceImpl extends ServiceImpl i queryWrapper.and(BUSINESS_STAFF.STAFF_ID.eq(session.getString("id"))); } PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return SpringUtils.getBean(BusinessDetailService.class).getMapper().paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper + return SpringUtils.getBean(BusinessDetailService.class).getMapper().paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), queryWrapper //事务详情 .select(BUSINESS_DETAIL.ID, BUSINESS_DETAIL.DETAIL_STATUS, BUSINESS_DETAIL.DETAIL_DESC, BUSINESS_DETAIL.DETAIL_RECORD_TIME) //员工 @@ -252,7 +252,7 @@ public class BusinessServiceImpl extends ServiceImpl i BusinessDetail businessDetail; SaSession session = StpUtil.getSession(); //查询当前事务 - if (StringUtils.isNotBlank(bo.getId())){ + if (StrUtil.isNotBlank(bo.getId())){ businessDetail = businessDetailService.queryChain().where(BUSINESS_DETAIL.ID.eq(bo.getId())).one(); businessDetail.setDetailStatus(bo.getDetailStatus()).setDetailDesc(bo.getDetailDesc()).setDetailRecordTime(LocalDateTime.now()); //新增或修改 @@ -347,7 +347,7 @@ public class BusinessServiceImpl extends ServiceImpl i @Override public Page getUnSignStorePage(String params) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.pageAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(STORE.ID, STORE.STORE_NAME, STORE.PERSON_CHARGE_NAME, STORE.PERSON_CHARGE_PHONE, STORE.BRAND_ID,STORE.LICENSE_PIC_URL) .select(BRAND.BRAND_NAME) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java index 7afca49..f376d09 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CluePutOffServiceImpl.java @@ -18,10 +18,10 @@ import com.mybatisflex.spring.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.CluePutOffTableDef.CLUE_PUT_OFF; import static com.cpop.oam.business.entity.table.ClueTableDef.CLUE; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.StoreSignTableDef.STORE_SIGN; import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.dateDiff; @@ -45,7 +45,7 @@ public class CluePutOffServiceImpl extends ServiceImpl getPutOffAuditPage() { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(CLUE_PUT_OFF.ID,CLUE_PUT_OFF.PUT_OFF_STAFF_ID,CLUE_PUT_OFF.PUT_OFF_REASON,CLUE_PUT_OFF.PUT_OFF_FILE_URL,CLUE_PUT_OFF.CREATE_TIME,CLUE_PUT_OFF.PUT_OFF_DATE) .select(CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.CITY) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java index 05c699f..8d356a1 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/ClueServiceImpl.java @@ -1,13 +1,13 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.ClueFollowUpBo; import com.cpop.oam.business.bo.CluePutOffBo; import com.cpop.oam.business.bo.ClueUpdateBo; @@ -19,9 +19,6 @@ import com.cpop.oam.business.vo.CluePutOffVo; import com.cpop.oam.business.vo.ClueUpdateVo; import com.cpop.oam.business.vo.PersonSignGoalVo; import com.cpop.oam.framework.constant.OamRedisConstant; -import com.cpop.oam.business.entity.DictData; -import com.cpop.oam.business.entity.Store; -import com.cpop.oam.business.service.DictDataService; import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryOrderBy; @@ -40,6 +37,7 @@ import java.util.List; import java.util.concurrent.locks.Lock; import java.util.stream.Collectors; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.CluePutOffTableDef.CLUE_PUT_OFF; import static com.cpop.oam.business.entity.table.ClueRecordTableDef.CLUE_RECORD; import static com.cpop.oam.business.entity.table.ClueTableDef.CLUE; @@ -47,7 +45,6 @@ import static com.cpop.oam.business.entity.table.ClueUpdateTableDef.CLUE_UPDATE; import static com.cpop.oam.business.entity.table.SignAreaTableDef.SIGN_AREA; import static com.cpop.oam.business.entity.table.SignGoalTableDef.SIGN_GOAL; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; -import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.StoreSignTableDef.STORE_SIGN; import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.mybatisflex.core.query.QueryMethods.*; @@ -79,12 +76,12 @@ public class ClueServiceImpl extends ServiceImpl implements Cl queryWrapper.and(CLUE.CLUE_STATUS.eq(clueStatus)); } } - if (StringUtils.isNotBlank(staffId)) { + if (StrUtil.isNotBlank(staffId)) { queryWrapper.and(CLUE.RESPONSIBLE_STAFF_ID.eq(staffId)); } else { queryWrapper.and(CLUE.RESPONSIBLE_STAFF_ID.eq(StpUtil.getSession().getString("id"))); } - if (StringUtils.isNotBlank(city) && StringUtils.equals("其他", city)) { + if (StrUtil.isNotBlank(city) && StrUtil.equals("其他", city)) { int year = LocalDate.now().getYear(); List cityList = SpringUtils.getBean(SignAreaService.class).queryChain() .select(distinct(SIGN_AREA.CITY)) @@ -96,11 +93,11 @@ public class ClueServiceImpl extends ServiceImpl implements Cl } //地区 queryWrapper.and(CLUE.CITY.notIn(cityList)); - } else if (StringUtils.isNotBlank(city)) { + } else if (StrUtil.isNotBlank(city)) { //地区 queryWrapper.and(CLUE.CITY.eq(city)); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.CLUE_STATUS, CLUE.FOLLOW_STATUS) @@ -179,7 +176,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl @Override public PersonSignGoalVo getPersonSignGoal(String signMonth,String staffId) { QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(staffId)) { + if (StrUtil.isNotBlank(staffId)) { queryWrapper.and(SIGN_GOAL.STAFF_ID.eq(staffId)); } else { String id = StpUtil.getSession().getString("id"); @@ -187,7 +184,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl staffId = id; } SignGoalService signGoalService = SpringUtils.getBean(SignGoalService.class); - if (StringUtils.isBlank(signMonth)) { + if (StrUtil.isBlank(signMonth)) { signMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); } String[] split = signMonth.split("-"); @@ -260,7 +257,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl */ @Override public void clueFollowUp(ClueFollowUpBo bo) { - ClueRecord clueRecord = BeanUtils.mapToClass(bo, ClueRecord.class); + ClueRecord clueRecord = BeanUtil.toBean(bo, ClueRecord.class); clueRecord.setRecordType(2); clueRecord.setRecordStaffId(StpUtil.getSession().getString("id")); SpringUtils.getBean(ClueRecordService.class).save(clueRecord); @@ -293,7 +290,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl } finally { DataSourceKey.clear(); } - ClueUpdate clueUpdate = BeanUtils.mapToClass(bo,ClueUpdate.class); + ClueUpdate clueUpdate = BeanUtil.toBean(bo,ClueUpdate.class); clueUpdate.setOldPersonCharge(store.getPersonChargeName()) .setOldPhone(store.getPersonChargePhone()) .setOldStoreAddr(store.getStoreAddr()) @@ -374,7 +371,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl throw new ServiceException("该线索在审核中,请勿重复提交"); } String id = StpUtil.getSession().getString("id"); - CluePutOff cluePutOff = BeanUtils.mapToClass(bo, CluePutOff.class); + CluePutOff cluePutOff = BeanUtil.toBean(bo, CluePutOff.class); cluePutOff.setAuditStatus(0).setPutOffStaffId(id); cluePutOffService.save(cluePutOff); ClueRecord clueRecord = new ClueRecord(); @@ -403,7 +400,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //延迟员工 item -> item.field(CluePutOffVo::getPutOffStaffName) .queryWrapper(putOffStaff -> { - if (StringUtils.isNotBlank(putOffStaff.getPutOffStaffId())) { + if (StrUtil.isNotBlank(putOffStaff.getPutOffStaffId())) { return queryChain().select(STAFF.NAME.as(CluePutOffVo::getPutOffStaffName)) .from(STAFF) .where(STAFF.ID.eq(putOffStaff.getPutOffStaffId())); @@ -414,7 +411,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //审核员工 item -> item.field(CluePutOffVo::getAuditStaffName) .queryWrapper(auditStaff -> { - if (StringUtils.isNotBlank(auditStaff.getAuditStaffId())) { + if (StrUtil.isNotBlank(auditStaff.getAuditStaffId())) { return queryChain().select(STAFF.NAME.as(CluePutOffVo::getAuditStaffName)) .from(STAFF) .where(STAFF.ID.eq(auditStaff.getAuditStaffId())); @@ -475,7 +472,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (cityList == null || cityList.isEmpty()){ throw new ServiceException("您尚未被分配区域,无法查看线索"); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) @@ -500,7 +497,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //开发员工 item -> item.field(CluePageVo::getDevStaffName) .queryWrapper(devStaff -> { - if (StringUtils.isNotBlank(devStaff.getDevStaffId())) { + if (StrUtil.isNotBlank(devStaff.getDevStaffId())) { return queryChain().select(STAFF.NAME.as(CluePageVo::getDevStaffName)) .from(STAFF) .where(STAFF.ID.eq(devStaff.getDevStaffId())); @@ -511,7 +508,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //最后领取员工 item -> item.field(CluePageVo::getLastReceiptStaffName) .queryWrapper(lastReceiptStaff -> { - if (StringUtils.isNotBlank(lastReceiptStaff.getLastReceiptStaffId())) { + if (StrUtil.isNotBlank(lastReceiptStaff.getLastReceiptStaffId())) { return queryChain().select(STAFF.NAME.as(CluePageVo::getDevStaffName)) .from(STAFF) .where(STAFF.ID.eq(lastReceiptStaff.getLastReceiptStaffId())); @@ -552,10 +549,10 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (cityList == null || cityList.isEmpty()) { throw new ServiceException("当前年没有设置签约指标,请先设置后再进行操作"); } - if (!StringUtils.equals("其他", city)) { + if (!StrUtil.equals("其他", city)) { queryWrapper.and(CLUE.CITY.eq(city)); }*/ - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.LAST_RECEIPT_TIME,CLUE.LAST_RECEIPT_STAFF_ID) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) .select(BRAND.BRAND_NAME) @@ -579,7 +576,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //开发员工 item -> item.field(CluePageVo::getDevStaffName) .queryWrapper(devStaff -> { - if(StringUtils.isNotBlank(devStaff.getDevStaffId())){ + if(StrUtil.isNotBlank(devStaff.getDevStaffId())){ return queryChain().select(STAFF.NAME.as(CluePageVo::getDevStaffName)) .from(STAFF) .where(STAFF.ID.eq(devStaff.getDevStaffId())); @@ -590,7 +587,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //最后领取员工 item -> item.field(CluePageVo::getLastReceiptStaffName) .queryWrapper(lastReceiptStaff -> { - if (StringUtils.isNotBlank(lastReceiptStaff.getLastReceiptStaffId())) { + if (StrUtil.isNotBlank(lastReceiptStaff.getLastReceiptStaffId())) { return queryChain().select(STAFF.NAME.as(CluePageVo::getDevStaffName)) .from(STAFF) .where(STAFF.ID.eq(lastReceiptStaff.getLastReceiptStaffId())); @@ -624,11 +621,11 @@ public class ClueServiceImpl extends ServiceImpl implements Cl if (userIdLock.tryLock()) { try { Clue clue = this.getById(id); - if (StringUtils.isNotBlank(clue.getResponsibleStaffId())){ + if (StrUtil.isNotBlank(clue.getResponsibleStaffId())){ throw new ServiceException("当前线索已被领取,请刷新页面后重试"); } String loginIdAsString = StpUtil.getLoginIdAsString(); - if (StringUtils.isBlank(clue.getDevStaffId())) { + if (StrUtil.isBlank(clue.getDevStaffId())) { clue.setDevStaffId(loginIdAsString); } LocalDateTime now = LocalDateTime.now(); @@ -674,7 +671,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl public Page getMyDevCluePage(String city, String brandId, String storeId, String chargeOrPhone) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(city) && StringUtils.equals("其他", city)) { + if (StrUtil.isNotBlank(city) && StrUtil.equals("其他", city)) { List dictValues = SpringUtils.getBean(DictDataService.class).getDictDataByDictType("oam_clue_area") .stream().map(DictData::getDictValue).collect(Collectors.toList()); if (dictValues.isEmpty()) { @@ -685,10 +682,10 @@ public class ClueServiceImpl extends ServiceImpl implements Cl cityList.addAll(Arrays.asList(item.split("/"))); }); queryWrapper.and(CLUE.CITY.notIn(cityList)); - } else if (StringUtils.isNotBlank(city)) { + } else if (StrUtil.isNotBlank(city)) { queryWrapper.and(CLUE.CITY.eq(city)); } - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), queryWrapper + return this.mapper.paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), queryWrapper .select(CLUE.CITY,CLUE.ID,CLUE.CREATE_TIME,CLUE.DEV_STAFF_ID,CLUE.LAST_FOLLOW_UP_TIME,CLUE.LAST_FOLLOW_UP_CONTENT,CLUE.RECEIPT_TIME,CLUE.STORE_ID,CLUE.RESPONSIBLE_STAFF_ID, CLUE.CLUE_STATUS) .select(STORE.STORE_NAME,STORE.STORE_ADDR,STORE.PERSON_CHARGE_NAME,STORE.PERSON_CHARGE_PHONE) @@ -718,7 +715,7 @@ public class ClueServiceImpl extends ServiceImpl implements Cl //负责员工 item -> item.field(CluePageVo::getResponsibleStaffName) .queryWrapper(responsibleStaff -> { - if (StringUtils.isNotBlank(responsibleStaff.getResponsibleStaffId())){ + if (StrUtil.isNotBlank(responsibleStaff.getResponsibleStaffId())){ return queryChain().select(STAFF.NAME.as(CluePageVo::getResponsibleStaffName)) .from(STAFF) .where(STAFF.ID.eq(responsibleStaff.getResponsibleStaffId())); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java index e615506..0620ff5 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/CommonServiceImpl.java @@ -1,12 +1,12 @@ package com.cpop.oam.business.service.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.table.Config; import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.SysConfigInfoBo; import com.cpop.oam.business.service.CommonService; import com.cpop.oam.business.vo.ConfigInfoVo; @@ -104,7 +104,7 @@ public class CommonServiceImpl implements CommonService { Map configMap = new HashMap<>(8); Arrays.asList(OamConfigKey.WORK_WX_INFO).forEach(item -> { String cacheInfo = redisService.getCacheObject(getCacheKey(item)); - if (StringUtils.isNotBlank(cacheInfo)) { + if (StrUtil.isNotBlank(cacheInfo)) { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item); configMap.put(sysConfigEnum.getField(), cacheInfo); @@ -118,9 +118,7 @@ public class CommonServiceImpl implements CommonService { } } }); - ConfigInfoVo sysConfigInfoVo = new ConfigInfoVo(); - BeanUtils.mapToObj(configMap, sysConfigInfoVo); - return sysConfigInfoVo; + return BeanUtil.toBean(configMap, ConfigInfoVo.class); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java index 7018f14..0a50372 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DataImportServiceImpl.java @@ -1,6 +1,9 @@ package com.cpop.oam.business.service.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.exception.ExcelDataConvertException; @@ -9,13 +12,10 @@ import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.util.ListUtils; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; +import com.cpop.core.handler.UploadHandler; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; -import com.cpop.core.utils.file.FileUploadUtils; -import com.cpop.core.utils.file.FileUtils; import com.cpop.oam.business.bo.DataImportBo; import com.cpop.oam.business.bo.DataImportPageBo; import com.cpop.oam.business.dto.DataImportDto; @@ -23,8 +23,8 @@ import com.cpop.oam.business.entity.DataImport; import com.cpop.oam.business.mapper.DataImportMapper; import com.cpop.oam.business.service.DataImportService; import com.cpop.oam.business.vo.DataImportPageVo; -import com.cpop.oam.framework.constant.OamRedisConstant; import com.cpop.oam.business.vo.SysFileVo; +import com.cpop.oam.framework.constant.OamRedisConstant; import com.cpop.oam.framework.handler.tencentCos.TencentCosHandler; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; @@ -43,8 +43,8 @@ import java.util.Map; import java.util.concurrent.locks.Lock; import static com.alibaba.excel.cache.Ehcache.BATCH_COUNT; -import static com.cpop.oam.business.entity.table.DataImportTableDef.DATA_IMPORT; import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; +import static com.cpop.oam.business.entity.table.DataImportTableDef.DATA_IMPORT; import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** @@ -67,7 +67,7 @@ public class DataImportServiceImpl extends ServiceImpl getDataImportPage(DataImportPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), + return this.pageAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), QueryWrapper.create().select(DATA_IMPORT.ID, DATA_IMPORT.FILE_URL, DATA_IMPORT.IS_CLEAR, DATA_IMPORT.IMPORT_STATUS, DATA_IMPORT.CREATE_TIME) .select(BRAND.BRAND_NAME) .select(STORE.STORE_NAME) @@ -87,7 +87,7 @@ public class DataImportServiceImpl extends ServiceImpl> headMap, AnalysisContext context) { - if (!StringUtils.equals(headMap.get(15).getStringValue(), "停卡缓冲天数")) { + if (!StrUtil.equals(headMap.get(15).getStringValue(), "停卡缓冲天数")) { throw new ServiceException("模板错误,请使用Oam导入模板"); } } @@ -289,15 +289,15 @@ public class DataImportServiceImpl extends ServiceImpl { return cachedDataList; }); - MultipartFile multipartFile = FileUtils.getInstance().getMultipartFile(tempFile); + UploadHandler uploadHandler = SpringUtils.getBean(UploadHandler.class); //文件上传 TencentCosHandler tencentCosHandler = SpringUtils.getBean(TencentCosHandler.class); - UploadResult uploadResult = tencentCosHandler.cdnUpload(multipartFile); - String filename = FileUploadUtils.getInstance().extractFilename(multipartFile); + UploadResult uploadResult = tencentCosHandler.cdnUpload(tempFile,uploadHandler.getContentType(FileUtil.getType(tempFile))); + String filename = uploadHandler.extractFilename(file); SysFileVo sysFileVo = new SysFileVo(); sysFileVo.setUrl("https://" + uploadResult.getBucketName() + tencentCosHandler.getCdnUrl() + uploadResult.getKey()) .setFileName(filename) - .setNewFileName(FileUtils.getInstance().getName(filename)) + .setNewFileName(uploadHandler.getName(filename)) .setOriginalFilename(file.getOriginalFilename()); return sysFileVo; } catch (IOException e) { diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java index a4a461f..0385cd0 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java @@ -1,9 +1,9 @@ package com.cpop.oam.business.service.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.DeptBo; import com.cpop.oam.business.bo.DeptListBo; import com.cpop.oam.business.entity.Dept; @@ -113,7 +113,7 @@ public class DeptServiceImpl extends ServiceImpl implements De private List getChildList(List list, DeptVo t) { List tList = new ArrayList(); for (DeptVo deptVo : list) { - if (StringUtils.isNotNull(deptVo.getParentId()) && StringUtils.equals(deptVo.getParentId(), t.getId())) { + if (StrUtil.isNotBlank(deptVo.getParentId()) && StrUtil.equals(deptVo.getParentId(), t.getId())) { tList.add(deptVo); } } @@ -127,7 +127,7 @@ public class DeptServiceImpl extends ServiceImpl implements De */ @Override public void insertDept(DeptBo bo) { - Dept entity = BeanUtils.mapToClass(bo, Dept.class); + Dept entity = BeanUtil.toBean(bo, Dept.class); this.save(entity); } @@ -139,7 +139,7 @@ public class DeptServiceImpl extends ServiceImpl implements De */ @Override public void updateDept(DeptBo bo) { - Dept entity = BeanUtils.mapToClass(bo, Dept.class); + Dept entity = BeanUtil.toBean(bo, Dept.class); this.updateById(entity); } @@ -182,7 +182,7 @@ public class DeptServiceImpl extends ServiceImpl implements De deptIds.add(id); //获取其子部门 List filterList = list.stream() - .filter(s -> StringUtils.equals(s.getParentId(), id)) + .filter(s -> StrUtil.equals(s.getParentId(), id)) .collect(Collectors.toList()); recursionRemoveIds(deptIds, filterList); return deptIds; @@ -199,7 +199,7 @@ public class DeptServiceImpl extends ServiceImpl implements De filterList.forEach(item -> { deptIds.add(item.getId()); recursionRemoveIds(deptIds, filterList.stream() - .filter(s -> null != s.getParentId() && StringUtils.equals(s.getParentId(), item.getId())) + .filter(s -> null != s.getParentId() && StrUtil.equals(s.getParentId(), item.getId())) .collect(Collectors.toList())); }); } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictDataServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictDataServiceImpl.java index fd29ad9..d91e620 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictDataServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictDataServiceImpl.java @@ -1,22 +1,22 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.enums.UserType; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.DictDataBo; import com.cpop.oam.business.bo.DictDataPageBo; +import com.cpop.oam.business.entity.DictData; +import com.cpop.oam.business.mapper.DictDataMapper; +import com.cpop.oam.business.service.DictDataService; import com.cpop.oam.business.vo.DictDataPageVo; import com.cpop.oam.business.vo.DictDataVo; import com.cpop.oam.framework.utils.DictUtils; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.DictData; -import com.cpop.oam.business.mapper.DictDataMapper; -import com.cpop.oam.business.service.DictDataService; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -45,7 +45,7 @@ public class DictDataServiceImpl extends ServiceImpl i @Override public Page getDictDataPage(DictDataPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.pageAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(DICT_DATA.ID, DICT_DATA.DICT_LABEL, DICT_DATA.DICT_VALUE, DICT_DATA.DICT_TYPE, DICT_DATA.UPDATE_TIME,DICT_DATA.STATUS,DICT_DATA.DICT_SORT) .where(DICT_DATA.USER_TYPE.eq(StpUtil.getSession().getString("userType"))) @@ -66,7 +66,7 @@ public class DictDataServiceImpl extends ServiceImpl i */ @Override public DictDataVo getDictDataInfo(String id) { - return BeanUtils.mapToClass(this.getById(id), DictDataVo.class); + return BeanUtil.toBean(this.getById(id), DictDataVo.class); } /** @@ -88,7 +88,7 @@ public class DictDataServiceImpl extends ServiceImpl i .and(DICT_DATA.DICT_TYPE.eq(dictType)) .and(DICT_DATA.USER_TYPE.eq(StpUtil.getSession().get("userType"))) .orderBy(DICT_DATA.DICT_SORT.asc())); - if (StringUtils.isNotEmpty(dictCache)) { + if (dictCache != null) { DictUtils.setDictCache(dictType, dictCache); return dictCache; } @@ -103,7 +103,7 @@ public class DictDataServiceImpl extends ServiceImpl i */ @Override public void insertDictData(DictDataBo bo) { - DictData dictData = BeanUtils.mapToClass(bo, DictData.class); + DictData dictData = BeanUtil.toBean(bo, DictData.class); dictData.setUserType((UserType) StpUtil.getSession().get("userType")); boolean save = this.save(dictData); if (save) { @@ -125,12 +125,12 @@ public class DictDataServiceImpl extends ServiceImpl i */ @Override public void updateDictData(DictDataBo bo) { - DictData dictData = BeanUtils.mapToClass(bo, DictData.class); + DictData dictData = BeanUtil.toBean(bo, DictData.class); boolean save = this.updateById(dictData); if (save) { List dictDatas = getDictDataByDictType(dictData.getDictType()); //判断新增的数据是否在缓存中 - List filterList = dictDatas.stream().filter(item -> !StringUtils.equals(item.getId(), dictData.getId())).collect(Collectors.toList()); + List filterList = dictDatas.stream().filter(item -> !StrUtil.equals(item.getId(), dictData.getId())).collect(Collectors.toList()); filterList.add(getById(dictData.getId())); //排序 DictUtils.setDictCache(dictData.getDictType(), filterList); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictTypeServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictTypeServiceImpl.java index c6a8838..71af3dc 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictTypeServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DictTypeServiceImpl.java @@ -1,22 +1,22 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; import com.cpop.oam.business.bo.DictTypeBo; import com.cpop.oam.business.entity.DictData; +import com.cpop.oam.business.entity.DictType; +import com.cpop.oam.business.mapper.DictTypeMapper; import com.cpop.oam.business.service.DictDataService; +import com.cpop.oam.business.service.DictTypeService; import com.cpop.oam.business.vo.DictTypePageVo; import com.cpop.oam.framework.utils.DictUtils; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.DictType; -import com.cpop.oam.business.mapper.DictTypeMapper; -import com.cpop.oam.business.service.DictTypeService; import org.springframework.stereotype.Service; import java.util.Comparator; @@ -49,7 +49,7 @@ public class DictTypeServiceImpl extends ServiceImpl i //获取分页参数 PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); //获取当前登陆用户类型 - return this.pageAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.pageAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create().select(DICT_TYPE.ID, DICT_TYPE.STATUS, DICT_TYPE.DICT_NAME, DICT_TYPE.DICT_TYPE_, DICT_TYPE.UPDATE_TIME) .where(DICT_TYPE.USER_TYPE.eq(StpUtil.getSession().get("userType"))) .and(DICT_TYPE.DICT_NAME.likeLeft(dictName)), @@ -66,11 +66,11 @@ public class DictTypeServiceImpl extends ServiceImpl i */ @Override public Boolean checkDictTypeUnique(DictTypeBo bo) { - String dictId = StringUtils.isNotBlank(bo.getId()) ? bo.getId() : "-1"; + String dictId = StrUtil.isNotBlank(bo.getId()) ? bo.getId() : "-1"; DictType dictType = this.getOne(QueryWrapper.create() .where(DICT_TYPE.DICT_TYPE_.eq(bo.getDictType())) .and(DICT_TYPE.USER_TYPE.eq(StpUtil.getSession().get("userType")))); - return dictType == null || StringUtils.equals(dictId, dictType.getId()); + return dictType == null || StrUtil.equals(dictId, dictType.getId()); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java index 5f6f2ca..eea7981 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DutyServiceImpl.java @@ -1,9 +1,9 @@ package com.cpop.oam.business.service.impl; +import cn.hutool.core.util.StrUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; import com.cpop.oam.business.bo.DutyBo; import com.cpop.oam.business.bo.DutyListBo; import com.cpop.oam.business.dto.StaffDto; @@ -23,11 +23,9 @@ import org.springframework.stereotype.Service; import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import static com.cpop.core.base.table.table.UserTableDef.USER; @@ -57,7 +55,7 @@ public class DutyServiceImpl extends ServiceImpl implements Du public List getDutyList(DutyListBo bo) { //默认查询当月 LocalDate date; - if (StringUtils.isNotBlank(bo.getDutyMoth())) { + if (StrUtil.isNotBlank(bo.getDutyMoth())) { DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); date = LocalDate.parse(bo.getDutyMoth() + "-15", df); } else { @@ -108,21 +106,25 @@ public class DutyServiceImpl extends ServiceImpl implements Du @Override public void insertDuty(DutyBo bo) { //开始日期,结束日期 - String startDate = bo.getDutyDate().get(0); - String endDate = bo.getDutyDate().get(1); - //TODO: - /*List dateList = DateUtils.getDatesBetweenTwoDatesT(Date.valueOf(startDate), Date.valueOf(endDate)); + LocalDate startDate = bo.getDutyDate().get(0); + LocalDate endDate = bo.getDutyDate().get(1); + List dateList = new ArrayList<>(); + long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate); + for (int i = 0; i <= numOfDaysBetween; i++) { + LocalDate date = startDate.plusDays(i); + dateList.add(date); + } //先删后存 this.remove(QueryWrapper.create().where(DUTY.DUTY_DATE.ge(startDate).and(DUTY.DUTY_DATE.le(endDate)))); List entityList = new ArrayList(); dateList.forEach(item->{ Duty entity = new Duty(); - entity.setDutyDate(LocalDate.parse(item)) + entity.setDutyDate(item) .setServiceStaffId(bo.getServiceStaffId()) .setTechnologyStaffId(bo.getTechnologyStaffId()); entityList.add(entity); }); - this.saveBatch(entityList);*/ + this.saveBatch(entityList); } /** diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java index 040802d..c5090bb 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/FinanceReimburseServiceImpl.java @@ -1,6 +1,8 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; @@ -9,8 +11,6 @@ import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.entity.FinanceReimburse; import com.cpop.oam.business.entity.FinanceReimburseStage; @@ -73,7 +73,7 @@ public class FinanceReimburseServiceImpl extends ServiceImpl getReimburseAuditPage(FinanceReimburseAuditPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), + return this.mapper.paginateAs(pageDomain.getPage(), pageDomain.getPageSize(), QueryWrapper.create().select(FINANCE_REIMBURSE.ALL_COLUMNS) .select(STAFF.NAME.as(FinanceReimbursePageVo::getStaffName)) .select(FINANCE_REIMBURSE_TYPE.TYPE_NAME.as(FinanceReimbursePageVo::getTypeName)) @@ -170,7 +170,7 @@ public class FinanceReimburseServiceImpl extends ServiceImpl implements Me return buildMenuRouteTree(list); } else { //一般管理员 - if (StringUtils.equals(session.getString("roleId"), InitRoleEnum.SUPER_OAM_ROLE.getId())) { + if (StrUtil.equals(session.getString("roleId"), InitRoleEnum.SUPER_OAM_ROLE.getId())) { return buildMenuRouteTree(this.listAs(QueryWrapper.create() .where(MENU.TYPE.in(0, 1)) //构建公共菜单与特有菜单 .and(MENU.USER_TYPE.eq(session.get("userType"))) .where(MENU.STATUS.eq(1)) - .and(MENU.NAME.notIn(Constants.HIDE_MENU.split(","))) + .and(MENU.NAME.notIn((Object[]) Constants.HIDE_MENU.split(","))) .orderBy(MENU.ORDER_NO.asc()), MenuRouteVo.class)); }else { @@ -72,7 +72,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me .leftJoin(ROLE).on(ROLE.ID.eq(ROLE_MENU.ROLE_ID)) .where(MENU.STATUS.eq(1)) .and(MENU.TYPE.in(0, 1)) - .and(MENU.NAME.notIn(Constants.HIDE_MENU.split(","))) + .and(MENU.NAME.notIn((Object[]) Constants.HIDE_MENU.split(","))) .and(ROLE_MENU.ROLE_ID.eq(session.getString("roleId"))) //构建公共菜单与特有菜单 .and(MENU.USER_TYPE.eq(session.get("userType"))) @@ -128,7 +128,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } //构建根节点 List tempList = menus.stream() - .filter(s -> StringUtils.isBlank(s.getParentMenu())).toList(); + .filter(s -> StrUtil.isBlank(s.getParentMenu())).toList(); for (MenuVo menu : tempList) { MenuVo menuVo = recursionFn(menus, menu); returnList.add(menuVo); @@ -166,13 +166,12 @@ public class MenuServiceImpl extends ServiceImpl implements Me */ @Override public void insertSysMenu(MenuBo bo) { - Menu entity = new Menu(); - BeanUtils.copyBeanProp(entity, bo); + Menu entity = BeanUtil.toBean(bo,Menu.class); SaSession session = StpUtil.getSession(); //设置菜单名 - if (StringUtils.isNotBlank(bo.getPath())){ + if (StrUtil.isNotBlank(bo.getPath())){ String[] split = bo.getPath().split("/"); - String name = StringUtils.getMethodName(split[split.length - 1].replace("/", "")); + String name = StrUtil.upperFirst(split[split.length - 1].replace("/", "")); //名字不能重复 long count = this.count(QueryWrapper.create().where(MENU.NAME.eq(name)).and(MENU.USER_TYPE.eq(session.get("userType")))); if (count > 0) { @@ -183,7 +182,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me entity.setName(null); } //设置组件 - if (StringUtils.isBlank(bo.getComponent())){ + if (StrUtil.isBlank(bo.getComponent())){ entity.setComponent("LAYOUT"); } //获取当前用户 @@ -199,16 +198,15 @@ public class MenuServiceImpl extends ServiceImpl implements Me **/ @Override public void updateSysMenu(MenuBo bo) { - Menu entity = new Menu(); - BeanUtils.copyBeanProp(entity, bo); + Menu entity = BeanUtil.toBean(bo,Menu.class); //设置菜单名 - if (StringUtils.isNotBlank(bo.getPath())){ + if (StrUtil.isNotBlank(bo.getPath())){ String[] split = bo.getPath().split("/"); String toUpperCaseString = split[split.length - 1]; if (toUpperCaseString.contains(":")) { toUpperCaseString = split[split.length - 2]; } - String name = StringUtils.getMethodName(toUpperCaseString.replace("/", "")); + String name = StrUtil.upperFirst(toUpperCaseString.replace("/", "")); //名字不能重复 long count = this.count(QueryWrapper.create().where(MENU.NAME.eq(name)).and(MENU.USER_TYPE.eq(StpUtil.getSession().get("userType")))); if (count > 1) { @@ -217,7 +215,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me entity.setName(name); } //设置组件 - if (StringUtils.isBlank(bo.getComponent())){ + if (StrUtil.isBlank(bo.getComponent())){ entity.setComponent("LAYOUT"); } this.updateById(entity); @@ -281,7 +279,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me item.setMeta(meta); }); //构建根节点 - List tempList = menus.stream().filter(s -> StringUtils.isBlank(s.getParentMenu())).toList(); + List tempList = menus.stream().filter(s -> StrUtil.isBlank(s.getParentMenu())).toList(); List menuRoutes = new ArrayList<>(); for (MenuRouteVo menu : tempList) { MenuRouteVo menuVo = recursionMenuRoute(menus, menu); @@ -289,7 +287,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me menuVo.getMeta().setHideChildrenInMenu(null != menuVo.getChildren() && menuVo.getChildren().size() == 1 && menuVo.getChildren().get(0).getHideMenu()); menuRoutes.add(menuVo); } - return BeanUtils.mapToList(menuRoutes, MenuRouteVo.class); + return BeanUtil.copyToList(menuRoutes, MenuRouteVo.class); } /** @@ -303,7 +301,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me // 得到子节点列表 List childList = new ArrayList(); for (MenuRouteVo menuNode : list) { - if (StringUtils.isNotBlank(menuNode.getParentMenu()) && menuNode.getParentMenu().equals(menu.getId())) { + if (StrUtil.isNotBlank(menuNode.getParentMenu()) && menuNode.getParentMenu().equals(menu.getId())) { childList.add(recursionMenuRoute(list, menuNode)); } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/NavigationServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/NavigationServiceImpl.java new file mode 100644 index 0000000..e7e7419 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/NavigationServiceImpl.java @@ -0,0 +1,35 @@ +package com.cpop.oam.business.service.impl; + +import com.cpop.oam.business.entity.Navigation; +import com.cpop.oam.business.mapper.NavigationMapper; +import com.cpop.oam.business.service.NavigationService; +import com.cpop.oam.business.vo.NavigationVo; +import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.spring.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +import static com.cpop.oam.business.entity.table.NavigationTableDef.NAVIGATION; + +/** + * 果酱模块化官网 导航栏表 服务层实现。 + * + * @author Yxz + * @since 2024-01-19 + */ +@Service("navigationService") +public class NavigationServiceImpl extends ServiceImpl implements NavigationService { + + /** + * 查询所有果酱模块化官网 导航栏表 + * @author Yxz + * @since 2024/1/22 18:53 + * @return java.util.List + **/ + @Override + public List getList() { + return this.listAs(QueryWrapper.create() + .select(NAVIGATION.ID, NAVIGATION.NAVIGATION_NAME, NAVIGATION.PATH, NAVIGATION.UPDATE_TIME), NavigationVo.class); + } +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/OamWxCpServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/OamWxCpServiceImpl.java index 2666fb0..099d567 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/OamWxCpServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/OamWxCpServiceImpl.java @@ -1,13 +1,14 @@ package com.cpop.oam.business.service.impl; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.asymmetric.KeyType; import com.cpop.core.base.enums.UserType; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.table.User; +import com.cpop.core.config.CpopConfig; import com.cpop.core.service.UserService; -import com.cpop.core.utils.RsaUtils; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.uuid.IdUtils; import com.cpop.oam.business.bo.StaffBo; import com.cpop.oam.business.entity.Dept; import com.cpop.oam.business.entity.Staff; @@ -134,7 +135,7 @@ public class OamWxCpServiceImpl implements OamWxCpService { Map userWxCpUserMap = new HashMap<>(); wxCpUsers.forEach(item -> { User sysUser = new User(); - sysUser.setId(IdUtils.fastSimpleUUID()) + sysUser.setId(IdUtil.getSnowflakeNextIdStr()) .setStatus(item.getStatus() == 1) .setUserType(UserType.OAM_USER) .setCreateUserId("1"); @@ -223,7 +224,7 @@ public class OamWxCpServiceImpl implements OamWxCpService { // 获取用户敏感信息 WxCpUserDetail userDetail = oauth2Service.getUserDetail(userInfo.getUserTicket()); // 此时可以获取敏感信息 - if (StringUtils.isBlank(userDetail.getMobile())) { + if (StrUtil.isBlank(userDetail.getMobile())) { throw new ServiceException("请重新扫码并授权敏感信息!"); } // 读取员工信息 @@ -243,14 +244,14 @@ public class OamWxCpServiceImpl implements OamWxCpService { for (Long departId : wxCpUser.getDepartIds()) { Dept dept = wxCpDeptMap.get(departId); if (dept != null) { - if (StringUtils.isBlank(deptIds)) { + if (StrUtil.isBlank(deptIds)) { deptIds = deptIds + dept.getId(); } else { deptIds = deptIds + "," + dept.getId(); } } } - String encrypt = SpringUtils.getBean(RsaUtils.class).encrypt(userDetail.getMobile()); + String encrypt = SpringUtils.getBean(CpopConfig.class).getLoginRsa().encryptBase64(userDetail.getMobile(), KeyType.PublicKey); // 读取用户通用信息 staffBo.setUserName(userDetail.getMobile()) .setName(wxCpUser.getName()) @@ -258,16 +259,16 @@ public class OamWxCpServiceImpl implements OamWxCpService { .setAvatar(userDetail.getAvatar()) .setEmail(userDetail.getBizMail()) .setPhoneNumber(userDetail.getMobile()) - .setSex(!StringUtils.equals(userDetail.getGender(), "1")) + .setSex(!StrUtil.equals(userDetail.getGender(), "1")) .setStatus(true) - .setStaffType(StringUtils.equals(wxCpUser.getMainDepartment(), "5") ? 0 : 1) + .setStaffType(StrUtil.equals(wxCpUser.getMainDepartment(), "5") ? 0 : 1) .setWxCpUserId(wxCpUser.getUserId()) // 密码默认为手机号 .setPassword(encrypt) // 设置部门 .setDeptId(deptIds) // 区分技术员工和运营员工 - .setRoleId(StringUtils.equals(wxCpUser.getMainDepartment(), "5") + .setRoleId(StrUtil.equals(wxCpUser.getMainDepartment(), "5") ? InitRoleEnum.WX_CP_INIT_TECHNOLOGY_ROLE.getId() : InitRoleEnum.WX_CP_INIT_OPERATION_ROLE.getId()); // 保存员工 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java index 1eb7008..722cfca 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/RoleServiceImpl.java @@ -1,25 +1,25 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.enums.UserType; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; -import com.cpop.oam.framework.enums.InitRoleEnum; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; import com.cpop.oam.business.bo.RoleBo; import com.cpop.oam.business.bo.RolePageBo; import com.cpop.oam.business.bo.RoleStatusBo; +import com.cpop.oam.business.entity.Role; import com.cpop.oam.business.entity.RoleMenu; +import com.cpop.oam.business.mapper.RoleMapper; import com.cpop.oam.business.service.RoleMenuService; +import com.cpop.oam.business.service.RoleService; import com.cpop.oam.business.vo.RolePageVo; +import com.cpop.oam.framework.enums.InitRoleEnum; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.Role; -import com.cpop.oam.business.mapper.RoleMapper; -import com.cpop.oam.business.service.RoleService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -49,7 +49,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro @Override public Page getSysRolePage(RolePageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page page = this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), + Page page = this.mapper.paginateAs(pageDomain.getPage(), pageDomain.getPageSize(), QueryWrapper.create() .select(ROLE.ALL_COLUMNS) .where(ROLE.ID.ne(InitRoleEnum.SUPER_OAM_ROLE.getId())) @@ -64,7 +64,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro .where(ROLE_MENU.ROLE_ID.in(page.getRecords().stream().map(RolePageVo::getId).collect(Collectors.toSet())))); page.getRecords().forEach(item -> { List filterMenuIds = roleMenuList.stream() - .filter(s -> StringUtils.equals(s.getRoleId(), item.getId())) + .filter(s -> StrUtil.equals(s.getRoleId(), item.getId())) .map(RoleMenu::getMenuId).collect(Collectors.toList()); item.setMenuIds(filterMenuIds); }); @@ -81,7 +81,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro @Override @Transactional(rollbackFor = Exception.class) public void insertSysRole(RoleBo bo) { - Role role = BeanUtils.mapToClass(bo, Role.class); + Role role = BeanUtil.toBean(bo, Role.class); role.setUserType((UserType) StpUtil.getSession().get("userType")); this.save(role); //将菜单信息录入中间表 @@ -106,8 +106,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro @Override @Transactional(rollbackFor = Exception.class) public void updateSysRole(RoleBo bo) { - Role entity = new Role(); - BeanUtils.copyBeanProp(entity, bo); + Role entity = BeanUtil.toBean(bo,Role.class); this.updateById(entity); //将菜单信息录入中间表 if (!bo.getMenuIds().isEmpty()) { @@ -148,7 +147,7 @@ public class RoleServiceImpl extends ServiceImpl implements Ro **/ @Override public void setSysRoleStatus(RoleStatusBo bo) { - this.updateById(BeanUtils.mapToClass(bo, Role.class)); + this.updateById(BeanUtil.toBean(bo, Role.class)); } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java index 11482e6..cf0fb37 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/SignGoalServiceImpl.java @@ -1,20 +1,20 @@ package com.cpop.oam.business.service.impl; -import com.cpop.core.utils.bean.BeanUtils; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; import com.cpop.oam.business.bo.SignGoalBo; import com.cpop.oam.business.entity.SignArea; +import com.cpop.oam.business.entity.SignGoal; +import com.cpop.oam.business.mapper.SignGoalMapper; import com.cpop.oam.business.service.SignAreaService; +import com.cpop.oam.business.service.SignGoalService; import com.cpop.oam.business.vo.SignGoalPageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.oam.business.entity.SignGoal; -import com.cpop.oam.business.mapper.SignGoalMapper; -import com.cpop.oam.business.service.SignGoalService; import org.springframework.stereotype.Service; import java.time.LocalDate; @@ -43,7 +43,7 @@ public class SignGoalServiceImpl extends ServiceImpl i @Override public Page getSignGoalPage() { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(),pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(),pageDomain.getPageSize()), QueryWrapper.create() .select(SIGN_GOAL.ID,SIGN_GOAL.STAFF_ID,SIGN_GOAL.YEAR,SIGN_GOAL.JAN_GOAL,SIGN_GOAL.JAN_FINISH,SIGN_GOAL.FEB_GOAL,SIGN_GOAL.FEB_FINISH,SIGN_GOAL.MAR_GOAL,SIGN_GOAL.MAR_FINISH, SIGN_GOAL.APR_GOAL,SIGN_GOAL.APR_FINISH,SIGN_GOAL.MAY_GOAL,SIGN_GOAL.MAY_FINISH,SIGN_GOAL.JUN_GOAL,SIGN_GOAL.JUN_FINISH,SIGN_GOAL.JUL_GOAL, @@ -75,7 +75,7 @@ public class SignGoalServiceImpl extends ServiceImpl i .and(SIGN_GOAL.STAFF_ID.eq(bo.getStaffId()))) > 0) { throw new ServiceException("该员工已存在签约指标"); } else { - SignGoal signGoal = BeanUtils.mapToClass(bo, SignGoal.class); + SignGoal signGoal = BeanUtil.toBean(bo, SignGoal.class); signGoal.setYear(year); this.save(signGoal); //新增签约区域 @@ -97,7 +97,7 @@ public class SignGoalServiceImpl extends ServiceImpl i @Override public void updateSignGoal(SignGoalBo bo) { //修改签约指标 - SignGoal signGoal = BeanUtils.mapToClass(bo, SignGoal.class); + SignGoal signGoal = BeanUtil.toBean(bo, SignGoal.class); this.updateById(signGoal); List signAreas = new ArrayList<>(); bo.getSignAreaList().forEach(item->{ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java index 450a30b..07c1b46 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/StaffServiceImpl.java @@ -2,17 +2,22 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.secure.BCrypt; import cn.dev33.satoken.stp.StpUtil; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import com.alibaba.fastjson2.JSONObject; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.enums.UserType; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.table.User; +import com.cpop.core.config.CpopConfig; import com.cpop.core.constant.Constants; import com.cpop.core.service.RedisService; import com.cpop.core.service.UserService; -import com.cpop.core.utils.*; -import com.cpop.core.utils.bean.BeanUtils; -import com.cpop.core.utils.uuid.IdUtils; +import com.cpop.core.utils.MessageUtils; +import com.cpop.core.utils.SpringUtils; +import com.cpop.core.utils.SqlUtils; import com.cpop.oam.business.bo.*; import com.cpop.oam.business.entity.Staff; import com.cpop.oam.business.entity.StaffMidDept; @@ -69,7 +74,7 @@ public class StaffServiceImpl extends ServiceImpl implements @Override public Page getStaffPageList(StaffPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize() + return this.mapper.paginateAs(pageDomain.getPage(), pageDomain.getPageSize() , QueryWrapper.create() //去重 .select(distinct(STAFF.ALL_COLUMNS)) @@ -108,16 +113,16 @@ public class StaffServiceImpl extends ServiceImpl implements throw new ServiceException(MessageUtils.message("i18n_alert_userOrPhoneOrEmailIsExist")); } else { //用户名-手机-邮箱都需要做唯一校验 - user = BeanUtils.mapToClass(bo, User.class); + user = BeanUtil.toBean(bo, User.class); //解密与重设密码 user.setRsaPassword(bo.getPassword()); decryptAndResetPasswords(user); - user.setId(IdUtils.fastSimpleUUID()); + user.setId(IdUtil.getSnowflakeNextIdStr()); user.setUserType(UserType.OAM_USER); SpringUtils.getBean(UserService.class).save(user); } //再添加员工信息 - Staff sysStaff = BeanUtils.mapToClass(bo, Staff.class); + Staff sysStaff = BeanUtil.toBean(bo, Staff.class); sysStaff.setUserId(user.getId()); this.save(sysStaff); //批量导入部门信息 @@ -146,7 +151,7 @@ public class StaffServiceImpl extends ServiceImpl implements //手机号 .and(USER.USER_TYPE.eq(UserType.OAM_USER.toString())) .from(USER)); - if (StringUtils.isNotBlank(bo.getUserId())) { + if (StrUtil.isNotBlank(bo.getUserId())) { return count > 1; } else { return count > 0; @@ -161,7 +166,7 @@ public class StaffServiceImpl extends ServiceImpl implements **/ private void decryptAndResetPasswords(User user) { //先用rsa解密 - String password = SpringUtils.getBean(RsaUtils.class).decrypt(user.getPassword()); + String password = SpringUtils.getBean(CpopConfig.class).getLoginRsa().decryptStr(user.getPassword(), KeyType.PrivateKey); //再加密 user.setPassword(BCrypt.hashpw(password, BCrypt.gensalt())); } @@ -179,14 +184,14 @@ public class StaffServiceImpl extends ServiceImpl implements if (validatedUserInfo(bo)) { throw new ServiceException("用户名或手机号或邮箱已存在!"); } else { - User user = BeanUtils.mapToClass(bo, User.class); + User user = BeanUtil.toBean(bo, User.class); user.setId(bo.getUserId()); //密码在这里不做修改 user.setPassword(null); SpringUtils.getBean(UserService.class).updateById(user); } //再修改员工信息 - Staff sysStaff = BeanUtils.mapToClass(bo, Staff.class); + Staff sysStaff = BeanUtil.toBean(bo, Staff.class); this.updateById(sysStaff); //批量删除 StaffMidDeptService staffMidDeptService = SpringUtils.getBean(StaffMidDeptService.class); @@ -239,7 +244,7 @@ public class StaffServiceImpl extends ServiceImpl implements **/ @Override public void isAccountExist(String username, String id) { - if (StringUtils.isBlank(username)){ + if (StrUtil.isBlank(username)){ return; } if (SpringUtils.getBean(UserService.class).count(QueryWrapper.create() @@ -285,14 +290,14 @@ public class StaffServiceImpl extends ServiceImpl implements .and(OPERATION_LOG.RESULT.eq(bo.getResult())) .and(OPERATION_LOG.LEVEL.eq(bo.getLevel())) .and(OPERATION_LOG.ACTION_TYPE.eq(bo.getActionType())); - if (StringUtils.isNotBlank(bo.getFieldTime())){ + if (StrUtil.isNotBlank(bo.getFieldTime())){ String[] split = bo.getFieldTime().split(","); DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); queryWrapper.and(OPERATION_LOG.CREATE_TIME.ge(LocalDateTime.parse(split[0], df))) .and(OPERATION_LOG.CREATE_TIME.le(LocalDateTime.parse(split[1], df))); } PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - Page page = Db.paginate("cp_sys_operation_log", pageDomain.getPageNum(), pageDomain.getPageSize(), queryWrapper); + Page page = Db.paginate("cp_sys_operation_log", pageDomain.getPage(), pageDomain.getPageSize(), queryWrapper); return page.map(row -> row.toEntity(OperationLogVo.class)); } @@ -310,12 +315,11 @@ public class StaffServiceImpl extends ServiceImpl implements User user = DbChain.table(USER) .where(USER.ID.eq(bo.getUserId())) .oneAs(User.class); - if (!StringUtils.equals(userName, Constants.SUPER_ADMIN) || !StringUtils.equals(userName, user.getUsername())) { + if (!StrUtil.equals(userName, Constants.SUPER_ADMIN) || !StrUtil.equals(userName, user.getUsername())) { throw new ServiceException("非超级管理员不允许修改他人密码"); } //先用rsa解密 - RsaUtils rsaUtils = SpringUtils.getBean(RsaUtils.class); - String oldPassword = rsaUtils.decrypt(bo.getOldPassword()); + String oldPassword = SpringUtils.getBean(CpopConfig.class).getLoginRsa().decryptStr(bo.getOldPassword(),KeyType.PrivateKey); if (BCrypt.checkpw(oldPassword, user.getPassword())) { //存入系统 DbChain.table(USER) diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java index f9bd3f0..35351de 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskDemandServiceImpl.java @@ -3,6 +3,8 @@ package com.cpop.oam.business.service.impl; import cn.binarywang.wx.miniapp.api.WxMaQrcodeService; import cn.binarywang.wx.miniapp.api.WxMaService; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.base.enums.UserType; @@ -13,8 +15,6 @@ import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.TaskDemandBo; import com.cpop.oam.business.bo.TaskDemandPageBo; import com.cpop.oam.business.bo.TaskDemandUrgentBo; @@ -41,11 +41,11 @@ import java.util.Base64; import java.util.List; import static com.cpop.core.base.table.table.UserTableDef.USER; +import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; +import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; import static com.cpop.oam.business.entity.table.TaskDemandTableDef.TASK_DEMAND; import static com.cpop.oam.business.entity.table.TaskTableDef.TASK; -import static com.cpop.oam.business.entity.table.BrandTableDef.BRAND; -import static com.cpop.oam.business.entity.table.StoreTableDef.STORE; /** * OAM-任务-需求表 服务层实现。 @@ -92,7 +92,7 @@ public class TaskDemandServiceImpl extends ServiceImpl item.field(TaskDemandPageVo::getResponsibleStaffName).queryWrapper(responsibleStaffName -> { - if (StringUtils.isNotBlank(responsibleStaffName.getResponsibleStaffId())) { + if (StrUtil.isNotBlank(responsibleStaffName.getResponsibleStaffId())) { return QueryWrapper.create() .select(STAFF.NAME.as(TaskDemandPageVo::getResponsibleStaffId)) .from(STAFF) @@ -168,22 +168,21 @@ public class TaskDemandServiceImpl extends ServiceImpl implements Ta public Page getTaskArchivingPage(TaskArchivingPagBo bo) { // 获取当前员工 PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(TASK.ID, TASK.RESPONSIBLE_STAFF_ID, @@ -157,7 +157,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta public Page getToBeClaimedPage(String subject, String taskContent, Integer taskGetStatus) { // 获取当前员工 PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(TASK.ID, TASK.TASK_TYPE, @@ -195,18 +195,18 @@ public class TaskServiceImpl extends ServiceImpl implements Ta */ @Override public void insertIterationTask(TaskIterationBo bo) { - Task entity = BeanUtils.mapToClass(bo, Task.class); + Task entity = BeanUtil.toBean(bo, Task.class); // 默认待审核 默认开发中 entity.setTaskStatus(0).setTaskItem(0).setTaskType(0).setRecordStaffId(StpUtil.getLoginIdAsString()); this.save(entity); // 获取审核管理员手机号 RedisService redisService = SpringUtils.getBean(RedisService.class); String auditStaffPhone = redisService.getCacheObject(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); - if (StringUtils.isBlank(auditStaffPhone)) { + if (StrUtil.isBlank(auditStaffPhone)) { ConfigService configService = SpringUtils.getBean(ConfigService.class); Config sysConfig = configService.getById(OamConfigEnum.AUDIT_STAFF_PHONE.getKey()); auditStaffPhone = sysConfig.getConfigValue(); - if (StringUtils.isBlank(auditStaffPhone)) { + if (StrUtil.isBlank(auditStaffPhone)) { throw new ServiceException("尚未配置审核管理员信息!"); } } @@ -301,7 +301,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta */ @Override public void setTaskAuditComments(TaskAuditCommentsBo bo) { - Task entity = BeanUtils.mapToClass(bo, Task.class); + Task entity = BeanUtil.toBean(bo, Task.class); if (bo.getIsPass()) { entity.setTaskStatus(1); this.updateById(entity); @@ -332,11 +332,11 @@ public class TaskServiceImpl extends ServiceImpl implements Ta public Page getPersonTaskPage(String staffId, LocalDate startDate, LocalDate endDate) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); String testStaffPhones = SpringUtils.getBean(RedisService.class).getCacheObject(OamConfigKey.OAM_CONFIG_KEY + OamConfigEnum.TEST_STAFF_PHONE.getKey()); - if (StringUtils.isBlank(testStaffPhones)) { + if (StrUtil.isBlank(testStaffPhones)) { throw new ServiceException("测试员工手机号未配置,请联系相关人员配置"); } QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(staffId)){ + if (StrUtil.isNotBlank(staffId)){ Row staff = Db.selectOneByQuery(USER.getTableName(), QueryWrapper.create().select(USER.PHONE) .leftJoin(STAFF).on(STAFF.USER_ID.eq(USER.ID)) .where(STAFF.ID.eq(staffId))); @@ -370,9 +370,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta LocalDate lastDay = date.with(TemporalAdjusters.lastDayOfMonth()); queryWrapper.and(dateFormat(TASK.TASK_RECEIPT_TIME, "%Y-%m-%d").between(firstDay, lastDay)); } - return this.mapper.paginateAs(pageDomain.getPageNum(), - pageDomain.getPageSize(), - queryWrapper + return this.mapper.paginateAs(pageDomain.getPage(), pageDomain.getPageSize(), queryWrapper .select(TASK.ID, TASK.TASK_STATUS, TASK.TASK_CONTENT, TASK.TASK_ITEM, TASK.TASK_RATING, TASK.TASK_RECEIPT_TIME, TASK.EXPECTED_COMPLETION_DATE, TASK.TASK_PROGRESS, TASK.SUBJECT) .select(STAFF.NAME.as(PersonTaskPageVo::getResponsibleStaffName)) //个人绩点 @@ -407,7 +405,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta case -1: //判断当前任务状态 if (task.getTaskStatus() == 2) { - if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { + if (!StrUtil.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!"); } if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) { @@ -416,7 +414,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta task.setToTestTime(LocalDateTime.now()).setTaskStatus(3); } else { //测试转部署 - if (StringUtils.isBlank(bo.getTestToFinishUrl())) { + if (StrUtil.isBlank(bo.getTestToFinishUrl())) { throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交"); } task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8); @@ -434,7 +432,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta break; //转测试 case 0: - if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { + if (!StrUtil.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!"); } if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) { @@ -444,7 +442,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta break; //转部署 case 1: - if (StringUtils.isBlank(bo.getTestToFinishUrl())) { + if (StrUtil.isBlank(bo.getTestToFinishUrl())) { throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交"); } task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2); @@ -571,7 +569,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta private void isTaskResponsibleStaff(String taskId) { // 获取任务 Task task = this.getById(taskId); - if (!StringUtils.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { + if (!StrUtil.equals(task.getResponsibleStaffId(), StpUtil.getLoginIdAsString())) { throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!"); } } @@ -587,11 +585,11 @@ public class TaskServiceImpl extends ServiceImpl implements Ta @Override public TaskMonthStatisticsVo getTaskMonthStatistics(TaskMonthStatisticsBo bo) { QueryWrapper queryWrapper = QueryWrapper.create(); - if(StringUtils.isNotBlank(bo.getTechnologyStaffId())){ + if(StrUtil.isNotBlank(bo.getTechnologyStaffId())){ queryWrapper.and(TASK_STAFF_GROUP.STAFF_ID.eq(bo.getTechnologyStaffId())); } LocalDate firstDay; - if (StringUtils.isNotBlank(bo.getTaskMoth())) { + if (StrUtil.isNotBlank(bo.getTaskMoth())) { DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate date = LocalDate.parse(bo.getTaskMoth() + "-15", df); // 获取目标月的第一天 @@ -646,7 +644,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta //TODO: 获取月付 List allTheDateOfMonth = new ArrayList<>(); // 有传入月份 - if (StringUtils.isNotBlank(bo.getTaskMoth())) { + if (StrUtil.isNotBlank(bo.getTaskMoth())) { //allTheDateOfMonth = DateUtils.getAllTheDateOfTheMonth(DateUtils.parseDate(bo.getTaskMoth() + "-15")); } else { // 获取当月日期数组并遍历 @@ -776,7 +774,7 @@ public class TaskServiceImpl extends ServiceImpl implements Ta @Override public TaskIndividualGpaVo getIndividualGpa(String staffId, LocalDate startDate, LocalDate endDate) { QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(staffId)) { + if (StrUtil.isNotBlank(staffId)) { queryWrapper.and(TASK_STAFF_GROUP.STAFF_ID.eq(staffId)); } else { //获取当前用户信息 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskStaffGroupServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskStaffGroupServiceImpl.java index 928652d..332b884 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskStaffGroupServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/TaskStaffGroupServiceImpl.java @@ -1,11 +1,11 @@ package com.cpop.oam.business.service.impl; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.bo.TaskStaffGroupBo; import com.cpop.oam.business.entity.Task; import com.cpop.oam.business.entity.TaskStaffGroup; @@ -71,7 +71,7 @@ public class TaskStaffGroupServiceImpl extends ServiceImpl item.field(TaskWorkOrderReceiveDealPauseDto::getResponsibleStaffName) .queryWrapper(responsibleStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getResponsibleStaffName)) .from(STAFF) - .where(STAFF.ID.eq(StringUtils.isNotBlank(responsibleStaff.getResponsibleStaffId()) ? responsibleStaff.getResponsibleStaffId() : "-1"))), + .where(STAFF.ID.eq(StrUtil.isNotBlank(responsibleStaff.getResponsibleStaffId()) ? responsibleStaff.getResponsibleStaffId() : "-1"))), // 暂停人 item -> item.field(TaskWorkOrderReceiveDealPauseDto::getPauseStaffName) .queryWrapper(pauseStaff -> queryChain().select(STAFF.NAME.as(TaskWorkOrderReceiveDealPauseDto::getPauseStaffName)) .from(STAFF) - .where(STAFF.ID.eq(StringUtils.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))) + .where(STAFF.ID.eq(StrUtil.isNotBlank(pauseStaff.getPauseStaffId()) ? pauseStaff.getPauseStaffId() : "-1"))) ); if (dtoList.isEmpty()){ return new TaskWorkOrderReceiveDealPauseVo(); @@ -151,8 +151,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl receiveList = - BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Receive.class); + List receiveList = BeanUtil.copyToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Receive.class); if (taskWorkOrderReceiveDealPauseVo.getReceiveList() == null) { taskWorkOrderReceiveDealPauseVo.setReceiveList(receiveList); } else { @@ -164,8 +163,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl dealList = - BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Deal.class); + List dealList = BeanUtil.copyToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Deal.class); if (taskWorkOrderReceiveDealPauseVo.getDealList() == null) { taskWorkOrderReceiveDealPauseVo.setDealList(dealList); } else { @@ -174,8 +172,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl pauseList = - BeanUtils.mapToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Pause.class); + List pauseList = BeanUtil.copyToList(taskStatusMap.get(key), TaskWorkOrderReceiveDealPauseVo.Pause.class); taskWorkOrderReceiveDealPauseVo.setPauseList(pauseList); } }); @@ -209,7 +206,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl finishWorkOrderPage() { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), + return this.mapper.paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(TASK_WORK_ORDER.ID, TASK_WORK_ORDER.FINISH_STAFF_ID, TASK_WORK_ORDER.FINISH_TIME) .select(TASK.TASK_CONTENT) @@ -249,8 +246,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderStatPageVo::getPauseStaffName) .queryWrapper(pauseStaffName -> { - if (StringUtils.isNotBlank(pauseStaffName.getPauseStaffId())) { + if (StrUtil.isNotBlank(pauseStaffName.getPauseStaffId())) { return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getPauseStaffName)) .from(STAFF) .where(STAFF.ID.eq(pauseStaffName.getPauseStaffId())); @@ -937,7 +932,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderStatPageVo::getFinishStaffName) .queryWrapper(finishStaffName -> { - if (StringUtils.isNotBlank(finishStaffName.getFinishStaffId())) { + if (StrUtil.isNotBlank(finishStaffName.getFinishStaffId())) { return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getFinishStaffName)) .from(STAFF) .where(STAFF.ID.eq(finishStaffName.getFinishStaffId())); @@ -948,7 +943,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderStatPageVo::getRecordStaffName) .queryWrapper(recordStaffName -> { - if (StringUtils.isNotBlank(recordStaffName.getRecordStaffId())) { + if (StrUtil.isNotBlank(recordStaffName.getRecordStaffId())) { return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getRecordStaffName)) .from(STAFF) .where(STAFF.ID.eq(recordStaffName.getRecordStaffId())); @@ -959,7 +954,7 @@ public class TaskWorkOrderServiceImpl extends ServiceImpl item.field(TaskWorkOrderStatPageVo::getResponsibleStaffName) .queryWrapper(responsibleStaffName -> { - if (StringUtils.isNotBlank(responsibleStaffName.getResponsibleStaffId())){ + if (StrUtil.isNotBlank(responsibleStaffName.getResponsibleStaffId())){ return queryChain().select(STAFF.NAME.as(TaskWorkOrderStatPageVo::getResponsibleStaffName)) .from(STAFF) .where(STAFF.ID.eq(responsibleStaffName.getResponsibleStaffId())); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WebMapDataServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WebMapDataServiceImpl.java new file mode 100644 index 0000000..f42e0a6 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WebMapDataServiceImpl.java @@ -0,0 +1,17 @@ +package com.cpop.oam.business.service.impl; + +import com.cpop.oam.business.entity.WebMapData; +import com.cpop.oam.business.mapper.WebMapDataMapper; +import com.cpop.oam.business.service.WebMapDataService; +import com.mybatisflex.spring.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-05-20 13:59 + */ +@Service("webMapDataService") +public class WebMapDataServiceImpl extends ServiceImpl implements WebMapDataService { + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java index 25da4c1..1a8b082 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/WxOpenMiniServiceImpl.java @@ -1,7 +1,7 @@ package com.cpop.oam.business.service.impl; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; import com.cpop.oam.business.entity.WxOpenMini; import com.cpop.oam.business.mapper.WxOpenMiniMapper; import com.cpop.oam.business.service.WxOpenMiniService; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/NavigationVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/NavigationVo.java new file mode 100644 index 0000000..52d9a6b --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/NavigationVo.java @@ -0,0 +1,45 @@ +package com.cpop.oam.business.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + + +/** + * @Author: Yxz + * @Date: 2024/1/22 18:46 + * @Version: 1.0 + */ +@Data +@Accessors(chain = true) +@Schema(description = "导航栏VO") +public class NavigationVo { + /** + * id + */ + @Schema(description = "id") + private String id; + + /** + * 导航栏名称 + */ + @Schema(description = "导航栏名称") + private String navigationName; + + /** + * 路径 + */ + @Schema(description = "路径") + private String path; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @Schema(description = "更新时间") + private LocalDateTime updateTime; + +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebItemStyleVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebItemStyleVo.java new file mode 100644 index 0000000..69b565b --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebItemStyleVo.java @@ -0,0 +1,19 @@ +package com.cpop.oam.business.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * @author Yxz + * @since 2024/3/1 14:41 + */ +@Data +@Schema(description = "官网地图颜色对象") +public class WebItemStyleVo { + + /** + * 颜色 + */ + @Schema(description = "颜色") + private String color; +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebMapRegionDataVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebMapRegionDataVo.java new file mode 100644 index 0000000..83147a9 --- /dev/null +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WebMapRegionDataVo.java @@ -0,0 +1,48 @@ +package com.cpop.oam.business.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 官网3D地图Vo对象 + * @author Yxz + * @since 2024/3/1 14:40 + */ +@Data +@Accessors(chain = true) +@Schema(description = "官网3D地图Vo对象") +public class WebMapRegionDataVo { + + /** + * 地区名称 + */ + @Schema( description = "地区名称") + private String name; + + /** + * 经纬度 + */ + @Schema(description = "经纬度") + private List value; + + /** + * 颜色 + */ + @Schema(description = "颜色") + private WebItemStyleVo itemStyle; + + /** + * 校区数量 + */ + @Schema(description = "校区数量") + private Integer campusNum; + + /** + * 是否中心点(0否1是) + */ + @Schema(description = "是否中心点(0否1是)") + private Boolean isCentralPoint; +} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WxOpenMiniVo.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WxOpenMiniVo.java index bd0818c..d9dc6cb 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WxOpenMiniVo.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/vo/WxOpenMiniVo.java @@ -1,6 +1,6 @@ package com.cpop.oam.business.vo; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/SaTokenConfigure.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/SaTokenConfigure.java deleted file mode 100644 index 8b2158a..0000000 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/SaTokenConfigure.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.cpop.oam.framework.config; - -import cn.dev33.satoken.interceptor.SaInterceptor; -import cn.dev33.satoken.jwt.StpLogicJwtForSimple; -import cn.dev33.satoken.stp.StpLogic; -import cn.dev33.satoken.stp.StpUtil; -import com.cpop.core.constant.Constants; -import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.CorsConfigurationSource; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -import java.util.Arrays; -import java.util.Collections; - -/** - * @author DB - * @Description: Security配置中心 - * @since 2023-08-05 8:01 - */ -@Configuration -@RequiredArgsConstructor -public class SaTokenConfigure implements WebMvcConfigurer { - - /** - * 路径白名单 - */ - @Value("${cpop.jwt.white-list}") - private String whiteList; - - /** - * 上传路径url - */ - @Value("${cpop.profile}") - private String profile; - - /** - * 注册 Sa-Token 拦截器,打开注解式鉴权功能 - * - * @param registry 拦截器注册 - * @author DB - * @since 2024/3/20 - */ - @Override - public void addInterceptors(InterceptorRegistry registry) { - // 注册 Sa-Token 拦截器,打开注解式鉴权功能 - registry.addInterceptor(new SaInterceptor(handle -> { - StpUtil.checkLogin(); - })) - .addPathPatterns("/**") - .excludePathPatterns(Arrays.asList(whiteList.split(","))); - } - - /** - * Sa-Token 整合 jwt (Simple 简单模式) - * @author DB - * @since 2024/3/20 - * @return StpLogic - */ - @Bean - public StpLogic getStpLogicJwt() { - return new StpLogicJwtForSimple(); - } - - /** - * 配置跨源访问(CORS) - */ - @Bean - public CorsConfigurationSource corsConfigurationSource() { - CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(Collections.singletonList("*")); - configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); - configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type")); - configuration.applyPermitDefaultValues(); - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", configuration); - return source; - } - - /** - * 资源映射 - * - * @param registry 注册 - * @author DB - * @since 2023/5/27 13:57 - */ - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - //本地文件上传路径 - registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") - .addResourceLocations("file:" + profile + "/"); - } - -} diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxCp/WxCpProperties.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxCp/WxCpProperties.java index 9c534ac..69a2a8f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxCp/WxCpProperties.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxCp/WxCpProperties.java @@ -1,6 +1,6 @@ package com.cpop.oam.framework.config.wxCp; -import com.cpop.core.utils.JsonUtils; +import cn.hutool.json.JSONUtil; import lombok.Data; import lombok.Getter; import lombok.Setter; @@ -61,6 +61,6 @@ public class WxCpProperties { @Override public String toString() { - return JsonUtils.toJson(this); + return JSONUtil.toJsonStr(this); } } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxOpen/WxOpenRedisProperties.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxOpen/WxOpenRedisProperties.java index 65ad405..1a450b2 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxOpen/WxOpenRedisProperties.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/config/wxOpen/WxOpenRedisProperties.java @@ -1,6 +1,6 @@ package com.cpop.oam.framework.config.wxOpen; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -50,7 +50,7 @@ public class WxOpenRedisProperties { public RedisConnectionFactory wxOpenRedisConnectionFactory() { RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(host, port); configuration.setDatabase(database); - if (StringUtils.isNotBlank(password)) { + if (StrUtil.isNotBlank(password)) { configuration.setPassword(password); } return new JedisConnectionFactory(configuration); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/enums/OamConfigEnum.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/enums/OamConfigEnum.java index b2853b9..31d7be3 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/enums/OamConfigEnum.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/enums/OamConfigEnum.java @@ -1,6 +1,7 @@ package com.cpop.oam.framework.enums; -import com.cpop.core.utils.StringUtils; + +import cn.hutool.core.util.StrUtil; /** * 系统配置枚举 @@ -92,7 +93,7 @@ public enum OamConfigEnum { public static OamConfigEnum matchField(String field) { OamConfigEnum oamConfigEnum = null; for (OamConfigEnum configEnum : values()) { - if (StringUtils.equals(configEnum.getField(), field)) { + if (StrUtil.equals(configEnum.getField(), field)) { oamConfigEnum = configEnum; break; } @@ -108,7 +109,7 @@ public enum OamConfigEnum { public static OamConfigEnum matchKey(String key) { OamConfigEnum oamConfigEnum = null; for (OamConfigEnum configEnum : values()) { - if (StringUtils.equals(configEnum.getKey(), key)) { + if (StrUtil.equals(configEnum.getKey(), key)) { oamConfigEnum = configEnum; break; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/tencentCos/TencentCosHandler.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/tencentCos/TencentCosHandler.java index 40f2a28..370d2b4 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/tencentCos/TencentCosHandler.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/tencentCos/TencentCosHandler.java @@ -1,9 +1,10 @@ package com.cpop.oam.framework.handler.tencentCos; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson2.JSONObject; import com.cpop.core.base.exception.UtilException; -import com.cpop.core.utils.file.FileTypeUtils; -import com.cpop.core.utils.uuid.IdUtils; +import com.cpop.core.handler.UploadHandler; import com.cpop.oam.business.dto.BizLicenseOcrDto; import com.cpop.oam.framework.config.tencentCos.TencentCosProperties; import com.qcloud.cos.COSClient; @@ -32,6 +33,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.concurrent.ExecutorService; @@ -54,6 +56,9 @@ public class TencentCosHandler { private TransferManager transferManager; + @Autowired + private UploadHandler uploadHandler; + /** * @descriptions 初始化创建TransferManager 实例,这个实例用来后续调用高级接口 * @author DB @@ -134,15 +139,49 @@ public class TencentCosHandler { */ public UploadResult cdnUpload(MultipartFile file) { createTransferManager(); - String fileType = FileTypeUtils.getInstance().getFileType(file.getOriginalFilename()); try { + String fileType = FileUtil.getType(file.getResource().getFile()); ObjectMetadata objectMetadata = new ObjectMetadata(); // 上传的流如果能够获取准确的流长度,则推荐一定填写 content-length // 如果确实没办法获取到,则下面这行可以省略,但同时高级接口也没办法使用分块上传了 objectMetadata.setContentLength(file.getSize()); objectMetadata.setContentType(file.getContentType()); InputStream inputStream = file.getInputStream(); - PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), IdUtils.fastSimpleUUID() + "." + fileType, inputStream, objectMetadata); + PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), IdUtil.getSnowflakeNextId() + "." + fileType, inputStream, objectMetadata); + // 设置存储类型(如有需要,不需要请忽略此行代码), 默认是标准(Standard), 低频(standard_ia) + // 更多存储类型请参见 https://cloud.tencent.com/document/product/436/33417 + putObjectRequest.setStorageClass(StorageClass.Standard); + Upload upload = transferManager.upload(putObjectRequest); + UploadResult uploadResult = upload.waitForUploadResult(); + inputStream.close(); + return uploadResult; + } catch (IOException | InterruptedException e) { + throw new UtilException(e); + } finally { + shutdownTransferManager(transferManager); + } + } + + /** + * cdn上传 + * + * @param file 文件 + * @param contentType 内容类型 + * @return {@link UploadResult } + * @author DB + * @since 2024/05/24 + */ + public UploadResult cdnUpload(File file, String contentType) { + createTransferManager(); + try { + String fileType = FileUtil.getType(file); + ObjectMetadata objectMetadata = new ObjectMetadata(); + // 上传的流如果能够获取准确的流长度,则推荐一定填写 content-length + // 如果确实没办法获取到,则下面这行可以省略,但同时高级接口也没办法使用分块上传了 + objectMetadata.setContentLength(FileUtil.size(file)); + objectMetadata.setContentType(contentType); + InputStream inputStream = FileUtil.getInputStream(file); + PutObjectRequest putObjectRequest = new PutObjectRequest(properties.getBucketName(), IdUtil.getSnowflakeNextId() + "." + fileType, inputStream, objectMetadata); // 设置存储类型(如有需要,不需要请忽略此行代码), 默认是标准(Standard), 低频(standard_ia) // 更多存储类型请参见 https://cloud.tencent.com/document/product/436/33417 putObjectRequest.setStorageClass(StorageClass.Standard); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/ContactChangeHandler.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/ContactChangeHandler.java index 46e7375..3656922 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/ContactChangeHandler.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/ContactChangeHandler.java @@ -1,6 +1,6 @@ package com.cpop.oam.framework.handler.wxCp; -import com.cpop.core.utils.JsonUtils; +import cn.hutool.json.JSONUtil; import com.cpop.oam.business.service.StaffService; import com.cpop.oam.framework.builder.wxCp.TextBuilder; import com.cpop.oam.framework.constant.WxCpConstant; @@ -26,7 +26,7 @@ public class ContactChangeHandler extends AbstractHandler { @Override public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, WxSessionManager sessionManager) { - String content = "收到通讯录变更事件,内容:" + JsonUtils.toJson(wxMessage); + String content = "收到通讯录变更事件,内容:" + JSONUtil.toJsonStr(wxMessage); this.logger.info(content); //通知处理 switch (wxMessage.getChangeType()){ diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/LogHandler.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/LogHandler.java index af081a1..0db098f 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/LogHandler.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/LogHandler.java @@ -1,6 +1,6 @@ package com.cpop.oam.framework.handler.wxCp; -import com.cpop.core.utils.JsonUtils; +import com.alibaba.fastjson2.JSONObject; import me.chanjar.weixin.common.session.WxSessionManager; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage; @@ -17,7 +17,7 @@ public class LogHandler extends AbstractHandler { @Override public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage, Map context, WxCpService cpService, WxSessionManager sessionManager) { - this.logger.info("\n接收到请求消息,内容:{}", JsonUtils.toJson(wxMessage)); + this.logger.info("\n接收到请求消息,内容:{}", JSONObject.toJSONString(wxMessage)); return null; } diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/MsgHandler.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/MsgHandler.java index 262b5f6..343d45e 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/MsgHandler.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/handler/wxCp/MsgHandler.java @@ -1,6 +1,6 @@ package com.cpop.oam.framework.handler.wxCp; -import com.cpop.core.utils.JsonUtils; +import cn.hutool.json.JSONUtil; import com.cpop.oam.framework.builder.wxCp.TextBuilder; import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.session.WxSessionManager; @@ -30,7 +30,7 @@ public class MsgHandler extends AbstractHandler { } - String content = "收到信息内容:" + JsonUtils.toJson(wxMessage); + String content = "收到信息内容:" + JSONUtil.toJsonStr(wxMessage); return new TextBuilder().build(content, wxMessage, cpService); diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java index 1696034..9805f15 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/tasks/OamScheduledTasks.java @@ -1,13 +1,13 @@ package com.cpop.oam.framework.tasks; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; import com.cpop.api.tencent.wxWork.handler.WebHookSendHandler; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.table.Config; import com.cpop.core.service.ConfigService; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.oam.business.entity.Clue; import com.cpop.oam.business.entity.ClueRecord; import com.cpop.oam.business.entity.DataImport; @@ -116,7 +116,7 @@ public class OamScheduledTasks { Map configMap = new HashMap<>(8); Arrays.asList(OamConfigKey.SIGN_GOAL).forEach(item -> { String cacheInfo = redisService.getCacheObject(commonService.getCacheKey(item)); - if (StringUtils.isNotBlank(cacheInfo)) { + if (StrUtil.isNotBlank(cacheInfo)) { // 获取枚举 OamConfigEnum sysConfigEnum = OamConfigEnum.matchKey(item); configMap.put(sysConfigEnum.getField(), cacheInfo); @@ -130,10 +130,9 @@ public class OamScheduledTasks { } } }); - SignGoalConfigInfoVo signGoalConfigInfoVo = new SignGoalConfigInfoVo(); - BeanUtils.mapToObj(configMap, signGoalConfigInfoVo); + SignGoalConfigInfoVo signGoalConfigInfoVo = BeanUtil.toBean(configMap, SignGoalConfigInfoVo.class); //设置了线索指标 - if (StringUtils.isNotBlank(signGoalConfigInfoVo.getSignInterval())&&StringUtils.isNotBlank(signGoalConfigInfoVo.getFollowUpInterval())){ + if (StrUtil.isNotBlank(signGoalConfigInfoVo.getSignInterval())&&StrUtil.isNotBlank(signGoalConfigInfoVo.getFollowUpInterval())){ //查询所有有负责人的线索 ClueService clueService = SpringUtils.getBean(ClueService.class); List clueList = clueService.queryChain() diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/framework/utils/DictUtils.java b/Cpop-Oam/src/main/java/com/cpop/oam/framework/utils/DictUtils.java index fe82d52..6c450ce 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/framework/utils/DictUtils.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/framework/utils/DictUtils.java @@ -1,13 +1,13 @@ package com.cpop.oam.framework.utils; import cn.dev33.satoken.stp.StpUtil; -import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson2.JSONArray; import com.cpop.core.base.enums.UserType; import com.cpop.core.constant.Constants; import com.cpop.core.service.RedisService; import com.cpop.core.utils.SpringUtils; -import com.cpop.core.utils.StringUtils; import com.cpop.oam.business.entity.DictData; +import org.apache.commons.lang3.StringUtils; import java.util.Collection; import java.util.Comparator; @@ -43,7 +43,7 @@ public class DictUtils { */ public static List getDictCache(String key) { JSONArray arrayCache = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key)); - if (StringUtils.isNotNull(arrayCache)) { + if (arrayCache != null && !arrayCache.isEmpty()) { return arrayCache.toJavaList(DictData.class); } return null; @@ -83,7 +83,7 @@ public class DictUtils { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - if (StringUtils.isNotNull(datas)) { + if (datas != null && !datas.isEmpty()) { if (StringUtils.containsAny(separator, dictValue)) { for (DictData dict : datas) { for (String value : dictValue.split(separator)) { @@ -116,7 +116,7 @@ public class DictUtils { StringBuilder propertyString = new StringBuilder(); List datas = getDictCache(dictType); - if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) { + if (StringUtils.containsAny(separator, dictLabel) && datas != null && !datas.isEmpty()) { for (DictData dict : datas) { for (String label : dictLabel.split(separator)) { if (label.equals(dict.getDictLabel())) { diff --git a/Cpop-Mall/src/main/resources/mapper/CarouselMapper.xml b/Cpop-Oam/src/main/resources/WebMapDataMapper.xml similarity index 68% rename from Cpop-Mall/src/main/resources/mapper/CarouselMapper.xml rename to Cpop-Oam/src/main/resources/WebMapDataMapper.xml index a28e3f1..8654246 100644 --- a/Cpop-Mall/src/main/resources/mapper/CarouselMapper.xml +++ b/Cpop-Oam/src/main/resources/WebMapDataMapper.xml @@ -2,6 +2,6 @@ - + - + \ No newline at end of file diff --git a/Cpop-Oam/src/main/resources/DictDataMapper.xml b/Cpop-Oam/src/main/resources/mapper/DictDataMapper.xml similarity index 100% rename from Cpop-Oam/src/main/resources/DictDataMapper.xml rename to Cpop-Oam/src/main/resources/mapper/DictDataMapper.xml diff --git a/Cpop-Oam/src/main/resources/DictTypeMapper.xml b/Cpop-Oam/src/main/resources/mapper/DictTypeMapper.xml similarity index 100% rename from Cpop-Oam/src/main/resources/DictTypeMapper.xml rename to Cpop-Oam/src/main/resources/mapper/DictTypeMapper.xml diff --git a/Cpop-Mall/src/main/resources/mapper/RoleBrandMapper.xml b/Cpop-Oam/src/main/resources/mapper/NavigationMapper.xml similarity index 73% rename from Cpop-Mall/src/main/resources/mapper/RoleBrandMapper.xml rename to Cpop-Oam/src/main/resources/mapper/NavigationMapper.xml index b7daa32..6ffa460 100644 --- a/Cpop-Mall/src/main/resources/mapper/RoleBrandMapper.xml +++ b/Cpop-Oam/src/main/resources/mapper/NavigationMapper.xml @@ -2,6 +2,6 @@ - + diff --git a/Cpop-Pay/pom.xml b/Cpop-Pay/pom.xml index fe9e9a8..ad28b77 100644 --- a/Cpop-Pay/pom.xml +++ b/Cpop-Pay/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-Pay diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/ecpp/EcppConfiguration.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/ecpp/EcppConfiguration.java index 8594806..707dd6f 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/ecpp/EcppConfiguration.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/ecpp/EcppConfiguration.java @@ -2,17 +2,23 @@ package com.cpop.pay.framewok.config.ecpp; import cn.hutool.core.codec.Base64; import cn.hutool.core.util.HexUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.asymmetric.Sign; import cn.hutool.crypto.asymmetric.SignAlgorithm; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.cpop.core.base.exception.UtilException; +import com.cpop.core.constant.Constants; import com.cpop.pay.framewok.core.request.ecpp.EcppBaseRequest; import com.cpop.pay.framewok.core.request.ecpp.EcppVerifyRequest; +import com.cpop.pay.framewok.core.response.ecpp.EcppBaseResponse; import com.cpop.pay.framewok.core.response.ecpp.EcppVerifyResponse; import com.google.common.base.Joiner; import lombok.Getter; import lombok.Setter; -import okhttp3.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; @@ -38,6 +44,7 @@ import java.util.List; @Getter @Configuration @EnableConfigurationProperties(EcppProperties.class) +@Slf4j public class EcppConfiguration { EcppProperties ecppProperties; @@ -60,24 +67,20 @@ public class EcppConfiguration { * @author DB * @since 2024/1/29 * @param url 路径 - * @param dto 请求数据 + * @param ecppRequest 请求数据 * @return Response */ - public Response sendEcppPost(String url, T ecppRequest) throws IOException { - OkHttpClient client = new OkHttpClient().newBuilder().build(); - MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8"); + public HttpResponse sendEcppPost(String url, T ecppRequest) throws IOException { EcppBaseRequest ecppBaseRequest = new EcppBaseRequest(ecppRequest); - RequestBody body = RequestBody.Companion.create(JSONObject.toJSONString(ecppBaseRequest), mediaType); + String jsonString = JSONObject.toJSONString(ecppBaseRequest); + log.info("数币请求参数sendEcppPost: {}", jsonString); String timestamp = String.valueOf(System.currentTimeMillis()); - Request request = new Request - .Builder() - .url(url) - .post(body) - .addHeader("Content-Type", "application/json") - //.addHeader("VERIFY",getVerify(timestamp)) - .addHeader("ecpp-header",getEcppHeader(timestamp)) - .build(); - return client.newCall(request).execute(); + String ecppHeader = getEcppHeader(timestamp); + return HttpRequest.post(url) + .body(jsonString) + .header("Content-Type", "application/json") + .header("ecpp-header", ecppHeader) + .execute(); } /** @@ -88,33 +91,33 @@ public class EcppConfiguration { * @param jsonBody 请求数据 * @return Response */ - public Response sendEcppPost(String url, String jsonBody) throws IOException { - OkHttpClient client = new OkHttpClient().newBuilder() - .sslSocketFactory(getSslSocketFactory(), getX509TrustManager()) - .hostnameVerifier(getHostnameVerifier()) - .build(); - MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8"); - RequestBody body = RequestBody.Companion.create(jsonBody, mediaType); + public HttpResponse sendEcppPost(String url, String jsonBody) throws IOException { + log.info("数币请求参数sendEcppPost: {}", jsonBody); String timestamp = String.valueOf(System.currentTimeMillis()); - Request request = new Request - .Builder() - .url(url) - .post(body) - .addHeader("Content-Type", "application/json") - .addHeader("VERIFY",getVerify(timestamp)) - .addHeader("ecpp-header",getEcppHeader(timestamp)) - .build(); - return client.newCall(request).execute(); + String ecppHeader = getEcppHeader(timestamp); + return HttpRequest.post(url) + .body(jsonBody) + .header("Content-Type", "application/json") + .header("ecpp-header", ecppHeader) + .setSSLSocketFactory(getSslSocketFactory()) + .execute(); } - public V parseEcppResponse(Response response, Class clazz) throws IOException { + public V parseEcppResponse(HttpResponse response, Class clazz) throws IOException { //读取响应体 - ResponseBody body = response.body(); - JSONObject result = JSONObject.parseObject(body.string()); + String body = response.body(); + JSONObject result = JSONObject.parseObject(body); if (result == null) { throw new IOException("Http响应为空"); } - return JSON.parseObject(result.getString("data"), clazz); + if (!StrUtil.equals(result.getString("code"), Constants.SUCCESS.toString())){ + throw new UtilException(result.getString("msg")); + } + try { + return JSON.parseObject(new EcppBaseResponse(result.getJSONObject("data")).getContent(), clazz); + } catch (Exception e) { + throw new RuntimeException(e); + } } /** @@ -234,7 +237,6 @@ public class EcppConfiguration { }; } - //获取HostnameVerifier private HostnameVerifier getHostnameVerifier() { return (s, sslSession) -> true; } diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java index 574badf..9238d66 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/config/wxPay/WxPayConfiguration.java @@ -1,13 +1,12 @@ package com.cpop.pay.framewok.config.wxPay; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl; import lombok.AllArgsConstructor; import lombok.Getter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -35,9 +34,9 @@ public class WxPayConfiguration { @Bean("normalWxPayService") public WxPayService normalWxPayService() { WxPayConfig payConfig = new WxPayConfig(); - payConfig.setAppId(StringUtils.trimToNull(properties.getBackstageAppId())); - payConfig.setMchId(StringUtils.trimToNull(properties.getBackstageMchId())); - payConfig.setMchKey(StringUtils.trimToNull(properties.getBackstageMchKey())); + payConfig.setAppId(StrUtil.trimToNull(properties.getBackstageAppId())); + payConfig.setMchId(StrUtil.trimToNull(properties.getBackstageMchId())); + payConfig.setMchKey(StrUtil.trimToNull(properties.getBackstageMchKey())); payConfig.setKeyPath(properties.getBackstageKeyPath()); payConfig.setNotifyUrl(properties.getBackstagePayNotifyUrl()); // 可以指定是否使用沙箱环境 @@ -56,11 +55,11 @@ public class WxPayConfiguration { @Bean("serviceWxPayService") public WxPayService serviceWxPayService() { WxPayConfig payConfig = new WxPayConfig(); - payConfig.setAppId(StringUtils.trimToNull(properties.getServiceAppId())); - payConfig.setMchId(StringUtils.trimToNull(properties.getServiceMchId())); + payConfig.setAppId(StrUtil.trimToNull(properties.getServiceAppId())); + payConfig.setMchId(StrUtil.trimToNull(properties.getServiceMchId())); payConfig.setPrivateKeyPath(properties.getServicePrivateKeyPath()); payConfig.setPrivateCertPath(properties.getServicePrivateCertPath()); - payConfig.setApiV3Key(StringUtils.trimToNull(properties.getServiceApiV3Key())); + payConfig.setApiV3Key(StrUtil.trimToNull(properties.getServiceApiV3Key())); payConfig.setServiceId(properties.getServiceId()); payConfig.setNotifyUrl(properties.getServicePayNotifyUrl()); // 可以指定是否使用沙箱环境 diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/dto/easyLearn/WxPayGoodsDetailDto.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/dto/easyLearn/WxPayGoodsDetailDto.java index faa772a..2d6056a 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/dto/easyLearn/WxPayGoodsDetailDto.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/dto/easyLearn/WxPayGoodsDetailDto.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.dto.easyLearn; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import java.io.Serializable; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppCustomerVerifyRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppCustomerVerifyRequest.java index 702c639..067f538 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppCustomerVerifyRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppCustomerVerifyRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppLogoutReturnCardRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppLogoutReturnCardRequest.java index b527a7d..a374648 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppLogoutReturnCardRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppLogoutReturnCardRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSigningQueryRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSigningQueryRequest.java index d5cdd07..36758e5 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSigningQueryRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSigningQueryRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSmsCodeRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSmsCodeRequest.java index fb493c5..c86570a 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSmsCodeRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppSmsCodeRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppTradeListRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppTradeListRequest.java index 53aecb5..dc0187f 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppTradeListRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppTradeListRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffConfirmRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffConfirmRequest.java index e667d29..b563adc 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffConfirmRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffConfirmRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffQueryRequest.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffQueryRequest.java index 24c4e13..24f8ce2 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffQueryRequest.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/request/ecpp/EcppWriteOffQueryRequest.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.request.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppBaseResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppBaseResponse.java new file mode 100644 index 0000000..8e7a2ae --- /dev/null +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppBaseResponse.java @@ -0,0 +1,71 @@ +package com.cpop.pay.framewok.core.response.ecpp; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.Mode; +import cn.hutool.crypto.Padding; +import cn.hutool.crypto.symmetric.DESede; +import com.alibaba.fastjson2.JSONObject; +import com.alibaba.fastjson2.annotation.JSONField; +import com.cpop.core.base.exception.ServiceException; +import com.cpop.core.utils.SpringUtils; +import com.cpop.pay.framewok.config.ecpp.EcppConfiguration; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * @author DB + * @version 1.0.0 + * @since 2024-01-29 15:42 + */ +@Data +@Slf4j +@NoArgsConstructor +public class EcppBaseResponse { + + public EcppBaseResponse(JSONObject data) { + this.jSessionId = data.getString("jSessionId"); + this.jSessionType = data.getString("jSessionType"); + this.type = data.getInteger("type"); + //解密content为JSON字符串 + if (StrUtil.isNotBlank(data.getString("content"))) { + EcppConfiguration ecppConfiguration = SpringUtils.getBean(EcppConfiguration.class); + this.content = decrypt(data.getString("content"), ecppConfiguration.getSessionKey(), ecppConfiguration.getSessionIv()); + } + } + + /** + * 交易类型 + */ + @JSONField(name = "jSessionType") + private String jSessionType; + + /** + * 交易id + */ + @JSONField(name = "jSessionId") + private String jSessionId; + + /** + * + */ + private Integer type; + + /** + * 内容 + */ + private String content; + + private String decrypt(String content, String key, String iv) { + if (StrUtil.isBlank(content)) { + return ""; + } + if (ObjectUtil.isEmpty(key)) { + throw new ServiceException("网络异常"); + } + DESede deSede = new DESede(Mode.CBC, Padding.PKCS5Padding, key.getBytes(), StrUtil.sub(iv, 0, 8).getBytes()); + return deSede.decryptStr(content); + } + +} diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppLogoutReturnCardResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppLogoutReturnCardResponse.java index bffcf86..93abbf8 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppLogoutReturnCardResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppLogoutReturnCardResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppServiceRecordResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppServiceRecordResponse.java index 5fcd640..2e30229 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppServiceRecordResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppServiceRecordResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; /** diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSigningQueryResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSigningQueryResponse.java index 9b2f22c..cde9c89 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSigningQueryResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSigningQueryResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSmsCodeResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSmsCodeResponse.java index a6b385c..4b6732f 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSmsCodeResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppSmsCodeResponse.java @@ -1,7 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; -import com.cpop.pay.framewok.core.request.ecpp.EcppVerifyRequest; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppTradeRecordResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppTradeRecordResponse.java index a0c182f..1ae488f 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppTradeRecordResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppTradeRecordResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; /** diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffConfirmResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffConfirmResponse.java index e1f41a0..1456d0d 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffConfirmResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffConfirmResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffQueryResponse.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffQueryResponse.java index 70db1a9..ab45fdb 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffQueryResponse.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/core/response/ecpp/EcppWriteOffQueryResponse.java @@ -1,6 +1,6 @@ package com.cpop.pay.framewok.core.response.ecpp; -import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson2.annotation.JSONField; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/handler/ecpp/EcppHandler.java b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/handler/ecpp/EcppHandler.java index 9f381c1..51fff71 100644 --- a/Cpop-Pay/src/main/java/com/cpop/pay/framewok/handler/ecpp/EcppHandler.java +++ b/Cpop-Pay/src/main/java/com/cpop/pay/framewok/handler/ecpp/EcppHandler.java @@ -1,7 +1,8 @@ package com.cpop.pay.framewok.handler.ecpp; -import com.alibaba.fastjson.JSONObject; -import com.cpop.core.utils.StringUtils; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson2.JSONObject; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.base.exception.UtilException; import com.cpop.pay.framewok.config.ecpp.EcppConfiguration; @@ -9,7 +10,6 @@ import com.cpop.pay.framewok.core.constant.EcppApiConstant; import com.cpop.pay.framewok.core.request.ecpp.*; import com.cpop.pay.framewok.core.response.ecpp.*; import lombok.extern.slf4j.Slf4j; -import okhttp3.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -41,19 +41,15 @@ public class EcppHandler { return; } log.info("======================= 获取速达会话密钥 ========================"); - Response response = null; + HttpResponse response = null; String s1 = UUID.randomUUID().toString().replaceAll("-", ""); try { Map data = new HashMap<>(); data.put("content", ecppConfiguration.encrypt(ecppConfiguration.getEcppProperties().getPublicKey(), s1)); response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.SECURITY_KEY, JSONObject.toJSONString(data)); - JSONObject result = JSONObject.parseObject(response.body().string()); + JSONObject result = JSONObject.parseObject(response.body()); String code = result.getString("code"); - if (StringUtils.equals(code, "402.2")) { - log.error("获取速达会话密钥header出错:" + result); - return; - } - if (StringUtils.equals(code, "200") && result.getJSONObject("data") != null) { + if (StrUtil.equals(code, "200") && result.getJSONObject("data") != null) { String resolve = ecppConfiguration.decrypt(ecppConfiguration.getEcppProperties().getPrivateKey(), result.getJSONObject("data").getString("content")); String[] argv = resolve.split(":"); String s2 = argv[0]; @@ -99,7 +95,7 @@ public class EcppHandler { * @param dto 请求 */ public EcppSmsCodeResponse sendEcppMsmCode(EcppSmsCodeRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.SEND_MSG, request); return ecppConfiguration.parseEcppResponse(response,EcppSmsCodeResponse.class); @@ -119,7 +115,7 @@ public class EcppHandler { * @return EcppServiceEntryResponse 响应 */ public EcppServiceEntryResponse serviceEntry(EcppServiceEntryRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.SERVICE_ENTRY, request); return ecppConfiguration.parseEcppResponse(response, EcppServiceEntryResponse.class); @@ -139,7 +135,7 @@ public class EcppHandler { * @return EcppServiceQueryResponse 响应 */ public EcppServiceQueryResponse serviceQuery(EcppServiceQueryRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.SERVICE_QUERY, request); return ecppConfiguration.parseEcppResponse(response, EcppServiceQueryResponse.class); @@ -159,7 +155,7 @@ public class EcppHandler { * @return EcppSigningQueryResponse 响应 */ public EcppSigningQueryResponse signingQuery(EcppSigningQueryRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.SIGNING_QUERY, request); return ecppConfiguration.parseEcppResponse(response, EcppSigningQueryResponse.class); @@ -179,7 +175,7 @@ public class EcppHandler { * @return EcppCustomerVerifyResponse 响应 */ public EcppCustomerVerifyResponse customerVerify(EcppCustomerVerifyRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.CUSTOMER_VERIFY, request); return ecppConfiguration.parseEcppResponse(response, EcppCustomerVerifyResponse.class); @@ -199,7 +195,7 @@ public class EcppHandler { * @return EcppWriteOffConfirmResponse 响应 */ public EcppWriteOffConfirmResponse writeOffConfirm(EcppWriteOffConfirmRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.WRITE_OFF_CONFIRM, request); return ecppConfiguration.parseEcppResponse(response, EcppWriteOffConfirmResponse.class); @@ -219,7 +215,7 @@ public class EcppHandler { * @return EcppWriteOffQueryResponse */ public EcppWriteOffQueryResponse writeOffQuery(EcppWriteOffQueryRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.WRITE_OFF_QUERY, request); return ecppConfiguration.parseEcppResponse(response, EcppWriteOffQueryResponse.class); @@ -239,7 +235,7 @@ public class EcppHandler { * @return EcppLogoutReturnCardResponse */ public EcppLogoutReturnCardResponse logoutReturnCard(EcppLogoutReturnCardRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.LOGOUT_RETURN_CARD, request); return ecppConfiguration.parseEcppResponse(response, EcppLogoutReturnCardResponse.class); @@ -259,7 +255,7 @@ public class EcppHandler { * @return EcppTradeListResponse */ public EcppTradeListResponse tradeList(EcppTradeListRequest request) { - Response response = null; + HttpResponse response = null; try { response = ecppConfiguration.sendEcppPost(ecppConfiguration.getEcppProperties().getBaseUrl() + EcppApiConstant.TRADE_LIST, request); return ecppConfiguration.parseEcppResponse(response, EcppTradeListResponse.class); diff --git a/Cpop-System/pom.xml b/Cpop-System/pom.xml index 58bc3bc..57e4096 100644 --- a/Cpop-System/pom.xml +++ b/Cpop-System/pom.xml @@ -5,7 +5,7 @@ com.cpop Cpop-Union - 1.1.1 + 1.1.2 ../pom.xml Cpop-System diff --git a/Cpop-System/src/main/java/com/cpop/system/business/controller/backstage/BackstageBrandController.java b/Cpop-System/src/main/java/com/cpop/system/business/controller/backstage/BackstageBrandController.java index b03beb9..06b5e14 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/controller/backstage/BackstageBrandController.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/controller/backstage/BackstageBrandController.java @@ -1,7 +1,7 @@ package com.cpop.system.business.controller.backstage; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.R; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.system.business.bo.BrandBo; import com.cpop.system.business.vo.BrandPageVo; import com.mybatisflex.core.paginate.Page; @@ -60,7 +60,7 @@ public class BackstageBrandController { @Operation(summary = "修改品牌") @PutMapping("/updateSysBrand") public R updateSysBrand(@RequestBody @Parameter(description = "品牌") @Validated BrandBo bo) { - Brand entity = BeanUtils.mapToClass(bo, Brand.class); + Brand entity = BeanUtil.toBean(bo, Brand.class); brandService.updateById(entity); return R.ok(); } diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/BrandServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/BrandServiceImpl.java index 9a3f997..4524427 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/BrandServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/BrandServiceImpl.java @@ -2,13 +2,13 @@ package com.cpop.system.business.service.impl; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.utils.SqlUtils; +import com.cpop.system.business.entity.Brand; +import com.cpop.system.business.mapper.BrandMapper; +import com.cpop.system.business.service.BrandService; import com.cpop.system.business.vo.BrandPageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.spring.service.impl.ServiceImpl; -import com.cpop.system.business.entity.Brand; -import com.cpop.system.business.mapper.BrandMapper; -import com.cpop.system.business.service.BrandService; import org.springframework.stereotype.Service; import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; @@ -32,7 +32,7 @@ public class BrandServiceImpl extends ServiceImpl implements @Override public Page getBrandPage(String brandName) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(), QueryWrapper.create() + return this.mapper.paginateAs(pageDomain.getPage(), pageDomain.getPageSize(), QueryWrapper.create() .select(BRAND.ID, BRAND.BRAND_NAME, BRAND.WX_MCH_ID, BRAND.CREATE_TIME, BRAND.WX_MCH_ID, BRAND.BRAND_ADDR, BRAND.LICENSE_STATS, BRAND.LICENSE_PIC_URL, BRAND.LICENSE_CREDIT_CODE, BRAND.LICENSE_FIRM_NAME, BRAND.LICENSE_USERNAME, BRAND.LICENSE_ADDR, BRAND.LICENSE_DATE) .and(BRAND.BRAND_NAME.likeLeft(brandName)) diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreServiceImpl.java index ddbc0ce..bbe03f6 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreServiceImpl.java @@ -1,32 +1,19 @@ package com.cpop.system.business.service.impl; -import com.alibaba.fastjson.JSONObject; -import com.cpop.api.cloudDb.core.dto.CloudStoreDto; -import com.cpop.api.cloudDb.handler.CloudStoreHandler; -import com.cpop.api.tencent.location.handler.TencentLocationHandler; +import cn.hutool.core.bean.BeanUtil; import com.cpop.core.base.entity.PageDomain; -import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.bean.BeanUtils; import com.cpop.system.business.bo.StoreBo; -import com.cpop.system.business.entity.Brand; import com.cpop.system.business.entity.Store; import com.cpop.system.business.mapper.StoreMapper; -import com.cpop.system.business.service.BrandService; import com.cpop.system.business.service.StoreService; import com.cpop.system.business.vo.StorePageVo; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.core.row.Db; -import com.mybatisflex.core.row.DbChain; -import com.mybatisflex.core.row.Row; -import com.mybatisflex.core.row.RowKey; import com.mybatisflex.spring.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDateTime; - import static com.cpop.system.business.entity.table.BrandTableDef.BRAND; import static com.cpop.system.business.entity.table.StoreSignTableDef.STORE_SIGN; import static com.cpop.system.business.entity.table.StoreTableDef.STORE; @@ -50,7 +37,7 @@ public class StoreServiceImpl extends ServiceImpl implements @Override public Page getStorePage(String name) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); - return this.getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()), QueryWrapper.create() + return this.getMapper().paginateAs(Page.of(pageDomain.getPage(), pageDomain.getPageSize()), QueryWrapper.create() .select(STORE.ID, STORE.STORE_NAME, STORE.CREATE_TIME, STORE.STORE_ADDR, STORE.PERSON_CHARGE_NAME.as(StorePageVo::getPersonCharge), STORE.PERSON_CHARGE_PHONE.as(StorePageVo::getPhone), STORE.WX_MCH_ID) .select(STORE_SIGN.EXPIRE_DATE) @@ -72,7 +59,7 @@ public class StoreServiceImpl extends ServiceImpl implements @Override @Transactional(rollbackFor = Exception.class) public void updateStore(StoreBo bo) { - Store store = BeanUtils.mapToClass(bo, Store.class); + Store store = BeanUtil.toBean(bo, Store.class); this.updateById(store); } } diff --git a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java index 49e2a43..3cb6057 100644 --- a/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java +++ b/Cpop-System/src/main/java/com/cpop/system/business/service/impl/StoreSignServiceImpl.java @@ -1,9 +1,9 @@ package com.cpop.system.business.service.impl; +import cn.hutool.core.util.StrUtil; import com.cpop.core.base.entity.PageDomain; import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SqlUtils; -import com.cpop.core.utils.StringUtils; import com.cpop.system.business.bo.StoreRunOffBo; import com.cpop.system.business.bo.StoreSignRenewPageBo; import com.cpop.system.business.bo.StoreSignRenewXmlBo; @@ -45,10 +45,10 @@ public class StoreSignServiceImpl extends ServiceImpl getStoreSignRenewPage(StoreSignRenewPageBo bo) { PageDomain pageDomain = SqlUtils.getInstance().getPageDomain(); QueryWrapper queryWrapper = QueryWrapper.create(); - if (StringUtils.isNotBlank(bo.getAddrOrName())){ + if (StrUtil.isNotBlank(bo.getAddrOrName())){ queryWrapper.and(STORE.LICENSE_ADDR.like(bo.getAddrOrName()).or(STORE.LICENSE_FIRM_NAME.like(bo.getAddrOrName()))); } - if (StringUtils.isNotBlank(bo.getBrandOrStore())){ + if (StrUtil.isNotBlank(bo.getBrandOrStore())){ queryWrapper.and(BRAND.BRAND_NAME.like(bo.getBrandOrStore()).or(STORE.STORE_NAME.like(bo.getBrandOrStore()))); } switch (bo.getRenewStatus()){ @@ -61,7 +61,7 @@ public class StoreSignServiceImpl extends ServiceImpl com.cpop Cpop-Union - 1.1.1 + 1.1.2 Cpop-Union 深圳普普数字产业有限公司内部开发框架 pom @@ -28,19 +28,19 @@ 17 - 1.1.1 - 1.8.7 - 1.10.0 + 1.1.2 + 1.8.9 2.0.46 - 2.13.0 3.3.2 - 1.37.0 - 4.4.0 + 1.38.0 + 4.5.0 3.1.970 5.6.155 4.6.0 - 1.0.0 - 2.0.8.1 + 2.0.9.2 + 1.0.0-beta.3 + 5.8.27 + 33.2.0-jre @@ -61,32 +61,17 @@ Cpop-Oam ${cpop.version} - - com.cpop - Cpop-Jambox - ${cpop.version} - com.cpop Cpop-ClockIn-Demo ${cpop.version} - - com.cpop - Cpop-Mall - ${cpop.version} - com.cpop Cpop-System ${cpop.version} - - com.cpop - Cpop-Mini - ${cpop.version} - com.cpop Cpop-Pay @@ -139,24 +124,12 @@ mongo-plus-boot-starter ${mongo-plus.version} - - - org.apache.commons - commons-text - ${common-text.version} - com.alibaba.fastjson2 fastjson2 ${fastjson.version} - - - commons-io - commons-io - ${commons-IO.version} - com.alibaba @@ -198,6 +171,24 @@ weixin-java-cp ${wxJava.version} + + + com.azure + azure-ai-openai + ${azure-ai-openai.version} + + + + cn.hutool + hutool-all + ${hutool.version} + + + + com.google.guava + guava + ${guava.version} +