Browse Source

升级到jdk21

qmj 3 weeks ago
parent
commit
eb486d27d0
100 changed files with 1363 additions and 1171 deletions
  1. 5 212
      .gitignore
  2. 49 11
      pom.xml
  3. 30 7
      ruoyi-admin/pom.xml
  4. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  5. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/OperatingHoursController.java
  6. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosCollectController.java
  7. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosFenleiController.java
  8. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosFoodController.java
  9. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosStoreController.java
  10. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosTypeController.java
  11. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ServiceTypeController.java
  12. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShPosReviewController.java
  13. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShQuanyiController.java
  14. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShSalesPromotionController.java
  15. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShindexController.java
  16. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/order/DistanceMultiplierController.java
  17. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/order/InfoAddressController.java
  18. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/order/MyTestController.java
  19. 6 5
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java
  20. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosFreightController.java
  21. 155 79
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderController.java
  22. 29 27
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderRatingController.java
  23. 16 16
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosReviewController.java
  24. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/order/TaxiOrderController.java
  25. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/order/TaxiPricesController.java
  26. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/order/TestTask.java
  27. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/BankCardController.java
  28. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/IpnLogController.java
  29. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/PayController.java
  30. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java
  31. 0 401
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java~
  32. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/pay/ZaloPayController.java
  33. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/promotion/SalesPromotionController.java
  34. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/promotion/SocialFeedbackController.java
  35. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/qiyefuwu/SysQiyejieshaoController.java
  36. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/report/StatisticsController.java
  37. 506 124
      ruoyi-admin/src/main/java/com/ruoyi/app/service/WalletService.java
  38. 145 15
      ruoyi-admin/src/main/java/com/ruoyi/app/user/InfoUserController.java
  39. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/user/PosMarginController.java
  40. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/RiderPositionController.java
  41. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/SysFeedbackController.java
  42. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/SysHelpController.java
  43. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/UserFootprintController.java
  44. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/UserMarginController.java
  45. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/user/UserPointController.java
  46. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/user/VideoCallController.java
  47. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/AppVersionController.java
  48. 13 0
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/ConstantUtil.java
  49. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/GetVipqy.java
  50. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/IpUtils.java
  51. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/PayPush.java
  52. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/VNPay.java
  53. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipMembershipController.java
  54. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipQuanyiController.java
  55. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipSjQuanyiController.java
  56. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipUserController.java
  57. 4 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
  58. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  59. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  60. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  61. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/AppDownloadController.java
  62. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NightMarketController.java
  63. 9 9
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PointTransactionController.java
  64. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PushMessageController.java
  65. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysAdsController.java
  66. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  67. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  68. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  69. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPointControlController.java
  70. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPointTierController.java
  71. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  72. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  73. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  74. 28 25
      ruoyi-admin/src/main/resources/application.yml
  75. 75 10
      ruoyi-common/pom.xml
  76. 21 2
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  77. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  78. 6 6
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  79. 4 4
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
  80. 5 5
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
  81. 6 6
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
  82. 4 4
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
  83. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  84. 36 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUserDto.java
  85. 13 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
  86. 8 8
      ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
  87. 6 6
      ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
  88. 10 10
      ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
  89. 7 7
      ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
  90. 9 9
      ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
  91. 4 4
      ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java
  92. 11 11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
  93. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
  94. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
  95. 11 11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
  96. 35 35
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
  97. 3 3
      ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java
  98. 4 4
      ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java
  99. 6 7
      ruoyi-framework/pom.xml
  100. 2 2
      ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java

+ 5 - 212
.gitignore

@@ -1,219 +1,12 @@
-
+# IntelliJ IDEA
 .idea/vcs.xml
 .idea/misc.xml
 .idea/jpa-buddy.xml
 .idea/jarRepositories.xml
 .idea/encodings.xml
 .idea/compiler.xml
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
+.idea/editorJumperProjectSettings.xml
+
+# Maven / Spring Boot
+target/
 *.class
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosOrder.class
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosAppeal.class
-ruoyi-system/target/classes/mapper/system/PosAppealMapper.xml
-ruoyi-system/target/classes/mapper/system/PosFeedbackMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosAppeal.class
-ruoyi-system/target/classes/mapper/system/PosAppealMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosAppeal.class
-ruoyi-system/target/classes/mapper/system/PosAppealMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/application.yml
-ruoyi-admin/target/classes/com/ruoyi/app/mendian/PosCollectController.class
-ruoyi-admin/target/classes/com/ruoyi/app/mendian/PosFenleiController.class
-ruoyi-admin/target/classes/com/ruoyi/app/mendian/PosFoodController.class
-ruoyi-admin/target/classes/com/ruoyi/app/mendian/PosStoreController.class
-ruoyi-admin/target/classes/com/ruoyi/app/mendian/PosTypeController.class
-ruoyi-admin/target/classes/com/ruoyi/app/order/PosOrderController.class
-ruoyi-admin/target/classes/com/ruoyi/app/order/TestTask.class
-ruoyi-admin/target/classes/com/ruoyi/app/pay/UserBillingController.class
-ruoyi-admin/target/classes/com/ruoyi/app/user/InfoUserController.class
-ruoyi-admin/target/classes/com/ruoyi/app/utils/SysFileInfoController.class
-ruoyi-admin/target/classes/com/ruoyi/web/controller/common/CommonController.class
-ruoyi-admin/target/classes/com/ruoyi/web/controller/system/SysLoginController.class
-ruoyi-admin/target/classes/i18n/messages.properties
-ruoyi-admin/target/classes/i18n/messages_en_US.properties
-ruoyi-admin/target/classes/i18n/messages_vi.properties
-ruoyi-admin/target/classes/i18n/messages_zh_CN.properties
-ruoyi-admin/target/classes/i18n/messages_zh_TW.properties
-ruoyi-admin/target/maven-archiver/pom.properties
-ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-admin/target/ruoyi-admin.jar
-ruoyi-admin/target/ruoyi-admin.jar.original
-ruoyi-common/target/classes/com/ruoyi/common/utils/file/FileUploadUtils.class
-ruoyi-common/target/maven-archiver/pom.properties
-ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-common/target/ruoyi-common-3.8.5.jar
-ruoyi-framework/target/classes/com/ruoyi/framework/config/SecurityConfig.class
-ruoyi-framework/target/maven-archiver/pom.properties
-ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-framework/target/ruoyi-framework-3.8.5.jar
-ruoyi-generator/target/maven-archiver/pom.properties
-ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-generator/target/ruoyi-generator-3.8.5.jar
-ruoyi-quartz/target/maven-archiver/pom.properties
-ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-quartz/target/ruoyi-quartz-3.8.5.jar
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosFenlei.class
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosFood.class
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosStore.class
-ruoyi-system/target/classes/com/ruoyi/system/domain/PosType.class
-ruoyi-system/target/classes/com/ruoyi/system/mapper/PosOrderMapper.class
-ruoyi-system/target/classes/com/ruoyi/system/mapper/PosStoreMapper.class
-ruoyi-system/target/classes/com/ruoyi/system/mapper/UserBillingMapper.class
-ruoyi-system/target/classes/com/ruoyi/system/service/impl/PosStoreServiceImpl.class
-ruoyi-system/target/classes/com/ruoyi/system/utils/GetArea.class
-ruoyi-system/target/classes/mapper/chanting/PosFoodMapper.xml
-ruoyi-system/target/classes/mapper/chanting/PosStoreMapper.xml
-ruoyi-system/target/classes/mapper/fenlei/PosTypeMapper.xml
-ruoyi-system/target/classes/mapper/system/PosFenleiMapper.xml
-ruoyi-system/target/classes/mapper/system/PosOrderMapper.xml
-ruoyi-system/target/maven-archiver/pom.properties
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
-ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
-ruoyi-system/target/ruoyi-system-3.8.5.jar
-ruoyi-admin/target/classes/application.yml

+ 49 - 11
pom.xml

@@ -2,8 +2,8 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	
+    <modelVersion>4.0.0</modelVersion>
+
     <groupId>com.ruoyi</groupId>
     <artifactId>ruoyi</artifactId>
     <version>3.8.5</version>
@@ -11,18 +11,21 @@
     <name>ruoyi</name>
     <url>http://www.ruoyi.vip</url>
     <description>若依管理系统</description>
-    
+
     <properties>
         <ruoyi.version>3.8.5</ruoyi.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <java.version>1.8</java.version>
+        <java.version>21</java.version>
+        <maven.compiler.source>21</maven.compiler.source>
+        <maven.compiler.target>21</maven.compiler.target>
+        <maven.compiler.release>21</maven.compiler.release>
         <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
         <druid.version>1.2.16</druid.version>
         <bitwalker.version>1.21</bitwalker.version>
         <swagger.version>3.0.0</swagger.version>
         <kaptcha.version>2.3.3</kaptcha.version>
-        <pagehelper.boot.version>1.4.6</pagehelper.boot.version>
+        <pagehelper.boot.version>2.1.0</pagehelper.boot.version>
         <fastjson.version>2.0.25</fastjson.version>
         <oshi.version>6.4.0</oshi.version>
         <commons.io.version>2.11.0</commons.io.version>
@@ -30,8 +33,15 @@
         <poi.version>4.1.2</poi.version>
         <velocity.version>2.3</velocity.version>
         <jwt.version>0.9.1</jwt.version>
+
+        <!-- 新增节点 -->
+        <mybatis-spring-boot.version>3.0.3</mybatis-spring-boot.version>
+        <mysql.version>8.2.0</mysql.version>
+        <jaxb-api.version>2.3.1</jaxb-api.version>
+        <jakarta.version>6.0.0</jakarta.version>
+        <springdoc.version>2.5.0</springdoc.version>
     </properties>
-	
+
     <!-- 依赖声明 -->
     <dependencyManagement>
         <dependencies>
@@ -40,7 +50,7 @@
             <dependency>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>
-                <version>2.5.14</version>
+                <version>3.3.5</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -60,6 +70,8 @@
             </dependency>
 
             <!-- pagehelper 分页插件 -->
+            <!-- PageHelper 6.1.0 (pagehelper-spring-boot-starter 2.1.0) 支持 Spring Boot 3 -->
+            <!-- PageHelper 6.1.0 默认使用 jsqlparser 4.7,与 MyBatis-Plus 统一使用 4.7 -->
             <dependency>
                 <groupId>com.github.pagehelper</groupId>
                 <artifactId>pagehelper-spring-boot-starter</artifactId>
@@ -170,6 +182,30 @@
                 <version>${ruoyi.version}</version>
             </dependency>
 
+            <!-- 新增四个配置依赖 -->
+            <dependency>
+                <groupId>org.mybatis.spring.boot</groupId>
+                <artifactId>mybatis-spring-boot-starter</artifactId>
+                <version>${mybatis-spring-boot.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.mysql</groupId>
+                <artifactId>mysql-connector-j</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>javax.xml.bind</groupId>
+                <artifactId>jaxb-api</artifactId>
+                <version>${jaxb-api.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>jakarta.servlet</groupId>
+                <artifactId>jakarta.servlet-api</artifactId>
+                <version>${jakarta.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -188,11 +224,13 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.12.0</version>
                 <configuration>
-                    <source>${java.version}</source>
-                    <target>${java.version}</target>
+                    <release>21</release>
                     <encoding>${project.build.sourceEncoding}</encoding>
+                    <parameters>true</parameters>
+                    <!-- 如果 Maven 使用的 JDK 不是 17,可以显式指定 javac 路径 -->
+                    <!-- <executable>D:\Java\jdk-17.0.2\bin\javac.exe</executable> -->
                 </configuration>
             </plugin>
         </plugins>
@@ -223,4 +261,4 @@
         </pluginRepository>
     </pluginRepositories>
 
-</project>
+</project>

+ 30 - 7
ruoyi-admin/pom.xml

@@ -52,11 +52,10 @@
             <version>1.6.2</version>
         </dependency>
 
-         <!-- Mysql驱动包 -->
+        <!-- Mysql驱动包 -->
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.22</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
         </dependency>
 
         <!-- 核心模块-->
@@ -91,6 +90,30 @@
             <artifactId>httpclient</artifactId>
             <version>4.5.14</version>
         </dependency>
+        <dependency>
+            <groupId>com.google.firebase</groupId>
+            <artifactId>firebase-admin</artifactId>
+            <version>9.7.0</version>
+        </dependency>
+        <!-- Apache HttpClient 5 (Firebase Admin SDK 9.7.0 所需依赖) -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+        <!-- Apache HttpCore 5 (HttpClient 5 的核心依赖,包含 reactor) -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.core5</groupId>
+            <artifactId>httpcore5</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+        <!-- Apache HttpCore 5 HTTP/2 支持 -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.core5</groupId>
+            <artifactId>httpcore5-h2</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+
     </dependencies>
 
     <build>
@@ -98,9 +121,9 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>2.1.1.RELEASE</version>
+                <version>3.3.5</version>
                 <configuration>
-                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
+                    <addResources>true</addResources>
                 </configuration>
                 <executions>
                     <execution>
@@ -118,7 +141,7 @@
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <warName>${project.artifactId}</warName>
                 </configuration>
-           </plugin>
+            </plugin>
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -13,7 +13,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
-@MapperScan("com.ruoyi.*.mapper")
+@MapperScan("com.ruoyi.**.mapper")
 @EnableAsync
 @EnableRetry
 public class RuoYiApplication

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/OperatingHoursController.java

@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import java.util.HashMap;
 import java.util.List;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosCollectController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.mendian;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.utils.MessageUtils;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosFenleiController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.mendian;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -26,7 +26,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * spfenleiController
- * 
+ *
  * @author ruoyi
  * @date 2023-05-21
  */

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosFoodController.java

@@ -29,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosStoreController.java

@@ -28,7 +28,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/PosTypeController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.mendian;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.annotation.Anonymous;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ServiceTypeController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.mendian;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.security.access.prepost.PreAuthorize;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShPosReviewController.java

@@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.stream.Collectors;
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShQuanyiController.java

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShSalesPromotionController.java

@@ -27,7 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.List;
 
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/mendian/ShindexController.java

@@ -21,7 +21,7 @@ import com.ruoyi.system.utils.JwtUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.text.SimpleDateFormat;
 import java.util.List;
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/order/DistanceMultiplierController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.order;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +24,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * DistanceMultiplierController
- * 
+ *
  * @author ruoyi
  * @date 2024-08-23
  */

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/order/InfoAddressController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.order;
 
 import java.math.BigDecimal;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -26,7 +26,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * addressController
- * 
+ *
  * @author ruoyi
  * @date 2023-05-24
  */

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/order/MyTestController.java

@@ -36,7 +36,7 @@ public class MyTestController {
             // 加锁
             boolean islock = lock.tryLock(3, 10, TimeUnit.SECONDS);
             if(islock){
-                userWalletService.updateUserWalletWithLock(userWallet.getId(),userWallet.getVersion(),null,balance);
+//                userWalletService.updateUserWalletWithLock(userWallet.getId(),userWallet.getVersion(),null,balance);
                 // 业务逻辑
                 return AjaxResult.success("成功");
             }else {

+ 6 - 5
ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.PointsTransaction;
 import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.system.utils.Auth;
@@ -35,11 +36,11 @@ public class PointController extends BaseController {
                                 @RequestParam Long size) {
         JwtUtil jwtUtil = new JwtUtil();
         Long id = Long.valueOf(jwtUtil.getusid(token));
-        IPage<WalletTransaction> pg=new Page<>(page,size);
-        LambdaQueryWrapper<WalletTransaction> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(WalletTransaction::getUserId, id);
-       queryWrapper.orderByDesc(WalletTransaction::getCreateTime);
-        IPage<WalletTransaction> data = pointsTransactionService.page(pg, queryWrapper);
+        IPage<PointsTransaction> pg=new Page<>(page,size);
+        LambdaQueryWrapper<PointsTransaction> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(PointsTransaction::getUserId, id);
+       queryWrapper.orderByDesc(PointsTransaction::getCreateTime);
+        IPage<PointsTransaction> data = pointsTransactionService.page(pg, queryWrapper);
         return success(data);
     }
 }

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosFreightController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.order;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +24,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * freightController
- * 
+ *
  * @author ruoyi
  * @date 2023-07-15
  */

+ 155 - 79
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.app.order;
 
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -15,6 +16,7 @@ import com.ruoyi.app.order.dto.OrderPushBodyDto;
 import com.ruoyi.app.order.dto.PositionDto;
 import com.ruoyi.app.order.dto.QsDto;
 import com.ruoyi.app.pay.PayController;
+import com.ruoyi.app.service.WalletService;
 import com.ruoyi.app.utils.DateUtil;
 import com.ruoyi.app.utils.PayPush;
 import com.ruoyi.app.utils.event.PushEventService;
@@ -23,9 +25,11 @@ import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.MessageUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
@@ -46,7 +50,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
@@ -110,6 +114,8 @@ public class PosOrderController extends BaseController {
     private IFoodStatisticsService foodStatisticsService;
     @Autowired
     private IOrderParentService orderParentService;
+    @Autowired
+    private WalletService walletService;
 
 
     //查询用户足迹
@@ -180,7 +186,7 @@ public class PosOrderController extends BaseController {
                 }
                 //作废退回积分
                 if (posOrder.getState() == 10 && order.getPoints() != null && order.getPoints() > 0) {
-                    returnPoints(order.getUserId(), order.getDdId(), Long.valueOf(order.getPoints()));
+                    returnPoints(order.getUserId(), Long.valueOf(order.getDdId()), Long.valueOf(order.getPoints()));
                 }
                 if (org) {
                     return success(MessageUtils.message("no.modify.success"), posOrder.getId());
@@ -326,7 +332,7 @@ public class PosOrderController extends BaseController {
         boolean org = posOrderService.saveOrUpdate(posOrder);
         PosOrder order = posOrderService.getById(posOrder.getId());
         if (order.getPoints() != null && order.getPoints() > 0) {
-            returnPoints(order.getUserId(), order.getDdId(), Long.valueOf(order.getPoints()));
+            returnPoints(order.getUserId(), Long.valueOf(order.getDdId()), Long.valueOf(order.getPoints()));
         }
         if (org) {
             QueryWrapper<UserBilling> wrapper = new QueryWrapper<>();
@@ -415,82 +421,133 @@ public class PosOrderController extends BaseController {
 
     //执行商户分成
     public void setSanghuBilling(@NotNull PosOrder posOrder) {
-        UserBilling billing = new UserBilling();
-        DecimalFormat df = new DecimalFormat("#.00");
-        InfoUser user = infoUserService.getById(posOrder.getShId());
-        Double fcbili = user.getCommission() == null ? 0.00 : user.getCommission();
-        JSONArray list = JSONArray.parseArray(posOrder.getFood());
-        int fenc = 0;
-        for (int i = 0; i < list.size(); i++) {
-            JSONObject foods = list.getJSONObject(i);
-            //20250612修改,商品金额等于价格乘以数量;未修改前金额直接为商品价格
-            int price = foods.getInteger("price");
-            int otherPrice = foods.getInteger("otherPrice"); //规格价格
-            int num = foods.getInteger("number");
-            int age = (price + otherPrice) * num; //价格=商品价格+规格价格
-            fenc += age;
-        }
-//        Double fenc = posOrder.getAmount()-posOrder.getFreight();
-
-        //商家分成总金额,减去商家优惠金额,减去商家活动金额(type=2 为平台指定商家优惠券,由平台承担)
-        if (posOrder.getMdYhId() != null && posOrder.getMdDiscountAmount() != null) {
-            VipUserQuanyi userQuanyi = userQuanyiService.getById(posOrder.getMdYhId());
-            if (userQuanyi != null && "1".equals(userQuanyi.getType())) {
-                fenc = fenc - posOrder.getMdDiscountAmount();
+        long count = userBillingService.count(new LambdaQueryWrapper<UserBilling>().eq(UserBilling::getUserId, posOrder.getShId()).eq(UserBilling::getType, "0").eq(UserBilling::getDdId, posOrder.getDdId()));
+        if (count <= 0) {
+            UserBilling billing = new UserBilling();
+            DecimalFormat df = new DecimalFormat("#.00");
+            InfoUser user = infoUserService.getById(posOrder.getShId());
+            Double fcbili = user.getCommission() == null ? 0.00 : user.getCommission();
+            fcbili=getShCommissionRate(fcbili,user.getUserId());
+            JSONArray list = JSONArray.parseArray(posOrder.getFood());
+            int fenc = 0;
+            for (int i = 0; i < list.size(); i++) {
+                JSONObject foods = list.getJSONObject(i);
+                //20250612修改,商品金额等于价格乘以数量;未修改前金额直接为商品价格
+                int price = foods.getInteger("price");
+                int otherPrice = foods.getInteger("otherPrice"); //规格价格
+                int num = foods.getInteger("number");
+                int age = (price + otherPrice) * num; //价格=商品价格+规格价格
+                fenc += age;
             }
+            String remark = "";
+            //商家分成总金额,减去商家优惠金额,减去商家活动金额(type=1 为平台指定商家优惠券,由平台承担)
+            if (posOrder.getMdYhId() != null && posOrder.getMdDiscountAmount() != null) {
+                VipUserQuanyi userQuanyi = userQuanyiService.getById(posOrder.getMdYhId());
+                if (userQuanyi != null && "1".equals(userQuanyi.getType())) {
+                    fenc = fenc - posOrder.getMdDiscountAmount();
+                    String yhmcMessage = MessageUtils.message("no.posorder.md.yh.mc.messag");
+                    yhmcMessage = StrUtil.format(yhmcMessage, posOrder.getMdYhName());
+                    remark += yhmcMessage;
+                    String yhAmount = MessageUtils.message("no.posorder.md.yh.jiner.messag");
+                    yhAmount = StrUtil.format(yhAmount, posOrder.getMdDiscountAmount());
+                    remark += yhAmount;
+                }
 
-        }
-        if (posOrder.getMdActivity() != null && posOrder.getMdSalesReduction() != null) {
-            fenc = fenc - posOrder.getMdSalesReduction();
-        }
-
-        Double chouc = fenc * fcbili;
-        Double shfc = fenc - chouc;
-        billing.setUserId(posOrder.getShId());
-        billing.setDdId(String.valueOf(posOrder.getDdId()));
-        billing.setType("0");
-        billing.setAmount(Double.valueOf(df.format(shfc)));
-        billing.setDivvy(Double.valueOf(df.format(chouc)));
-        billing.setState("0");
-        billing.setMdId(posOrder.getMdId());
-        int reg = userBillingService.insertUserBilling(billing);
-        if (reg == 1) {
-            System.out.println("商户分成成功,订单号:" + posOrder.getDdId() + ",分成金额:" + shfc + ",抽成:" + chouc);
-
-        } else {
-            System.out.println("订单:" + posOrder.getDdId() + "分成失败");
-        }
-    }
-
-    //执行骑手分成
-    public void setQishouBilling(@NotNull PosOrder posOrder) {
-        UserBilling billing = new UserBilling();
-        DecimalFormat df = new DecimalFormat("#.00");
-        InfoUser user = infoUserService.getById(posOrder.getQsId());
-        if (user == null) {
-            System.out.println("订单无骑手");
-        } else {
-            Double fcbili = user.getCommission() == null ? 0.00 : user.getCommission();
-            Double fenc = posOrder.getFreight();
+            }
+            if (posOrder.getMdSalesName() != null && posOrder.getMdSalesReduction() != null) {
+                fenc = fenc - posOrder.getMdSalesReduction();
+                String cxNameMessage = MessageUtils.message("no.posorder.md.cx.mc.messag");
+                cxNameMessage = StrUtil.format(cxNameMessage, posOrder.getMdSalesName());
+                remark += cxNameMessage;
+                String cxAmount = MessageUtils.message("no.posorder.md.cx.jiner.messag");
+                cxAmount = StrUtil.format(cxAmount, posOrder.getMdSalesReduction());
+                remark += cxAmount;
+            }
+            billing.setIllustrate(remark);
             Double chouc = fenc * fcbili;
             Double shfc = fenc - chouc;
-            billing.setUserId(posOrder.getQsId());
+            billing.setUserId(posOrder.getShId());
             billing.setDdId(String.valueOf(posOrder.getDdId()));
             billing.setType("0");
             billing.setAmount(Double.valueOf(df.format(shfc)));
             billing.setDivvy(Double.valueOf(df.format(chouc)));
             billing.setState("0");
             billing.setMdId(posOrder.getMdId());
-            int reg = userBillingService.insertUserBilling(billing);
-            if (reg == 1) {
-                System.out.println("骑手分成成功,订单号:" + posOrder.getDdId() + ",分成金额:" + shfc + ",抽成:" + chouc);
+            billing.setUserType("1");
+            billing.setDivvyRate(fcbili);
+            walletService.addBalance(billing.getUserId(), BigDecimal.valueOf(billing.getAmount()), billing);
+//            int reg = userBillingService.insertUserBilling(billing);
+//            if (reg == 1) {
+//
+//                System.out.println("商户分成成功,订单号:" + posOrder.getDdId() + ",分成金额:" + shfc + ",抽成:" + chouc);
+//
+//            } else {
+//                System.out.println("订单:" + posOrder.getDdId() + "分成失败");
+//            }
+        }
+    }
+
+    /**
+     * 获取商家分成比例
+     * 委托给 Service 层处理
+     *
+     * @param rate 默认分成比例
+     * @param shUserId 商家用户ID
+     * @return 分成比例
+     */
+    public Double getShCommissionRate(Double rate, Long shUserId){
+        return rate;
+        // 委托给 Service 层处理
+//        return commissionRatesService.getShCommissionRate(rate, shUserId);
+    }
+
+    //执行骑手分成
+    public void setQishouBilling(@NotNull PosOrder posOrder) {
+        long count = userBillingService.count(new LambdaQueryWrapper<UserBilling>().eq(UserBilling::getUserId, posOrder.getQsId()).eq(UserBilling::getType, "0").eq(UserBilling::getDdId, posOrder.getDdId()));
+        if (count <= 0) {
+            UserBilling billing = new UserBilling();
+            DecimalFormat df = new DecimalFormat("#.00");
+            InfoUser user = infoUserService.getById(posOrder.getQsId());
+            if (user == null) {
+                System.out.println("订单无骑手");
             } else {
-                System.out.println("订单:" + posOrder.getDdId() + "分成失败");
+                Double fcbili = user.getCommission() == null ? 0.00 : user.getCommission();
+                Double fenc = posOrder.getFreight();
+                Double chouc = fenc * fcbili;
+                Double shfc = fenc - chouc;
+                List<SysDictData> taxBl = DictUtils.getDictCache("sys_qs_freight_bl");
+                if (taxBl != null && taxBl.get(0) != null) {
+                    Double tax = shfc * Double.parseDouble(taxBl.get(0).getDictValue());
+                    billing.setTax(BigDecimal.valueOf(tax));
+                    billing.setTaxRate(taxBl.get(0).getDictValue());
+                    shfc = shfc - tax;
+                }
+                billing.setUserId(posOrder.getQsId());
+                billing.setDdId(String.valueOf(posOrder.getDdId()));
+                billing.setType("0");
+                billing.setAmount(Double.valueOf(df.format(shfc)));
+                billing.setDivvy(Double.valueOf(df.format(chouc)));
+                billing.setState("0");
+                billing.setMdId(posOrder.getMdId());
+                billing.setUserType("2");
+                billing.setDivvyRate(user.getCommission());
+                //货到付款设置代收金额
+                if ("1".equals(posOrder.getCollectPayment())) {
+                    billing.setBehalfAmount(Double.valueOf(posOrder.getAmount()));
+                }
+                walletService.addBalance(billing.getUserId(), BigDecimal.valueOf(billing.getAmount()), billing);
+//                int reg = userBillingService.insertUserBilling(billing);
+//                if (reg == 1) {
+//                    System.out.println("骑手分成成功,订单号:" + posOrder.getDdId() + ",分成金额:" + shfc + ",抽成:" + chouc);
+//                } else {
+//                    System.out.println("订单:" + posOrder.getDdId() + "分成失败");
+//                }
             }
         }
 
     }
 
+
     //后台查询详情
     @GetMapping("/getorderhout")
     public AjaxResult getorderhout(@RequestParam String id) {
@@ -614,7 +671,7 @@ public class PosOrderController extends BaseController {
         org.put("pointsReduction", orlist.getPointsReduction());
         org.put("sdTime", orlist.getSdTime());
         org.put("payType", orlist.getPayType());
-        int count = posOrderRatingService.getBaseMapper().selectCount(new QueryWrapper<PosOrderRating>().eq("dd_id", ddid));
+        Long count = posOrderRatingService.getBaseMapper().selectCount(new QueryWrapper<PosOrderRating>().eq("dd_id", ddid));
         //是否已经评论
         org.put("isCommented", count > 0);
         return success(org);
@@ -1263,7 +1320,6 @@ List<String > parentDdIds = orlist.stream().map(PosOrder::getParentDdId).collect
         payController.sendAcceptRiderPush(order, push, riderPositionMapper, OrderPushBodyDto.getJson(String.valueOf(order.getDdId()), String.valueOf(order.getState()), 0));
     }
 
-
     //核销积分
     private AjaxResult redeePoints(OrderDTO orderDTO, Long userId) {
         if (ObjectUtil.isNotNull(orderDTO.getPoints()) && ObjectUtil.notEqual(orderDTO.getPoints(), 0) && ObjectUtil.isNotNull(orderDTO.getPointsReduction()) && ObjectUtil.notEqual(orderDTO.getPointsReduction(), 0)) {
@@ -1275,12 +1331,12 @@ List<String > parentDdIds = orlist.stream().map(PosOrder::getParentDdId).collect
             walletQuery.eq(UserWallet::getUserId, userId);
             UserWallet userWallet = userWalletService.getOne(walletQuery);
             if (ObjectUtil.isNotNull(userWallet)) {
-                if (userWallet.getPointsWallet().compareTo(BigDecimal.valueOf(orderDTO.getPoints())) >= 0) {
+                if (userWallet.getPointsWallet().compareTo(Long.valueOf(orderDTO.getPoints())) >= 0) {
                     walletQuery.eq(UserWallet::getVersion, userWallet.getVersion());
-                    userWallet.setPointsWallet(userWallet.getPointsWallet().subtract(BigDecimal.valueOf(orderDTO.getPoints())));
+                    userWallet.setPointsWallet(userWallet.getPointsWallet() - orderDTO.getPoints());
                     userWallet.setVersion(userWallet.getVersion() + 1);
                     boolean update = userWalletService.update(userWallet, walletQuery);
-                    createPointTransaction(userId, BigDecimal.valueOf(orderDTO.getPoints()), userWallet.getPointsWallet(), orderDTO.getDdId().toString(), "1");
+                    createPointTransaction(userId, Long.valueOf(orderDTO.getPoints()), userWallet.getPointsWallet(), orderDTO.getDdId().toString(), "1");
                     if (!update) {
                         throw new ServiceException(MessageUtils.message("no.points.update.fail"));
                     }
@@ -1293,28 +1349,48 @@ List<String > parentDdIds = orlist.stream().map(PosOrder::getParentDdId).collect
         }
         return success();
     }
-
     /**
      * 创建积分流水
      */
-    private void createPointTransaction(Long userid, BigDecimal pointsChange, BigDecimal currentPoints, String ddId, String type) {
-        WalletTransaction pointsTransaction = new WalletTransaction();
+    private void createPointTransaction(Long userid, Long pointsChange, Long currentPoints, String ddId, String type) {
+        PointsTransaction pointsTransaction = new PointsTransaction();
         pointsTransaction.setUserId(userid);
         if (type.equals("1")) {
-            pointsTransaction.setChange("-" + pointsChange);
+            pointsTransaction.setPointsChange("-" + pointsChange);
             pointsTransaction.setType("1");
         }
         if (type.equals("2")) {
-            pointsTransaction.setChange("+" + pointsChange);
+            pointsTransaction.setPointsChange("+" + pointsChange);
             pointsTransaction.setType("2");
         }
-        pointsTransaction.setCurrentBalance(currentPoints.toString());
+        pointsTransaction.setCurrentPoints(currentPoints.toString());
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());
         pointsTransactionService.save(pointsTransaction);
     }
 
 
+    /**
+     * 核销优惠券
+     *
+     * @param orderId
+     */
+    private void redeemCoupons(VipUserQuanyi yh, VipUserQuanyi mdYh, Long orderId) {
+        if (ObjectUtil.isNotNull(yh)) {
+            yh.setState("1");
+            yh.setOrderId(String.valueOf(orderId));
+            yh.setUpdateTime(new Date());
+            userQuanyiService.saveOrUpdate(yh);
+        }
+        if (ObjectUtil.isNotNull(mdYh)) {
+            mdYh.setState("1");
+            mdYh.setOrderId(String.valueOf(orderId));
+            mdYh.setUpdateTime(new Date());
+            userQuanyiService.saveOrUpdate(mdYh);
+        }
+    }
+
+
     /**
      * 核销优惠券
      *
@@ -1547,7 +1623,7 @@ List<String > parentDdIds = orlist.stream().map(PosOrder::getParentDdId).collect
             }
             //退款、作废退回积分
             if ((posOrder.getState() == 7 || posOrder.getState() == 11) && posOrder.getPoints() != null && posOrder.getPoints() > 0) {
-                returnPoints(posOrder.getUserId(), posOrder.getDdId(), Long.valueOf(posOrder.getPoints()));
+                returnPoints(posOrder.getUserId(), Long.valueOf(posOrder.getDdId()), Long.valueOf(posOrder.getPoints()));
             }
             return toAjax(posOrderService.updatePosOrder(posOrder));
         } else {
@@ -1566,18 +1642,18 @@ List<String > parentDdIds = orlist.stream().map(PosOrder::getParentDdId).collect
      * @param ddId
      * @param points
      */
-    public void returnPoints(Long userId, String ddId, Long points) {
+    public void returnPoints(Long userId, Long ddId, Long points) {
         LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
         walletQuery.eq(UserWallet::getUserId, userId);
         UserWallet userWallet = userWalletService.getOne(walletQuery);
-        WalletTransaction transaction = pointsTransactionService.getOne(new LambdaQueryWrapper<WalletTransaction>().eq(WalletTransaction::getDdId, ddId).eq(WalletTransaction::getType, "2"));
+        PointsTransaction transaction = pointsTransactionService.getOne(new LambdaQueryWrapper<PointsTransaction>().eq(PointsTransaction::getDdId, ddId.toString()).eq(PointsTransaction::getType, "2"));
         //该订单不存在退回的积分记录
         if (ObjectUtil.isNotNull(userWallet) && transaction == null) {
             walletQuery.eq(UserWallet::getVersion, userWallet.getVersion());
-            userWallet.setPointsWallet(userWallet.getPointsWallet().add(BigDecimal.valueOf(points)));
+            userWallet.setPointsWallet(userWallet.getPointsWallet() + points);
             userWallet.setVersion(userWallet.getVersion() + 1);
             boolean update = userWalletService.update(userWallet, walletQuery);
-            createPointTransaction(userId, BigDecimal.valueOf(points), userWallet.getPointsWallet(), ddId.toString(), "2");
+            createPointTransaction(userId, Long.valueOf(points), userWallet.getPointsWallet(), ddId.toString(), "2");
             if (!update) {
                 throw new ServiceException(MessageUtils.message("no.points.update.fail"));
             }

+ 29 - 27
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderRatingController.java

@@ -3,16 +3,14 @@ package com.ruoyi.app.order;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.system.domain.WalletTransaction;
-import com.ruoyi.system.domain.SysPointControl;
-import com.ruoyi.system.domain.UserWallet;
+import com.ruoyi.system.domain.*;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.system.service.ISysPointControlService;
 import com.ruoyi.system.service.IUserWalletService;
@@ -25,7 +23,6 @@ import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.system.domain.PosOrderRating;
 import com.ruoyi.system.service.IPosOrderRatingService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -79,33 +76,37 @@ public class PosOrderRatingController extends BaseController
     /**
      * 添加积分
      */
-    private void addPoint(Long userid, String ddId){
+    /**
+     * 添加积分
+     */
+    private void addPoint(Long userid, String ddId) {
         SysPointControl control = pointControlService.getById(1);
         //开启评论获得积分
-        if(control.getReviewEnable().equals(1L)){
-            LambdaQueryWrapper<UserWallet> walletQuery=new LambdaQueryWrapper<>();
-            walletQuery.eq(UserWallet::getUserId,userid);
+        if (control.getReviewEnable().equals(1L)) {
+            LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+            walletQuery.eq(UserWallet::getUserId, userid);
             UserWallet userWallet = userWalletService.getOne(walletQuery);
 
-            if(userWallet==null){
-                userWallet=new UserWallet();
+            if (userWallet == null) {
+                userWallet = new UserWallet();
                 userWallet.setUserId(userid);
-                userWallet.setPointsWallet(BigDecimal.valueOf(control.getReviewPoints()));
-                createPointTransaction(userid,control.getReviewPoints(),userWallet.getPointsWallet(),ddId);
+                userWallet.setPointsWallet(control.getReviewPoints());
+                userWallet.setBalanceWallet(java.math.BigDecimal.ZERO);
+                createPointTransaction(userid, control.getReviewPoints(), userWallet.getPointsWallet(), ddId);
                 userWalletService.save(userWallet);
-            }else{
-                BigDecimal userPoint = userWallet.getPointsWallet();
+            } else {
+                Long userPoint = userWallet.getPointsWallet();
                 Long point = control.getReviewPoints();
-                BigDecimal newPoint = userPoint.add(BigDecimal.valueOf(point));
+                Long newPoint = userPoint + point;
                 userWallet.setPointsWallet(newPoint);
                 int oldVersion = userWallet.getVersion();
-                userWallet.setVersion(userWallet.getVersion()+1);
-                walletQuery.eq(UserWallet::getVersion,oldVersion);
-                boolean update= userWalletService.update(userWallet,walletQuery);
-                if(!update){
+                userWallet.setVersion(userWallet.getVersion() + 1);
+                walletQuery.eq(UserWallet::getVersion, oldVersion);
+                boolean update = userWalletService.update(userWallet, walletQuery);
+                if (!update) {
                     throw new ServiceException(MessageUtils.message("no.points.update.fail"));
                 }
-                createPointTransaction(userid,control.getReviewPoints(),userWallet.getPointsWallet(),ddId);
+                createPointTransaction(userid, control.getReviewPoints(), userWallet.getPointsWallet(), ddId);
             }
 
         }
@@ -114,19 +115,20 @@ public class PosOrderRatingController extends BaseController
     /**
      * 创建积分流水
      */
-    private void createPointTransaction(Long userid, Long pointsChange, BigDecimal currentPoints, String ddId){
-        WalletTransaction pointsTransaction = new WalletTransaction();
+    private void createPointTransaction(Long userid, Long pointsChange, Long currentPoints, String ddId) {
+        PointsTransaction pointsTransaction = new PointsTransaction();
         pointsTransaction.setUserId(userid);
-        pointsTransaction.setChange("+"+pointsChange);
-        pointsTransaction.setCurrentBalance(currentPoints.toString());
+        pointsTransaction.setPointsChange("+" + pointsChange);
+        pointsTransaction.setCurrentPoints(currentPoints.toString());
         pointsTransaction.setType("0");
-        pointsTransaction.setDdId(String.valueOf(ddId));
+        pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());
         pointsTransactionService.save(pointsTransaction);
     }
 
 
 
+
     /**
      * 获取订单评级
      * @return
@@ -165,7 +167,7 @@ public class PosOrderRatingController extends BaseController
     {
         List<PosOrderRating> list = posOrderRatingService.selectPosOrderRatingList(posOrderRating);
         ExcelUtil<PosOrderRating> util = new ExcelUtil<PosOrderRating>(PosOrderRating.class);
-        util.exportExcel(response, list, "订单评级数据");
+        util.exportExcel(list, "订单评级数据");
     }
 
     /**

+ 16 - 16
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosReviewController.java

@@ -4,7 +4,7 @@ import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONArray;
@@ -124,13 +124,13 @@ public class PosReviewController extends BaseController
             if(userWallet==null){
                 userWallet=new UserWallet();
                 userWallet.setUserId(userid);
-                userWallet.setPointsWallet(BigDecimal.valueOf(control.getReviewPoints()));
-                createPointTransaction(userid, BigDecimal.valueOf(control.getReviewPoints()),userWallet.getPointsWallet(),ddId.toString());
+                userWallet.setPointsWallet(control.getReviewPoints());
+//                createPointTransaction(userid, BigDecimal.valueOf(control.getReviewPoints()), BigDecimal.valueOf(userWallet.getPointsWallet()),ddId.toString());
                 userWalletService.save(userWallet);
             }else{
-                BigDecimal userPoint = userWallet.getPointsWallet();
+                Long userPoint = userWallet.getPointsWallet();
                 Long point = control.getReviewPoints();
-                BigDecimal newPoint = userPoint.add(BigDecimal.valueOf(point));
+                long newPoint = userPoint+point;
                 userWallet.setPointsWallet(newPoint);
                 int oldVersion = userWallet.getVersion();
                 userWallet.setVersion(userWallet.getVersion()+1);
@@ -139,7 +139,7 @@ public class PosReviewController extends BaseController
                if(!update){
                    throw new ServiceException(MessageUtils.message("no.points.update.fail"));
                }
-                createPointTransaction(userid,BigDecimal.valueOf(control.getReviewPoints()),userWallet.getPointsWallet(),ddId.toString());
+//                createPointTransaction(userid,BigDecimal.valueOf(control.getReviewPoints()), BigDecimal.valueOf(userWallet.getPointsWallet()),ddId.toString());
             }
 
         }
@@ -148,16 +148,16 @@ public class PosReviewController extends BaseController
     /**
      * 创建积分流水
      */
-    private void createPointTransaction(Long userid,BigDecimal pointsChange,BigDecimal currentPoints,String ddId){
-        WalletTransaction pointsTransaction = new WalletTransaction();
-        pointsTransaction.setUserId(userid);
-        pointsTransaction.setChange("+"+pointsChange);
-        pointsTransaction.setCurrentBalance(currentPoints.toString());
-        pointsTransaction.setType("0");
-        pointsTransaction.setDdId(ddId);
-        pointsTransaction.setCreateTime(new Date());
-        pointsTransactionService.save(pointsTransaction);
-    }
+//    private void createPointTransaction(Long userid,BigDecimal pointsChange,BigDecimal currentPoints,String ddId){
+//        WalletTransaction pointsTransaction = new WalletTransaction();
+//        pointsTransaction.setUserId(userid);
+//        pointsTransaction.setChange("+"+pointsChange);
+//        pointsTransaction.setCurrentBalance(currentPoints.toString());
+//        pointsTransaction.setType("0");
+//        pointsTransaction.setDdId(ddId);
+//        pointsTransaction.setCreateTime(new Date());
+//        pointsTransactionService.save(pointsTransaction);
+//    }
 
 
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/order/TaxiOrderController.java

@@ -3,7 +3,7 @@ package com.ruoyi.app.order;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/order/TaxiPricesController.java

@@ -3,7 +3,7 @@ package com.ruoyi.app.order;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/order/TestTask.java

@@ -62,7 +62,7 @@ public class TestTask {
             posOrderService.saveOrUpdate(posOrder);
             try {
                 if(posOrder.getPoints()!=null && posOrder.getPoints()>0){
-                    posorder.returnPoints(posOrder.getUserId(),posOrder.getDdId(),Long.valueOf(posOrder.getPoints()));
+                    posorder.returnPoints(posOrder.getUserId(), Long.valueOf(posOrder.getDdId()),Long.valueOf(posOrder.getPoints()));
                 }
             }catch (Exception e){
                 logger.warn("定时任务取消订单,积分返还失败订单号: {},异常信息:{}", posOrder.getId(),e.getMessage());

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/pay/BankCardController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.pay;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/pay/IpnLogController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.pay;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +24,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * IpnLogController
- * 
+ *
  * @author ruoyi
  * @date 2023-11-22
  */

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/pay/PayController.java

@@ -30,7 +30,7 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.text.DecimalFormat;
 import java.util.Enumeration;
 import java.util.HashMap;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java

@@ -36,8 +36,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.stream.Collectors;
 

+ 0 - 401
ruoyi-admin/src/main/java/com/ruoyi/app/pay/UserBillingController.java~

@@ -1,401 +0,0 @@
-package com.ruoyi.app.pay;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.app.order.ZaloPayCommonService;
-import com.ruoyi.app.utils.DateUtil;
-import com.ruoyi.app.utils.IpUtils;
-import com.ruoyi.app.utils.Md5Pay;
-import com.ruoyi.app.utils.zaloPay.ZaloPay;
-import com.ruoyi.app.utils.zaloPay.ZaloPayConfig;
-import com.ruoyi.app.utils.zaloPay.ZaloPayCreateOrderResponse;
-import com.ruoyi.common.annotation.Anonymous;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.annotation.RepeatSubmit;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.system.domain.PosOrder;
-import com.ruoyi.system.domain.UserBilling;
-import com.ruoyi.system.domain.vo.BillDTO;
-import com.ruoyi.system.mapper.UserBillingMapper;
-import com.ruoyi.system.service.IInfoUserService;
-import com.ruoyi.system.service.IPosOrderService;
-import com.ruoyi.system.service.IUserBillingService;
-import com.ruoyi.system.utils.Auth;
-import com.ruoyi.system.utils.JwtUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * BillingController
- *
- * @author ruoyi
- * @date 2023-09-06
- */
-@RestController
-@RequestMapping("/Billing/billing")
-public class UserBillingController extends BaseController
-{
-    @Autowired
-    private IUserBillingService userBillingService;
-    @Autowired
-    private UserBillingMapper userBillingMapper;
-    @Autowired
-    private IPosOrderService posOrderService;
-    @Autowired
-    private IInfoUserService infoUserService;
-    @Autowired
-    private ZaloPayCommonService zaloPayCommonService;
-    @Autowired
-    private ZaloPayConfig zaloPayConfig;
-    @Autowired
-    private ZaloPay zaloPay;
-
-    /**
-     * 商家日账单数据
-     * @param token
-     * @param page
-     * @param size
-     * @param riqi
-     * @return
-     */
-    @Anonymous
-    @Auth
-    @GetMapping("/getzddaylist")
-    public AjaxResult getzddaylist(@RequestHeader String token,
-                                    @RequestParam Long page,
-                                    @RequestParam Long size,
-                                    @RequestParam String riqi)
-    {
-        JwtUtil jwtUtil = new JwtUtil();
-        Long id = Long.valueOf(jwtUtil.getusid(token));
-        List<UserBilling> list = userBillingMapper.getdaylist(id,riqi,(page-1)*size,size);
-        setYhInfo(list);
-        BillDTO sum = userBillingMapper.getdaysum(id,riqi);
-        JSONObject org = new JSONObject();
-        org.put("shul",sum.getSul());
-        org.put("sum",sum.getShouru());
-        org.put("list",list);
-        return success(MessageUtils.message("no.success"), org);
-    }
-
-    /**
-     * 商家周账单数据
-     * @param token
-     * @param page
-     * @param size
-     * @param riqi
-     * @return
-     */
-    @Anonymous
-    @Auth
-    @GetMapping("/getzdmeeklist")
-    public AjaxResult getzdmeeklist(@RequestHeader String token,
-                                   @RequestParam Long page,
-                                   @RequestParam Long size,
-                                   @RequestParam String riqi)
-    {
-        JwtUtil jwtUtil = new JwtUtil();
-        Long id = Long.valueOf(jwtUtil.getusid(token));
-        List<UserBilling> list = userBillingMapper.getmeeklist(id,riqi,(page-1)*size,size);
-        setYhInfo(list);
-        BillDTO sum = userBillingMapper.getmeeksum(id,riqi);
-        JSONObject org = new JSONObject();
-        org.put("shul",sum.getSul());
-        org.put("sum",sum.getShouru());
-        org.put("list",list);
-        return success(MessageUtils.message("no.success"), org);
-    }
-
-    private void setYhInfo(List<UserBilling> list) {
-        if(!list.isEmpty()){
-            List<String> orderIds=list.stream().map(UserBilling::getDdId).collect(Collectors.toList());
-            LambdaQueryWrapper<PosOrder> query = new LambdaQueryWrapper<>();
-            query.in(PosOrder::getDdId,orderIds);
-            List<PosOrder> orders = posOrderService.list(query);
-            list.forEach(billing -> {
-                orders.stream().filter(o -> o.getDdId().toString().equals(billing.getDdId())).findFirst().ifPresent(o -> {
-                    billing.setActivity(o.getActivity());
-                    billing.setMdActivity(o.getMdActivity());
-                    billing.setMdActivity(o.getMdActivity());
-                    billing.setYhId(o.getYhId());
-                    billing.setYhName(o.getYhName());
-                    billing.setDiscountAmount(o.getDiscountAmount());
-                    billing.setMdYhId(o.getMdYhId());
-                    billing.setMdYhName(o.getMdYhName());
-                    billing.setMdDiscountAmount(o.getMdDiscountAmount());
-                    billing.setSalesName(o.getSalesName());
-                    billing.setMdSalesName(o.getMdSalesName());
-                    billing.setSalesReduction(o.getSalesReduction());
-                    billing.setMdSalesReduction(o.getMdSalesReduction());
-                    billing.setPoints(o.getPoints());
-                    billing.setPointsReduction(o.getPointsReduction());
-                });
-            });
-        }
-    }
-
-    /**
-     * 商家月账单数据
-     * @param token
-     * @param page
-     * @param size
-     * @param riqi
-     * @return
-     */
-    @Anonymous
-    @Auth
-    @GetMapping("/getzdmatlist")
-    public AjaxResult getzdmatlist(@RequestHeader String token,
-                                @RequestParam Long page,
-                                @RequestParam Long size,
-                                @RequestParam String riqi)
-    {
-        JwtUtil jwtUtil = new JwtUtil();
-        Long id = Long.valueOf(jwtUtil.getusid(token));
-        List<UserBilling> list = userBillingMapper.getmatlist(id,riqi,(page-1)*size,size);
-        setYhInfo(list);
-        BillDTO sum = userBillingMapper.getmatsum(id,riqi);
-        JSONObject org = new JSONObject();
-        org.put("shul",sum.getSul());
-        org.put("sum",sum.getShouru());
-        org.put("list",list);
-        return success(MessageUtils.message("no.success"), org);
-    }
-
-    //充值
-    @Anonymous
-    @Auth
-    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
-    @RequestMapping(value = "/userRecharge", method = {RequestMethod.GET,RequestMethod.POST})
-    public AjaxResult userRecharge(@RequestHeader String token, @RequestParam String language, @RequestParam Long amount, HttpServletRequest request)
-    {
-        JwtUtil jwtUtil = new JwtUtil();
-        IpUtils ipUtils = new IpUtils();
-        String ip = ipUtils.getIpAddr(request);
-        String id = jwtUtil.getusid(token);
-        Long timeLong = System.currentTimeMillis();
-        Md5Pay md5Pay = new Md5Pay();
-        String orderid = "CZ"+timeLong;
-        System.out.println("orderid:"+orderid);
-        String obj =  md5Pay.VNPay(language,orderid,String.valueOf(amount),ip);
-        UserBilling billing = new UserBilling();
-        billing.setUserId(Long.valueOf(id));
-        billing.setType(String.valueOf(1));
-        billing.setDdId(orderid);
-        billing.setAmount(Double.valueOf(amount));
-        billing.setState(String.valueOf(3));
-        billing.setIllustrate("用户充值");
-        billing.setPaymentMethod("app线上充值");
-        billing.setUrl(obj);
-        Boolean reg = userBillingService.saveOrUpdate(billing);
-        if(reg){
-            return success(MessageUtils.message("no.order.create.success"), obj);
-        }else {
-            return error();
-        }
-    }
-
-
-    /**
-     *  充值使用ZaloPay
-     * @param token
-     * @param language
-     * @param amount
-     * @param request
-     * @return
-     */
-    @Anonymous
-    @Auth
-    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
-    @RequestMapping(value = "/userRechargeZaloPay", method = {RequestMethod.GET,RequestMethod.POST})
-    public AjaxResult userRechargeZaloPay(@RequestHeader String token, @RequestParam String language, @RequestParam Long amount,@RequestParam String payType, HttpServletRequest request) throws Exception {
-        JwtUtil jwtUtil = new JwtUtil();
-        String userId = jwtUtil.getusid(token);
-        Long timeLong = System.currentTimeMillis();
-        String orderid = "CZ"+timeLong;
-        System.out.println("orderid:"+orderid);
-        ZaloPayCreateOrderResponse obj =  ZaloPay.createOrder(userId,orderid,amount,"user recharch by zalopay",zaloPayConfig.getZaloPayConfig(payType));
-        zaloPayCommonService.setZaloPayOrder(orderid, JSON.toJSONString(obj),null,null,null,payType);
-        UserBilling billing = new UserBilling();
-        billing.setUserId(Long.valueOf(userId));
-        billing.setType(String.valueOf(1));
-        billing.setDdId(orderid);
-        billing.setAmount(Double.valueOf(amount));
-        billing.setState(String.valueOf(3));
-        billing.setIllustrate("用户充值");
-        billing.setPaymentMethod("zalopay线上充值");
-        billing.setUrl(JSONObject.toJSONString(obj));
-        Boolean reg = userBillingService.saveOrUpdate(billing);
-        if(reg){
-            return success(MessageUtils.message("no.order.create.success"), obj);
-        }else {
-            return error();
-        }
-    }
-
-
-    //查询用户账户及余额
-    @Anonymous
-    @Auth
-    @GetMapping("/getUsbalance")
-    public AjaxResult getUsbalance(@RequestHeader String token,
-                                   @RequestParam Integer page,
-                                   @RequestParam Integer size,
-                                   @RequestParam boolean sort,
-                                   @RequestParam(defaultValue = "") String type)
-    {
-        JwtUtil jwtUtil = new JwtUtil();
-        DateUtil dateUtil = new DateUtil();
-        String id = jwtUtil.getusid(token);
-        if (!"".equals(type)){
-            JSONObject org = new JSONObject();
-            IPage<UserBilling> palist = new Page<>(page,size);
-            QueryWrapper<UserBilling> wrapper = new QueryWrapper<>();
-            int sumlist = userBillingMapper.gettypesum(Long.valueOf(id), Long.valueOf(type));
-            wrapper.eq("user_id",id);
-            wrapper.eq("type",type);
-            wrapper.orderBy(true, sort, "cretim");
-            IPage<UserBilling> mmlist =  userBillingService.page(palist,wrapper);
-            List<UserBilling> list = mmlist.getRecords();
-            JSONArray arr = new JSONArray();
-            for(int i=0;i<list.size();i++){
-                JSONObject ject = new JSONObject();
-                ject.put("id",list.get(i).getId());
-                ject.put("user",infoUserService.getById(list.get(i).getUserId()));
-                ject.put("type",list.get(i).getType());
-                PosOrder order = posOrderService.getById(list.get(i).getDdId());
-                ject.put("ddId",order==null?list.get(i).getDdId():order.getDdId());
-                ject.put("amount",list.get(i).getAmount());
-                ject.put("divvy",list.get(i).getDivvy());
-                ject.put("state",list.get(i).getState());
-                ject.put("mdId",list.get(i).getMdId());
-                ject.put("illustrate",list.get(i).getIllustrate());
-                ject.put("paymentMethod",list.get(i).getPaymentMethod());
-                ject.put("accountNumber",list.get(i).getAccountNumber());
-                ject.put("url",list.get(i).getUrl());
-                ject.put("cretim",dateUtil.setDate(list.get(i).getCretim()));
-                arr.add(ject);
-            }
-            org.put("sum",sumlist);
-            org.put("list",arr);
-            return success(MessageUtils.message("no.success"), org);
-        }else {
-            JSONObject org = new JSONObject();
-            IPage<UserBilling> palist = new Page<>(page,size);
-            QueryWrapper<UserBilling> wrapper = new QueryWrapper<>();
-            int zlist = userBillingMapper.gettypesum(Long.valueOf(id), 1L);
-            int txlist = userBillingMapper.gettypesum(Long.valueOf(id), 2L);
-            int xfei = userBillingMapper.gettypesum(Long.valueOf(id), 3L);
-            wrapper.eq("user_id",id);
-            wrapper.orderBy(true, sort, "cretim");
-            IPage<UserBilling> mmlist =  userBillingService.page(palist,wrapper);
-            List<UserBilling> list = mmlist.getRecords();
-            JSONArray arr = new JSONArray();
-            for(int i=0;i<list.size();i++){
-                JSONObject ject = new JSONObject();
-                ject.put("id",list.get(i).getId());
-                ject.put("user",infoUserService.getById(list.get(i).getUserId()));
-                ject.put("type",list.get(i).getType());
-                PosOrder order = posOrderService.getById(list.get(i).getDdId());
-                ject.put("ddId",order==null?list.get(i).getDdId():order.getDdId());
-                ject.put("amount",list.get(i).getAmount());
-                ject.put("divvy",list.get(i).getDivvy());
-                ject.put("state",list.get(i).getState());
-                ject.put("mdId",list.get(i).getMdId());
-                ject.put("illustrate",list.get(i).getIllustrate());
-                ject.put("paymentMethod",list.get(i).getPaymentMethod());
-                ject.put("accountNumber",list.get(i).getAccountNumber());
-                ject.put("cretim",dateUtil.setDate(list.get(i).getCretim()));
-                ject.put("url",list.get(i).getUrl());
-                arr.add(ject);
-            }
-            int sum = zlist-txlist-xfei;
-            org.put("sum",sum);
-            org.put("list",arr);
-            return success(MessageUtils.message("no.success"), org);
-        }
-    }
-    /**
-     * 查询Billing列表
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(UserBilling userBilling)
-    {
-        startPage();
-        List<UserBilling> list = userBillingService.selectUserBillingList(userBilling);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出Billing列表
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:export')")
-    @Log(title = "Billing", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, UserBilling userBilling)
-    {
-        List<UserBilling> list = userBillingService.selectUserBillingList(userBilling);
-        ExcelUtil<UserBilling> util = new ExcelUtil<UserBilling>(UserBilling.class);
-        util.exportExcel(response, list, MessageUtils.message("no.export.excel.billing"));
-    }
-
-    /**
-     * 获取Billing详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
-        return success(userBillingService.selectUserBillingById(id));
-    }
-
-    /**
-     * 新增Billing
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:add')")
-    @Log(title = "Billing", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody UserBilling userBilling)
-    {
-        return toAjax(userBillingService.insertUserBilling(userBilling));
-    }
-
-    /**
-     * 修改Billing
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:edit')")
-    @Log(title = "Billing", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody UserBilling userBilling)
-    {
-        return toAjax(userBillingService.updateUserBilling(userBilling));
-    }
-
-    /**
-     * 删除Billing
-     */
-    @PreAuthorize("@ss.hasPermi('Billing:billing:remove')")
-    @Log(title = "Billing", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
-        return toAjax(userBillingService.deleteUserBillingByIds(ids));
-    }
-}

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/pay/ZaloPayController.java

@@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import javax.xml.bind.DatatypeConverter;
 import java.io.IOException;
 import java.net.URISyntaxException;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/promotion/SalesPromotionController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.promotion;
 
 import java.util.Arrays;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/promotion/SocialFeedbackController.java

@@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/qiyefuwu/SysQiyejieshaoController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.qiyefuwu;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -24,7 +24,7 @@ import com.ruoyi.common.utils.MessageUtils;
 
 /**
  * qiyejieshaoController
- * 
+ *
  * @author ruoyi
  * @date 2023-05-16
  */

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/report/StatisticsController.java

@@ -15,7 +15,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.TimeZone;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 
 @RestController
 @RequestMapping("/report/statistics")

+ 506 - 124
ruoyi-admin/src/main/java/com/ruoyi/app/service/WalletService.java

@@ -1,219 +1,601 @@
 package com.ruoyi.app.service;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.ruoyi.common.exception.ConcurrentUpdateException;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.ruoyi.app.utils.ConstantUtil;
 import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.system.domain.WalletTransaction;
+import com.ruoyi.common.utils.MessageUtils;
+import com.ruoyi.system.domain.InfoUser;
+import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.UserBilling;
 import com.ruoyi.system.domain.UserWallet;
+import com.ruoyi.system.service.IInfoUserService;
 import com.ruoyi.system.service.IPointsTransactionService;
+import com.ruoyi.system.service.IUserBillingService;
 import com.ruoyi.system.service.IUserWalletService;
-import lombok.extern.slf4j.Slf4j;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.retry.annotation.Backoff;
-import org.springframework.retry.annotation.Retryable;
 import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 
-@Slf4j
 @Component
 public class WalletService {
     @Autowired
     private IUserWalletService userWalletService;
     @Autowired
     private IPointsTransactionService pointsTransactionService;
+    @Autowired
+    private IInfoUserService userService;
+    @Autowired
+    private RedissonClient redissonClient;
+    @Autowired
+    private IUserBillingService billingService;
+
+    // 锁超时时间(秒)
+    private static final int LOCK_TIMEOUT = 20;
+    // 锁等待时间(秒)
+    private static final int LOCK_WAIT_TIME = 10;
 
     /**
      * 订单取消、退款成功返回积分
      *
-     * @param userId 用户ID
-     * @param ddId   订单ID
-     * @param points 积分数量
+     * @param userId
+     * @param ddId
+     * @param points
      */
-    @Retryable(value = ConcurrentUpdateException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000, multiplier = 1.5))
-    @Transactional(rollbackFor = Exception.class)
-    public void returnPoints(Long userId, String ddId, Long points) {
-        log.info("开始处理积分退回,用户ID: {}, 订单ID: {}, 积分: {}", userId, ddId, points);
 
+    /**
+     * 订单取消、退款成功返回积分
+     *
+     * @param userId
+     * @param ddId
+     * @param points
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void returnPoints(Long userId, Long ddId, Long points) {
         // 1. 参数校验
-        validateReturnPointsParams(userId, ddId, points);
-
-        // 2. 获取用户钱包
-        UserWallet userWallet = getUserWallet(userId);
-
-        // 3. 检查是否已经退过积分(防重复)
-        checkDuplicateReturn(ddId);
-
-        // 4. 执行积分退回
-        executePointsReturn(userWallet, BigDecimal.valueOf(points), ddId);
+        if (userId == null || ddId == null || points == null || points <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
+        }
 
-        log.info("积分退回成功,用户ID: {}, 订单ID: {}, 积分: {}", userId, ddId, points);
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
+        }
+        String lockKey = "wallet:lock:" + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+
+                    // 3. 检查是否已经退过积分(防重复)
+                    PointsTransaction existingTransaction = pointsTransactionService.getOne(
+                            new LambdaQueryWrapper<PointsTransaction>()
+                                    .eq(PointsTransaction::getDdId, ddId.toString())
+                                    .eq(PointsTransaction::getType, "2")
+                    );
+                    if (existingTransaction != null) {
+                        throw new ServiceException("该订单积分已退回,请勿重复操作");
+                    }
+
+                    // 4. 先创建积分流水记录(重要:先记录后更新)
+                    Long newBalance = userWallet.getPointsWallet() + points;
+                    createPointTransaction(userId, points.toString(), newBalance.toString(), ddId.toString(), "2");
+
+                    // 5. 乐观锁更新钱包
+                    LambdaQueryWrapper<UserWallet> updateQuery = new LambdaQueryWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion()); // 版本控制
+
+                    userWallet.setPointsWallet(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
+        }
     }
 
     /**
-     * 订单取消、退款成功返回余额
+     * 扣除积分(订单支付等场景)
      *
      * @param userId 用户ID
      * @param ddId   订单ID
-     * @param amount 金额
+     * @param points 扣除积分数量
      */
-    @Retryable(value = ConcurrentUpdateException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000, multiplier = 1.5))
     @Transactional(rollbackFor = Exception.class)
-    public void returnBalance(Long userId, String ddId, BigDecimal amount) {
-        log.info("开始处理余额退回,用户ID: {}, 订单ID: {}, 金额: {}", userId, ddId, amount);
-
+    public void deductPoints(Long userId, Long ddId, Long points) {
         // 1. 参数校验
-        validateReturnBalanceParams(userId, ddId, amount);
-
-        // 2. 获取用户钱包
-        UserWallet userWallet = getUserWallet(userId);
-
-        // 3. 检查是否已经退过余额(防重复)
-        checkDuplicateBalanceReturn(ddId);
+        if (userId == null || ddId == null || points == null || points <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
+        }
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
+        }
 
-        // 4. 执行余额退回
-        executeBalanceReturn(userWallet, amount, ddId);
+        String lockKey = ConstantUtil.WalletPointLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+
+                    // 3. 检查积分是否足够
+                    if (userWallet.getPointsWallet() < points) {
+                        throw new ServiceException("积分余额不足");
+                    }
+
+                    // 4. 检查是否已经扣过积分(防重复)
+                    PointsTransaction existingTransaction = pointsTransactionService.getOne(
+                            new LambdaQueryWrapper<PointsTransaction>()
+                                    .eq(PointsTransaction::getDdId, ddId.toString())
+                                    .eq(PointsTransaction::getType, "1")
+                    );
+                    if (existingTransaction != null) {
+                        throw new ServiceException("该订单积分已扣除,请勿重复操作");
+                    }
+
+                    // 5. 先创建积分流水记录
+                    Long newBalance = userWallet.getPointsWallet() - points;
+                    createPointTransaction(userId, points.toString(), newBalance.toString(), ddId.toString(), "1");
+
+                    // 6. 乐观锁更新钱包
+                    LambdaQueryWrapper<UserWallet> updateQuery = new LambdaQueryWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+
+                    userWallet.setPointsWallet(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
+        }
+    }
 
-        log.info("余额退回成功,用户ID: {}, 订单ID: {}, 金额: {}", userId, ddId, amount);
+    /**
+     * 增加余额
+     *
+     * @param userId  用户ID
+     * @param amount  增加金额
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void addBalance(Long userId, BigDecimal amount,UserBilling billing) {
+        // 1. 参数校验
+        if (userId == null || amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
+        }
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
+        }
+        String lockKey = ConstantUtil.WalletBalanceLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+                    Double behalfAmount=billing.getBehalfAmount();
+                    // 3. 更新余额
+                    BigDecimal newBalance = userWallet.getBalanceWallet().add(amount);
+                    if(behalfAmount!=null){
+                        newBalance=newBalance.subtract(BigDecimal.valueOf(behalfAmount));
+                        //该订单存在冻结金额,解冻金额
+                        long blockedCount=billingService.count(new LambdaQueryWrapper<UserBilling>().eq(UserBilling::getUserId, userId).eq(UserBilling::getDdId,billing.getDdId()).eq(UserBilling::getType,"4"));
+                        if(blockedCount>0){
+                            BigDecimal newBlocked= userWallet.getBlockedFunds().subtract(BigDecimal.valueOf(behalfAmount));
+                            userWallet.setBlockedFunds(newBlocked);
+                            createUserBill(userId, billing.getDdId(),"5", BigDecimal.valueOf(behalfAmount), newBlocked,user.getUserType(),"release blocked founds",null);
+                        }
+                    }
+
+                    // 4. 乐观锁更新钱包
+                    LambdaUpdateWrapper<UserWallet> updateQuery = new LambdaUpdateWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+                    userWallet.setBalanceWallet(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    createUserBill(billing,userWallet.getBalanceWallet());
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
+        }
     }
 
     /**
-     * 校验积分退回参数
+     * 增加余额
+     *
+     * @param userId  用户ID
+     * @param amount  增加金额
      */
-    private void validateReturnPointsParams(Long userId, String ddId, Long points) {
-        if (userId == null || userId <= 0) {
-            throw new ServiceException("用户ID不能为空或无效");
+    @Transactional(rollbackFor = Exception.class)
+    public void addBalance(Long userId,String ddId,String type, BigDecimal amount,BigDecimal behalfAmount) {
+        // 1. 参数校验
+        if (userId == null || amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
         }
-        if (ddId == null || ddId.trim().isEmpty()) {
-            throw new ServiceException("订单ID不能为空或无效");
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
         }
-        if (points == null || points <= 0) {
-            throw new ServiceException("积分数量必须大于0");
+        String lockKey = ConstantUtil.WalletBalanceLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+                    // 3. 更新余额
+                    BigDecimal newBalance = userWallet.getBalanceWallet().add(amount).subtract(behalfAmount);
+
+                    // 4. 乐观锁更新钱包
+                    LambdaUpdateWrapper<UserWallet> updateQuery = new LambdaUpdateWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+
+                    userWallet.setBalanceWallet(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+                    //该订单存在冻结金额,解冻金额
+                    long blockedCount=billingService.count(new LambdaQueryWrapper<UserBilling>().eq(UserBilling::getUserId, userId).eq(UserBilling::getDdId,ddId).eq(UserBilling::getType,"4"));
+                    if(blockedCount>0){
+                        BigDecimal newBlocked= userWallet.getBlockedFunds().subtract(behalfAmount);
+                        userWallet.setBlockedFunds(newBlocked);
+                        createUserBill(userId, ddId,"5", behalfAmount, newBlocked,user.getUserType(),"release blocked founds",null);
+                    }
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    createUserBill(userId, ddId,type, amount, userWallet.getBalanceWallet(),user.getUserType(),"",behalfAmount);
+
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
         }
     }
 
     /**
-     * 校验余额退回参数
+     * 扣除余额
+     *
+     * @param userId  用户ID
+     * @param ddId    订单ID
+     * @param amount  扣除金额
      */
-    private void validateReturnBalanceParams(Long userId, String ddId, BigDecimal amount) {
-        if (userId == null || userId <= 0) {
-            throw new ServiceException("用户ID不能为空或无效");
+    @Transactional(rollbackFor = Exception.class)
+    public void deductBalance(Long userId, String ddId, BigDecimal amount,String remark,String type) {
+        // 1. 参数校验
+        if (userId == null || ddId == null || amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
         }
-        if (ddId == null || ddId.trim().isEmpty()) {
-            throw new ServiceException("订单ID不能为空或无效");
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
         }
-        if (amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
-            throw new ServiceException("金额必须大于0");
+        String lockKey = ConstantUtil.WalletBalanceLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    UserWallet userWallet = getUserWallet(userId);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+                    // 3. 检查余额是否足够
+                    if (userWallet.getBalanceWallet().compareTo(amount) < 0) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.insufficient.balance"));
+                    }
+                    // 4. 更新余额
+                    BigDecimal newBalance = userWallet.getBalanceWallet().subtract(amount);
+                    // 5. 乐观锁更新钱包
+                    LambdaUpdateWrapper<UserWallet> updateQuery = new LambdaUpdateWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+                    userWallet.setBalanceWallet(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                    // 6. 钱包更新成功后再创建账单记录
+                    createUserBill(userId, ddId,type, amount, newBalance,user.getUserType(),remark,null);
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
         }
     }
 
     /**
-     * 获取用户钱包
+     * 获取用户钱包信息
+     *
+     * @param userId 用户ID
+     * @return 用户钱包
      */
-    private UserWallet getUserWallet(Long userId) {
+    public UserWallet getUserWallet(Long userId) {
+        if (userId == null) {
+            throw new ServiceException("用户ID不能为空");
+        }
         LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
         walletQuery.eq(UserWallet::getUserId, userId);
         UserWallet userWallet = userWalletService.getOne(walletQuery);
         if (userWallet == null) {
-            throw new ServiceException("用户钱包不存在,用户ID: " + userId);
+            throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
         }
         return userWallet;
     }
 
     /**
-     * 检查积分退回是否重复
+     * 增加冻结金额(不回滚外层事务)
+     *
+     * @param userId  用户ID
+     * @param amount  增加金额
      */
-    private void checkDuplicateReturn(String ddId) {
-        WalletTransaction existingTransaction = pointsTransactionService.getOne(
-                new LambdaQueryWrapper<WalletTransaction>()
-                        .eq(WalletTransaction::getDdId, ddId)
-                        .eq(WalletTransaction::getType, "2")
-        );
-        if (existingTransaction != null) {
-            throw new ServiceException("该订单积分已退回,请勿重复操作,订单ID: " + ddId);
-        }
+    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
+    public void addBlockFunds(Long userId, BigDecimal amount,String ddId) {
+        addBlockedFundsDetail(userId,amount,ddId);
     }
 
     /**
-     * 检查余额退回是否重复
+     * 解冻冻结金额不操作钱包余额
+     * @param userId
+     * @param amount
+     * @param ddId
      */
-    private void checkDuplicateBalanceReturn(String ddId) {
-        WalletTransaction existingTransaction = pointsTransactionService.getOne(
-                new LambdaQueryWrapper<WalletTransaction>()
-                        .eq(WalletTransaction::getDdId, ddId)
-                        .eq(WalletTransaction::getType, "3") // 余额退回类型
-        );
-        if (existingTransaction != null) {
-            throw new ServiceException("该订单余额已退回,请勿重复操作,订单ID: " + ddId);
+    public void deduceBlocked(Long userId, BigDecimal amount,String ddId) {
+        // 1. 参数校验
+        if (userId == null || amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
+        }
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
         }
-    }
-
-    /**
-     * 执行积分退回
-     */
-    private void executePointsReturn(UserWallet userWallet, BigDecimal points, String ddId) {
-        // 计算新的积分余额
-        BigDecimal newBalance = (userWallet.getPointsWallet() != null ? userWallet.getPointsWallet() : BigDecimal.ZERO).add( points);
-
-        // 先创建积分流水记录
-        createTransaction(userWallet.getUserId(), points, newBalance, ddId, "2");
 
-        // 乐观锁更新钱包
-        updateWalletWithOptimisticLock(userWallet, newBalance, null);
+        String lockKey = ConstantUtil.WalletBalanceLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+                    BigDecimal balance= userWallet.getBlockedFunds().subtract(amount);
+                    //钱包余额小于订单需要冻结的金额
+                    if(balance.compareTo(BigDecimal.ZERO) < 0){
+                        throw new ServiceException(MessageUtils.message("no.wallet.blockamount.jd.exception.message"));
+                    }
+                    // 3. 更新余额
+                    BigDecimal newBalance = userWallet.getBlockedFunds().subtract(amount);
+
+                    // 4. 乐观锁更新钱包
+                    LambdaUpdateWrapper<UserWallet> updateQuery = new LambdaUpdateWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+                    userWallet.setBlockedFunds(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    createUserBill(userId,ddId,"5", amount,newBalance,user.getUserType(),"release blocked founds",null);
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
+        }
     }
 
     /**
-     * 执行余额退回
+     * 回滚外层事务
+     * @param userId
+     * @param amount
+     * @param ddId
      */
-    private void executeBalanceReturn(UserWallet userWallet, BigDecimal amount, String ddId) {
-        // 计算新的余额
-        BigDecimal currentBalance = userWallet.getBalanceWallet() != null ? userWallet.getBalanceWallet() : BigDecimal.ZERO;
-        BigDecimal newBalance = currentBalance.add(amount);
-
-        // 先创建余额流水记录
-        createTransaction(userWallet.getUserId(), amount, newBalance, ddId, "1");
-
-        // 乐观锁更新钱包
-        updateWalletWithOptimisticLock(userWallet, null, newBalance);
+    @Transactional(rollbackFor = Exception.class)
+    public void addBlockFundsBackTransaction(Long userId, BigDecimal amount,String ddId) {
+        addBlockedFundsDetail(userId,amount,ddId);
     }
 
-    /**
-     * 使用乐观锁更新钱包
-     */
-    private void updateWalletWithOptimisticLock(UserWallet userWallet, BigDecimal newPointsBalance, BigDecimal newBalanceAmount) {
-        LambdaQueryWrapper<UserWallet> updateQuery = new LambdaQueryWrapper<>();
-        updateQuery.eq(UserWallet::getUserId, userWallet.getUserId())
-                .eq(UserWallet::getVersion, userWallet.getVersion());
-
-        if (newPointsBalance != null) {
-            userWallet.setPointsWallet(newPointsBalance);
+    private void addBlockedFundsDetail(Long userId, BigDecimal amount,String ddId) {
+        // 1. 参数校验
+        if (userId == null || amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException(MessageUtils.message("no.wallet.common.cs.error"));
         }
-        if (newBalanceAmount != null) {
-            userWallet.setBalanceWallet(newBalanceAmount);
+        InfoUser user=userService.getById(userId);
+        if(user==null){
+            throw new ServiceException(MessageUtils.message("no.wallet.noexist.userinfo"));
         }
-        userWallet.setVersion(userWallet.getVersion() + 1);
 
-        boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
-        if (!updateSuccess) {
-            throw new ConcurrentUpdateException("钱包更新冲突,请重试,用户ID: " + userWallet.getUserId());
+        String lockKey = ConstantUtil.WalletBalanceLock + userId;
+        RLock lock = redissonClient.getLock(lockKey);
+
+        try {
+            // 尝试获取锁
+            if (lock.tryLock(LOCK_WAIT_TIME, LOCK_TIMEOUT, TimeUnit.SECONDS)) {
+                try {
+                    // 2. 获取用户钱包
+                    LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
+                    walletQuery.eq(UserWallet::getUserId, userId);
+                    UserWallet userWallet = userWalletService.getOne(walletQuery);
+                    if (userWallet == null) {
+                        throw new ServiceException(MessageUtils.message("no.user.wallet.not.exist"));
+                    }
+                    BigDecimal balance= userWallet.getBalanceWallet().subtract(userWallet.getBlockedFunds()).subtract(amount);
+                    //钱包余额小于订单需要冻结的金额
+                    if(balance.compareTo(BigDecimal.ZERO) < 0){
+                        String message=MessageUtils.message("no.wallet.balance.less.than.order.amount");
+                        message= StrUtil.format(message,amount);
+                        throw new ServiceException(message);
+                    }
+                    // 3. 更新余额
+                    BigDecimal newBalance = userWallet.getBlockedFunds().add(amount);
+
+                    // 4. 乐观锁更新钱包
+                    LambdaUpdateWrapper<UserWallet> updateQuery = new LambdaUpdateWrapper<>();
+                    updateQuery.eq(UserWallet::getUserId, userId)
+                            .eq(UserWallet::getVersion, userWallet.getVersion());
+
+                    userWallet.setBlockedFunds(newBalance);
+                    userWallet.setVersion(userWallet.getVersion() + 1);
+                    boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+                    createUserBill(userId,ddId,"4", amount,newBalance,user.getUserType(),"blocked funds",null);
+                    if (!updateSuccess) {
+                        throw new ServiceException(MessageUtils.message("no.wallet.update.faile"));
+                    }
+                } finally {
+                    lock.unlock();
+                }
+            } else {
+                throw new ServiceException(MessageUtils.message("no.system.busy.try.again"));
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new ServiceException(MessageUtils.message("no.operation.interrupted.try.again"));
         }
     }
 
+
+
+
+
     /**
      * 创建积分流水
      */
-    private void createTransaction(Long userId, BigDecimal change, BigDecimal currentBalance, String ddId, String type) {
-        WalletTransaction pointsTransaction = new WalletTransaction();
-        pointsTransaction.setUserId(userId);
-        pointsTransaction.setChange(change.toString());
-        pointsTransaction.setType(type);
-        pointsTransaction.setCurrentBalance(currentBalance.toString());
+    private void createPointTransaction(Long userid, String pointsChange, String currentPoints, String ddId, String type) {
+        PointsTransaction pointsTransaction = new PointsTransaction();
+        pointsTransaction.setUserId(userid);
+        if (type.equals("1")) {
+            pointsTransaction.setPointsChange("-" + pointsChange);
+            pointsTransaction.setType("1");
+        }
+        if (type.equals("2")) {
+            pointsTransaction.setPointsChange("+" + pointsChange);
+            pointsTransaction.setType("2");
+        }
+        pointsTransaction.setCurrentPoints(currentPoints);
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());
         pointsTransactionService.save(pointsTransaction);
     }
 
+    private void createUserBill(Long userId,String ddId,String type,BigDecimal change,BigDecimal current,String userType,String remark,BigDecimal behalfAmount){
+        try {
+            UserBilling bill=new UserBilling();
+            bill.setUserId(userId);
+            bill.setType(type);
+            bill.setState("0");
+            bill.setUserType(userType);
+            bill.setDdId(ddId);
+            bill.setAmount(change.doubleValue());
+            bill.setWalletBalance(current);
+            bill.setCretim(new Date());
+            bill.setIllustrate(remark);
+            if(behalfAmount!=null){
+                bill.setBehalfAmount(behalfAmount.doubleValue());
+            }
+            billingService.saveOrUpdate(bill);
+        }catch (Exception e){
+            System.out.println(e.getMessage());
+        }
+
+    }
 
+    private void createUserBill(UserBilling bill,BigDecimal current){
+        bill.setWalletBalance(current);
+        billingService.saveOrUpdate(bill);
+    }
 }

+ 145 - 15
ruoyi-admin/src/main/java/com/ruoyi/app/user/InfoUserController.java

@@ -9,11 +9,18 @@ import com.ruoyi.app.utils.UUIDUtil;
 import com.ruoyi.app.utils.trtc.TLSSigAPIv2;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUserDto;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.MessageUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.ip.AddressUtils;
+import com.ruoyi.common.utils.ip.IpUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.*;
 import com.ruoyi.system.domain.vo.UserDTO;
@@ -27,12 +34,14 @@ import com.ruoyi.system.utils.Auth;
 import com.ruoyi.system.utils.JwtUtil;
 import com.ruoyi.system.utils.MobileSMS;
 import com.ruoyi.system.utils.RedisUtils;
+import eu.bitwalker.useragentutils.UserAgent;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
@@ -61,6 +70,8 @@ public class InfoUserController  extends BaseController
     private PosOrderMapper posOrderMapper;
     @Autowired
     private IUserWalletService userWalletService;
+    @Autowired
+    private RedisCache redisCache;
     /**
      * 查询用户信息列表
      */
@@ -186,8 +197,11 @@ public class InfoUserController  extends BaseController
                 user.setAuditStatus("0");
                 user.setMycode(uuid.get8UUID());
                 user.setStatus("0");
-//                user.setCid(userDTO.getCid());
-                return toAjax(infoUserService.insertInfoUser(user));
+                user.setCid(userDTO.getCid());
+                int result = infoUserService.insertInfoUser(user);
+                InfoUser infoUser = infoUserService.getinfouserName(userDTO.getUserName());
+                createUserWallet(infoUser.getUserId());
+                return toAjax(result);
 
             }else {
                 return error(MessageUtils.message("no.user.jcaptcha.error"));
@@ -203,8 +217,11 @@ public class InfoUserController  extends BaseController
                 user.setAuditStatus("0");
                 user.setMycode(uuid.get8UUID());
                 user.setStatus("0");
-//                user.setCid(userDTO.getCid());
-                return toAjax(infoUserService.insertInfoUser(user));
+                user.setCid(userDTO.getCid());
+                int result = infoUserService.insertInfoUser(user);
+                InfoUser infoUser = infoUserService.getinfouserName(userDTO.getUserName());
+                createUserWallet(infoUser.getUserId());
+                return toAjax(result);
 
             }else {
                 return error(MessageUtils.message("no.user.jcaptcha.error"));
@@ -237,7 +254,10 @@ public class InfoUserController  extends BaseController
                 user.setMycode(uuid.get8UUID());
                 user.setStatus("0");
                 user.setCid(userDTO.getCid());
-                return toAjax(infoUserService.insertInfoUser(user));
+                int result = infoUserService.insertInfoUser(user);
+                InfoUser infoUser = infoUserService.getinfouserName(userDTO.getUserName());
+                createUserWallet(infoUser.getUserId());
+                return toAjax(result);
 
             }else {
                 return error(MessageUtils.message("no.user.jcaptcha.error"));
@@ -254,8 +274,10 @@ public class InfoUserController  extends BaseController
                 user.setMycode(uuid.get8UUID());
                 user.setStatus("0");
                 user.setCid(userDTO.getCid());
-                return toAjax(infoUserService.insertInfoUser(user));
-
+                int result = infoUserService.insertInfoUser(user);
+                InfoUser infoUser = infoUserService.getinfouserName(userDTO.getUserName());
+                createUserWallet(infoUser.getUserId());
+                return toAjax(result);
             }else {
                 return error(MessageUtils.message("no.user.jcaptcha.error"));
             }
@@ -293,7 +315,20 @@ public class InfoUserController  extends BaseController
                         infoUserService.saveOrUpdate(info);
                         user.setCid(userDTO.getCid());
                     }
-                    String token = tokn.setToken(String.valueOf(user.getUserId()),user.getUserName());
+                    // 根据客户端类型(APP端或PC端)选择对应的 token key
+                    String tokenKey = getTokenKeyByClientType();
+                    //app端
+                    if (tokenKey.equals(CacheConstants.SH_APP_TOKEN_KEY)) {
+                        // 删除该用户同类型客户端的旧 token
+                        redisCache.deleteKeys(tokenKey + user.getUserId() + ":" + "*");
+                    }
+
+                    // 补充登录用户信息
+                    LoginUserDto userDto = new LoginUserDto();
+                    userDto.setUserId(user.getUserId());
+                    userDto.setUserName(user.getUserName());
+                    fillLoginUserInfo(userDto);
+                    String token = JwtUtil.setToken(tokenKey, userDto);
                     return success(MessageUtils.message("no.user.login.success"), user,token);
                 }else {
                     return error(MessageUtils.message("no.user.password.error"));
@@ -337,7 +372,14 @@ public class InfoUserController  extends BaseController
                     };
                     //返回离线标识状态为在线
                     user.setOffline("0");
-                    String token = tokn.setToken(String.valueOf(user.getUserId()),user.getUserName());
+                    redisCache.deleteKeys(CacheConstants.QS_TOKEN_KEY + user.getUserId() + ":" + "*");
+
+                    // 补充登录用户信息
+                    LoginUserDto userDto = new LoginUserDto();
+                    userDto.setUserId(user.getUserId());
+                    userDto.setUserName(user.getUserName());
+                    fillLoginUserInfo(userDto);
+                    String token = JwtUtil.setToken(CacheConstants.QS_TOKEN_KEY, userDto);
                     return success(MessageUtils.message("no.user.login.success"), user,token);
                 }else {
                     return error(MessageUtils.message("no.user.password.error"));
@@ -349,6 +391,65 @@ public class InfoUserController  extends BaseController
         }
     }
 
+    /**
+     * 填充登录用户信息(IP地址、登录地点、浏览器、操作系统、登录时间等)
+     *
+     * @param userDto 登录用户DTO
+     * @return 填充后的登录用户DTO
+     */
+    private LoginUserDto fillLoginUserInfo(LoginUserDto userDto) {
+        // 获取IP地址
+        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
+        userDto.setIpaddr(ip);
+        // 获取登录地点
+        userDto.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
+        // 获取浏览器和操作系统信息
+        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+        userDto.setBrowser(userAgent.getBrowser().getName());
+        userDto.setOs(userAgent.getOperatingSystem().getName());
+        // 设置登录时间
+        userDto.setLoginTime(System.currentTimeMillis());
+        return userDto;
+    }
+
+    /**
+     * 判断客户端类型(APP端还是PC端)
+     * 通过 User-Agent 判断:包含 Mobile、Android、iPhone、iPad 等关键词则为 APP 端
+     *
+     * @return true 表示 APP 端,false 表示 PC 端
+     */
+    private boolean isAppClient() {
+        String userAgent = ServletUtils.getRequest().getHeader("User-Agent");
+        if (userAgent == null || userAgent.isEmpty()) {
+            // 如果没有 User-Agent,默认认为是 PC 端
+            return false;
+        }
+        String ua = userAgent.toLowerCase();
+        // 判断是否为移动设备(APP端)
+        return ua.contains("mobile") || ua.contains("android") || ua.contains("iphone")
+                || ua.contains("ipad") || ua.contains("ipod") || ua.contains("windows phone");
+    }
+
+    /**
+     * 根据客户端类型获取对应的 token key
+     *
+     * @return token key
+     */
+    private String getTokenKeyByClientType() {
+        return isAppClient() ? CacheConstants.SH_APP_TOKEN_KEY : CacheConstants.SH_PC_TOKEN_KEY;
+    }
+
+
+    private void createUserWallet(Long userId) {
+        try {
+            userWalletService.createUserWallet(userId);
+        } catch (Exception e) {
+            logger.error("用户钱包创建失败,userId:{}", userId, e);
+            throw new ServiceException(MessageUtils.message("no.user.login.exist"));
+        }
+
+    }
+
     /**
      * 骑手切换离线状态(0:在线,1:离线)
      * @param token
@@ -601,7 +702,14 @@ public class InfoUserController  extends BaseController
                     info.setMycode(uuid.get8UUID());
                     infoUserService.saveOrUpdate(info);
                     InfoUser inus = infoUserService.getuser(userDTO.getPhone());
-                    String token = tokn.setToken(String.valueOf(inus.getUserId()),inus.getUserName());
+                    createUserWallet(inus.getUserId());
+                    redisCache.deleteKeys(CacheConstants.USER_TOKEN_KEY + inus.getUserId() + ":" + "*");
+                    // 补充登录用户信息
+                    LoginUserDto userDto = new LoginUserDto();
+                    userDto.setUserId(inus.getUserId());
+                    userDto.setUserName(inus.getPhone());
+                    fillLoginUserInfo(userDto);
+                    String token = JwtUtil.setToken(CacheConstants.USER_TOKEN_KEY, userDto);
                     return success(MessageUtils.message("no.user.login.success"), inus,token);
                 }else {
                     QueryWrapper<InfoUser> query = new QueryWrapper<>();
@@ -627,7 +735,13 @@ public class InfoUserController  extends BaseController
                                 user.setVip(vipUser.getYxtim());
                             }
                         }
-                        String token = tokn.setToken(String.valueOf(user.getUserId()),user.getUserName());
+                        redisCache.deleteKeys(CacheConstants.USER_TOKEN_KEY + user.getUserId() + ":" + "*");
+                        // 补充登录用户信息
+                        LoginUserDto userDto = new LoginUserDto();
+                        userDto.setUserId(user.getUserId());
+                        userDto.setUserName(user.getPhone());
+                        fillLoginUserInfo(userDto);
+                        String token = JwtUtil.setToken(CacheConstants.USER_TOKEN_KEY, userDto);
                         return success(MessageUtils.message("no.user.login.success"), user,token);
                     }
                 }
@@ -648,7 +762,14 @@ public class InfoUserController  extends BaseController
                     info.setMycode(uuid.get8UUID());
                     infoUserService.saveOrUpdate(info);
                     InfoUser inus = infoUserService.getuser(userDTO.getPhone());
-                    String token = tokn.setToken(String.valueOf(inus.getUserId()),inus.getUserName());
+                    createUserWallet(inus.getUserId());
+                    redisCache.deleteKeys(CacheConstants.USER_TOKEN_KEY + inus.getUserId() + ":" + "*");
+                    // 补充登录用户信息
+                    LoginUserDto userDto = new LoginUserDto();
+                    userDto.setUserId(inus.getUserId());
+                    userDto.setUserName(inus.getPhone());
+                    fillLoginUserInfo(userDto);
+                    String token = JwtUtil.setToken(CacheConstants.USER_TOKEN_KEY, userDto);
                     return success(MessageUtils.message("no.user.login.success"),inus,token);
                 }else {
                     QueryWrapper<InfoUser> query = new QueryWrapper<>();
@@ -674,7 +795,13 @@ public class InfoUserController  extends BaseController
                                 user.setVip(vipUser.getYxtim());
                             }
                         }
-                        String token = tokn.setToken(String.valueOf(user.getUserId()),user.getUserName());
+                        redisCache.deleteKeys(CacheConstants.USER_TOKEN_KEY + user.getUserId() + ":" + "*");
+                        // 补充登录用户信息
+                        LoginUserDto userDto = new LoginUserDto();
+                        userDto.setUserId(user.getUserId());
+                        userDto.setUserName(user.getPhone());
+                        fillLoginUserInfo(userDto);
+                        String token = JwtUtil.setToken(CacheConstants.USER_TOKEN_KEY, userDto);
                         return success(MessageUtils.message("no.user.login.success"), user, token);
                     }
                 }
@@ -752,6 +879,7 @@ public class InfoUserController  extends BaseController
     @PreAuthorize("@ss.hasPermi('infouser:user:add')")
     @Log(title = "用户信息", businessType = BusinessType.INSERT)
     @PostMapping
+    @Transactional(rollbackFor=Exception.class)
     public AjaxResult add(@RequestBody InfoUser infoUser)
     {
         if (infoUserService.getinfouserName(infoUser.getUserName())!=null)
@@ -766,7 +894,9 @@ public class InfoUserController  extends BaseController
         infoUser.setMycode(uuid.get8UUID());
         infoUser.setStatus("0");
         System.out.println("加密:"+infoUser.getPassword());
-        return toAjax(infoUserService.insertInfoUser(infoUser));
+        int result = infoUserService.insertInfoUser(infoUser);
+        createUserWallet(infoUser.getUserId());
+        return toAjax(result);
     }
 
     /**

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/user/PosMarginController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.user;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -28,7 +28,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * marginController
- * 
+ *
  * @author ruoyi
  * @date 2023-08-02
  */

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/RiderPositionController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.user;
 
 import java.util.List;
 import java.util.Objects;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson2.JSON;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/SysFeedbackController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.user;
 
 import java.text.SimpleDateFormat;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/SysHelpController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.user;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.Anonymous;
 import org.springframework.security.access.prepost.PreAuthorize;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/UserFootprintController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.user;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/UserMarginController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.user;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/user/UserPointController.java

@@ -54,9 +54,9 @@ public class UserPointController extends BaseController {
         if (pointControl.getOrderUseEnable().equals(1L)) {
             UserWallet wallet = userWalletService.getOne(new LambdaQueryWrapper<UserWallet>().eq(UserWallet::getUserId, Long.valueOf(uid)));
             if(wallet!=null) {
-                BigDecimal point = wallet.getPointsWallet();
+                Long point = wallet.getPointsWallet();
                 PointOutput pointOutput = new PointOutput();
-                pointOutput.setPoints(point);
+                pointOutput.setPoints(BigDecimal.valueOf(point));
                 pointOutput.setBl(pointControl.getVndPerpoint());
                 return R.ok(pointOutput);
             }else{

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/user/VideoCallController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.user;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/utils/AppVersionController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.utils;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.common.annotation.Anonymous;

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/utils/ConstantUtil.java

@@ -0,0 +1,13 @@
+package com.ruoyi.app.utils;
+
+public  class ConstantUtil {
+    // 锁超时时间(秒)
+    public static final int LOCK_TIMEOUT = 20;
+    // 锁等待时间(秒)
+    public static final int LOCK_WAIT_TIME = 10;
+
+    public static final String WalletPointLock = "pointwallet:lock:";
+    public static final String WalletBalanceLock = "balancewallet:lock:";
+    public static final String WithDrawalLock = "withDrawal:lock:"; //提现锁
+    public static final String BlockedWalletLock="blockedwallet:lock:"; //冻结金额锁
+}

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/utils/GetVipqy.java

@@ -7,7 +7,7 @@ import com.ruoyi.system.service.IPosOrderService;
 import com.ruoyi.system.service.IVipQuanyiService;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
+import jakarta.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/utils/IpUtils.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.utils;
 import lombok.extern.slf4j.Slf4j;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.net.*;
 import java.util.Enumeration;
 

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/utils/PayPush.java

@@ -15,7 +15,7 @@ public class PayPush {
     }
     //骑手端推送
     public void qspush(String cid,String title, String content, String body){
-        String url = "https://fc-mp-20ccbe79-10f8-41d7-a06c-c42581f351c1.next.bspapp.com/ptpush?cid="+cid+
+        String url = "https://fc-mp-20ccbe79-10f8-41d7-a06c-c42581f351c1.next.bspapp.com/msdqspush?cid="+cid+
                 "&title="+title+"&content="+content+"&payload="+body+"&sound=pushsound.caf";
         String res="";
         res = HttpUtil.get(url);
@@ -25,7 +25,7 @@ public class PayPush {
     //商家端推送
     public void shpush(String cid,String title, String content, String body){
         System.out.println("商家cid:"+cid);
-        String url = "https://fc-mp-20ccbe79-10f8-41d7-a06c-c42581f351c1.next.bspapp.com/sjpush?cid="+cid+
+        String url = "https://fc-mp-20ccbe79-10f8-41d7-a06c-c42581f351c1.next.bspapp.com/msdsjpush?cid="+cid+
                 "&title="+title+"&content="+content+"&payload="+body;
         String res="";
         res = HttpUtil.get(url);

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/utils/VNPay.java

@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.Random;
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 
 /**
  *

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipMembershipController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.app.vip;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipQuanyiController.java

@@ -3,7 +3,7 @@ package com.ruoyi.app.vip;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipSjQuanyiController.java

@@ -20,7 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/app/vip/VipUserController.java

@@ -2,7 +2,7 @@ package com.ruoyi.app.vip;
 
 import java.text.ParseException;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -30,7 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * viplistController
- * 
+ *
  * @author ruoyi
  * @date 2023-05-24
  */

+ 4 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java

@@ -3,9 +3,9 @@ package com.ruoyi.web.controller.common;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
-import javax.annotation.Resource;
+import jakarta.annotation.Resource;
 import javax.imageio.ImageIO;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.FastByteArrayOutputStream;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -22,7 +22,7 @@ import com.ruoyi.system.service.ISysConfigService;
 
 /**
  * 验证码操作处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
@@ -36,7 +36,7 @@ public class CaptchaController
 
     @Autowired
     private RedisCache redisCache;
-    
+
     @Autowired
     private ISysConfigService configService;
     /**

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -2,8 +2,8 @@ package com.ruoyi.web.controller.common;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.utils.MessageUtils;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.monitor;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.monitor;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/AppDownloadController.java

@@ -1,6 +1,6 @@
 package com.ruoyi.web.controller.system;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.annotation.Anonymous;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NightMarketController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 9 - 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PointTransactionController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,7 +16,7 @@ import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.system.domain.WalletTransaction;
+import com.ruoyi.system.domain.PointsTransaction;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -39,10 +39,10 @@ public class PointTransactionController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:list')")
     @GetMapping("/list")
-    public TableDataInfo list(WalletTransaction pointsTransaction)
+    public TableDataInfo list(PointsTransaction pointsTransaction)
     {
         startPage();
-        List<WalletTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
+        List<PointsTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
         return getDataTable(list);
     }
 
@@ -52,10 +52,10 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:export')")
     @Log(title = "积分流水", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, WalletTransaction pointsTransaction)
+    public void export(HttpServletResponse response, PointsTransaction pointsTransaction)
     {
-        List<WalletTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
-        ExcelUtil<WalletTransaction> util = new ExcelUtil<WalletTransaction>(WalletTransaction.class);
+        List<PointsTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
+        ExcelUtil<PointsTransaction> util = new ExcelUtil<PointsTransaction>(PointsTransaction.class);
         util.exportExcel(response, list, "积分流水数据");
     }
 
@@ -75,7 +75,7 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:add')")
     @Log(title = "积分流水", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody WalletTransaction pointsTransaction)
+    public AjaxResult add(@RequestBody PointsTransaction pointsTransaction)
     {
         return toAjax(pointsTransactionService.insertPointsTransaction(pointsTransaction));
     }
@@ -86,7 +86,7 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:edit')")
     @Log(title = "积分流水", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody WalletTransaction pointsTransaction)
+    public AjaxResult edit(@RequestBody PointsTransaction pointsTransaction)
     {
         return toAjax(pointsTransactionService.updatePointsTransaction(pointsTransaction));
     }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PushMessageController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysAdsController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java

@@ -2,7 +2,7 @@ package com.ruoyi.web.controller.system;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -24,7 +24,7 @@ import com.ruoyi.system.service.ISysDictTypeService;
 
 /**
  * 数据字典信息
- * 
+ *
  * @author ruoyi
  */
 @RestController

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPointControlController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPointTierController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 import java.util.Date;
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -1,7 +1,7 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.List;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -2,7 +2,7 @@ package com.ruoyi.web.controller.system;
 
 import java.util.List;
 import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,7 +34,7 @@ import com.ruoyi.system.service.ISysUserService;
 
 /**
  * 用户信息
- * 
+ *
  * @author ruoyi
  */
 @RestController

+ 28 - 25
ruoyi-admin/src/main/resources/application.yml

@@ -73,27 +73,28 @@ spring:
       # 热部署开关
       enabled: true
   # redis 配置
-  redis:
-    # 地址
-    host: localhost
-    # 端口,默认为6379
-    port: 6379
-    # 数据库索引
-    database: 0
-    # 密码
-    password:
-    # 连接超时时间
-    timeout: 10s
-    lettuce:
-      pool:
-        # 连接池中的最小空闲连接
-        min-idle: 0
-        # 连接池中的最大空闲连接
-        max-idle: 8
-        # 连接池的最大数据库连接数
-        max-active: 8
-        # #连接池最大阻塞等待时间(使用负值表示没有限制)
-        max-wait: -1ms
+  data:
+    redis:
+      # 地址
+      host: localhost
+      # 端口,默认为6379
+      port: 6379
+      # 数据库索引
+      database: 0
+      # 密码
+      password:
+      # 连接超时时间
+      timeout: 10s
+      lettuce:
+        pool:
+          # 连接池中的最小空闲连接
+          min-idle: 0
+          # 连接池中的最大空闲连接
+          max-idle: 8
+          # 连接池的最大数据库连接数
+          max-active: 8
+          # #连接池最大阻塞等待时间(使用负值表示没有限制)
+          max-wait: -1ms
   redisson:
     address: redis://127.0.0.1:6379
     # password: 不要写这一行
@@ -109,10 +110,12 @@ token:
 
 # MyBatis配置
 mybatis-plus:
-  mapper-locations: classpath*:mapper/**/*Mapper.xml
-  type-aliases-package: com.ruoyi.**.domain
-  configuration:
-    map-underscore-to-camel-case: true
+  # 搜索指定包别名
+  typeAliasesPackage: com.ruoyi.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  configLocation: classpath:mybatis/mybatis-config.xml
 
 # PageHelper分页插件
 pagehelper:

+ 75 - 10
ruoyi-common/pom.xml

@@ -36,9 +36,12 @@
         </dependency>
 
         <!-- pagehelper 分页插件 -->
+        <!-- PageHelper 6.1.0 (pagehelper-spring-boot-starter 2.1.0) 支持 Spring Boot 3 -->
+        <!-- PageHelper 6.1.0 默认使用 jsqlparser 4.7,与 MyBatis-Plus 统一使用 4.7 -->
         <dependency>
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>${pagehelper.boot.version}</version>
         </dependency>
 
         <!-- 自定义验证注解 -->
@@ -60,15 +63,15 @@
         </dependency>
 
         <!-- 动态数据源 -->
-		<dependency>
-			<groupId>com.baomidou</groupId>
-			<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-			<version>3.5.2</version>
-		</dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.5.2</version>
+        </dependency>
         <dependency>
             <groupId>org.redisson</groupId>
             <artifactId>redisson-spring-boot-starter</artifactId>
-            <version>2.13.0</version>
+            <version>3.24.3</version>
         </dependency>
         <!-- 阿里JSON解析器 -->
         <dependency>
@@ -126,8 +129,14 @@
 
         <!-- servlet包 -->
         <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>javax.servlet-api</artifactId>
+            <groupId>jakarta.servlet</groupId>
+            <artifactId>jakarta.servlet-api</artifactId>
+        </dependency>
+
+        <!-- jakarta.annotation API -->
+        <dependency>
+            <groupId>jakarta.annotation</groupId>
+            <artifactId>jakarta.annotation-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>
@@ -139,15 +148,71 @@
             <artifactId>persistence-api</artifactId>
             <version>1.0.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.mybatis</groupId>
+            <artifactId>mybatis</artifactId>
+            <version>3.5.16</version>
+        </dependency>
+
         <dependency>
             <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>3.3.1.tmp</version>
+            <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
+            <version>3.5.10</version>
+            <exclusions>
+                <!-- 排除 MyBatis-Plus 的 jsqlparser,使用 PageHelper 需要的版本 -->
+                <exclusion>
+                    <groupId>com.github.jsqlparser</groupId>
+                    <artifactId>jsqlparser</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-jsqlparser</artifactId>
+            <version>3.5.10</version>
+            <exclusions>
+                <!-- 排除 MyBatis-Plus 的 jsqlparser 5.1,统一使用 jsqlparser 4.7 -->
+                <exclusion>
+                    <groupId>com.github.jsqlparser</groupId>
+                    <artifactId>jsqlparser</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- 统一使用 jsqlparser 4.7(PageHelper 6.1.0 支持的最高版本) -->
+        <!-- PageHelper 6.1.0 不支持 jsqlparser 5.1,MyBatis-Plus 3.5.10 可以使用 4.7 -->
+        <dependency>
+            <groupId>com.github.jsqlparser</groupId>
+            <artifactId>jsqlparser</artifactId>
+            <version>4.7</version>
         </dependency>
         <dependency>
             <groupId>io.minio</groupId>
             <artifactId>minio</artifactId>
             <version>8.2.1</version>
         </dependency>
+        <dependency>
+            <groupId>com.google.firebase</groupId>
+            <artifactId>firebase-admin</artifactId>
+            <version>9.7.0</version>
+        </dependency>
+        <!-- Apache HttpClient 5 (Firebase Admin SDK 9.7.0 所需依赖) -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+        <!-- Apache HttpCore 5 (HttpClient 5 的核心依赖,包含 reactor) -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.core5</groupId>
+            <artifactId>httpcore5</artifactId>
+            <version>5.2.1</version>
+        </dependency>
+        <!-- Apache HttpCore 5 HTTP/2 支持 -->
+        <dependency>
+            <groupId>org.apache.httpcomponents.core5</groupId>
+            <artifactId>httpcore5-h2</artifactId>
+            <version>5.2.1</version>
+        </dependency>
     </dependencies>
 </project>

+ 21 - 2
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java

@@ -2,16 +2,35 @@ package com.ruoyi.common.constant;
 
 /**
  * 缓存的key 常量
- * 
+ *
  * @author ruoyi
  */
 public class CacheConstants
 {
     /**
-     * 登录用户 redis key
+     * 登录用户 redis key(后台用户)
      */
     public static final String LOGIN_TOKEN_KEY = "login_tokens:";
 
+    private static  final String QTW_TOKEN_KEY="qtw_tokens:";
+
+    /**
+     * 外卖骑手 redis key
+     */
+    public  static final String QS_TOKEN_KEY="qtw_tokens:qs:";
+    /**
+     * 外卖用户 redis key
+     */
+    public static  final String USER_TOKEN_KEY="qtw_tokens:user:";
+    /**
+     * 外卖商家app端 redis key
+     */
+    public static  final String SH_APP_TOKEN_KEY="qtw_tokens:sh:app:";
+    /**
+     * 外卖商家pc端 redis key
+     */
+    public static  final String SH_PC_TOKEN_KEY="qtw_tokens:sh:pc:";
+
     /**
      * 验证码 redis key
      */

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@@ -4,7 +4,7 @@ import io.jsonwebtoken.Claims;
 
 /**
  * 通用常量信息
- * 
+ *
  * @author ruoyi
  */
 public class Constants
@@ -63,7 +63,7 @@ public class Constants
      * 登录失败
      */
     public static final String LOGIN_FAIL = "Error";
- 
+
     /**
      * 验证码有效期(分钟)
      */

+ 6 - 6
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java

@@ -2,17 +2,17 @@ package com.ruoyi.common.core.domain.entity;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.validation.constraints.Email;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 部门表 sys_dept
- * 
+ *
  * @author ruoyi
  */
 public class SysDept extends BaseEntity
@@ -51,7 +51,7 @@ public class SysDept extends BaseEntity
 
     /** 父部门名称 */
     private String parentName;
-    
+
     /** 子部门 */
     private List<SysDept> children = new ArrayList<SysDept>();
 

+ 4 - 4
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java

@@ -1,7 +1,7 @@
 package com.ruoyi.common.core.domain.entity;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 字典数据表 sys_dict_data
- * 
+ *
  * @author ruoyi
  */
 public class SysDictData extends BaseEntity
@@ -153,7 +153,7 @@ public class SysDictData extends BaseEntity
     {
         this.status = status;
     }
-    
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 5 - 5
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java

@@ -1,8 +1,8 @@
 package com.ruoyi.common.core.domain.entity;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 字典类型表 sys_dict_type
- * 
+ *
  * @author ruoyi
  */
 public class SysDictType extends BaseEntity
@@ -78,7 +78,7 @@ public class SysDictType extends BaseEntity
     {
         this.status = status;
     }
-    
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 6 - 6
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java

@@ -2,16 +2,16 @@ package com.ruoyi.common.core.domain.entity;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 菜单权限表 sys_menu
- * 
+ *
  * @author ruoyi
  */
 public class SysMenu extends BaseEntity
@@ -53,7 +53,7 @@ public class SysMenu extends BaseEntity
 
     /** 显示状态(0显示 1隐藏) */
     private String visible;
-    
+
     /** 菜单状态(0正常 1停用) */
     private String status;
 
@@ -232,7 +232,7 @@ public class SysMenu extends BaseEntity
     {
         this.children = children;
     }
-    
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 4 - 4
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java

@@ -1,9 +1,9 @@
 package com.ruoyi.common.core.domain.entity;
 
 import java.util.Set;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -12,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 角色表 sys_role
- * 
+ *
  * @author ruoyi
  */
 public class SysRole extends BaseEntity

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -2,7 +2,7 @@ package com.ruoyi.common.core.domain.entity;
 
 import java.util.Date;
 import java.util.List;
-import javax.validation.constraints.*;
+import jakarta.validation.constraints.*;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -14,7 +14,7 @@ import com.ruoyi.common.xss.Xss;
 
 /**
  * 用户对象 sys_user
- * 
+ *
  * @author ruoyi
  */
 public class SysUser extends BaseEntity

+ 36 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUserDto.java

@@ -0,0 +1,36 @@
+package com.ruoyi.common.core.domain.model;
+
+import lombok.Data;
+
+/**
+ * 登录信息
+ * **/
+@Data
+public class LoginUserDto {
+    /** 用户ID */
+    private Long userId;
+    
+    /** 用户名称 */
+    private String userName;
+    
+    /** 会话编号(token ID) */
+    private String tokenId;
+    
+    /** 部门名称 */
+    private String deptName;
+    
+    /** 登录IP地址 */
+    private String ipaddr;
+    
+    /** 登录地点 */
+    private String loginLocation;
+    
+    /** 浏览器类型 */
+    private String browser;
+    
+    /** 操作系统 */
+    private String os;
+    
+    /** 登录时间 */
+    private Long loginTime;
+}

+ 13 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java

@@ -118,6 +118,19 @@ public class RedisCache
         return redisTemplate.delete(key);
     }
 
+    /**
+     * 删除包含前缀的key
+     * @param pattern 匹配模式,例如 "login_tokens:*" 或 "sys_config:*"
+     * @return 删除的key数量,如果为0表示没有匹配的key或删除失败
+     */
+    public long deleteKeys(final String pattern){
+        Collection<String> keys = redisTemplate.keys(pattern);
+        if (keys != null && !keys.isEmpty()) {
+            return redisTemplate.delete(keys);
+        }
+        return 0;
+    }
+
     /**
      * 删除集合对象
      *

+ 8 - 8
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java

@@ -1,19 +1,19 @@
 package com.ruoyi.common.filter;
 
 import java.io.IOException;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.FilterConfig;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
 import org.springframework.http.MediaType;
 import com.ruoyi.common.utils.StringUtils;
 
 /**
  * Repeatable 过滤器
- * 
+ *
  * @author ruoyi
  */
 public class RepeatableFilter implements Filter

+ 6 - 6
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java

@@ -4,17 +4,17 @@ import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import javax.servlet.ReadListener;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
+import jakarta.servlet.ReadListener;
+import jakarta.servlet.ServletInputStream;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequestWrapper;
 import com.ruoyi.common.utils.http.HttpHelper;
 import com.ruoyi.common.constant.Constants;
 
 /**
  * 构建可重复读取inputStream的request
- * 
+ *
  * @author ruoyi
  */
 public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper

+ 10 - 10
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java

@@ -3,20 +3,20 @@ package com.ruoyi.common.filter;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.FilterConfig;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.enums.HttpMethod;
 
 /**
  * 防止XSS攻击的过滤器
- * 
+ *
  * @author ruoyi
  */
 public class XssFilter implements Filter
@@ -72,4 +72,4 @@ public class XssFilter implements Filter
     {
 
     }
-}
+}

+ 7 - 7
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java

@@ -2,10 +2,10 @@ package com.ruoyi.common.filter;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import javax.servlet.ReadListener;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
+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;
@@ -14,7 +14,7 @@ import com.ruoyi.common.utils.html.EscapeUtil;
 
 /**
  * XSS过滤处理
- * 
+ *
  * @author ruoyi
  */
 public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
@@ -100,7 +100,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
 
     /**
      * 是否是Json请求
-     * 
+     *
      * @param request
      */
     public boolean isJsonRequest()
@@ -108,4 +108,4 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
         String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
         return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
     }
-}
+}

+ 9 - 9
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java

@@ -7,10 +7,10 @@ import java.net.URLEncoder;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
 import org.springframework.web.context.request.RequestAttributes;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -19,7 +19,7 @@ import com.ruoyi.common.core.text.Convert;
 
 /**
  * 客户端工具类
- * 
+ *
  * @author ruoyi
  */
 public class ServletUtils
@@ -132,7 +132,7 @@ public class ServletUtils
 
     /**
      * 将字符串渲染到客户端
-     * 
+     *
      * @param response 渲染对象
      * @param string 待渲染的字符串
      */
@@ -153,7 +153,7 @@ public class ServletUtils
 
     /**
      * 是否是Ajax异步请求
-     * 
+     *
      * @param request
      */
     public static boolean isAjaxRequest(HttpServletRequest request)
@@ -182,7 +182,7 @@ public class ServletUtils
 
     /**
      * 内容编码
-     * 
+     *
      * @param str 内容
      * @return 编码后的内容
      */
@@ -200,7 +200,7 @@ public class ServletUtils
 
     /**
      * 内容解码
-     * 
+     *
      * @param str 内容
      * @return 解码后的内容
      */

+ 4 - 4
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java

@@ -1,13 +1,13 @@
 package com.ruoyi.common.utils.bean;
 
 import java.util.Set;
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.validation.Validator;
+import jakarta.validation.ConstraintViolation;
+import jakarta.validation.ConstraintViolationException;
+import jakarta.validation.Validator;
 
 /**
  * bean对象属性验证
- * 
+ *
  * @author ruoyi
  */
 public class BeanValidators

+ 11 - 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java

@@ -9,8 +9,8 @@ import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import com.ruoyi.common.config.RuoYiConfig;
@@ -21,7 +21,7 @@ import org.apache.commons.io.FilenameUtils;
 
 /**
  * 文件处理工具类
- * 
+ *
  * @author ruoyi
  */
 public class FileUtils
@@ -30,7 +30,7 @@ public class FileUtils
 
     /**
      * 输出指定文件的byte数组
-     * 
+     *
      * @param filePath 文件路径
      * @param os 输出流
      * @return
@@ -105,7 +105,7 @@ public class FileUtils
 
     /**
      * 删除文件
-     * 
+     *
      * @param filePath 文件
      * @return
      */
@@ -123,7 +123,7 @@ public class FileUtils
 
     /**
      * 文件名称验证
-     * 
+     *
      * @param filename 文件名称
      * @return true 正常 false 非法
      */
@@ -134,7 +134,7 @@ public class FileUtils
 
     /**
      * 检查文件是否可下载
-     * 
+     *
      * @param resource 需要下载的文件
      * @return true 正常 false 非法
      */
@@ -158,7 +158,7 @@ public class FileUtils
 
     /**
      * 下载文件名重新编码
-     * 
+     *
      * @param request 请求对象
      * @param fileName 文件名
      * @return 编码后的文件名
@@ -228,7 +228,7 @@ public class FileUtils
 
     /**
      * 获取图像后缀
-     * 
+     *
      * @param photoByte 图像数据
      * @return 后缀名
      */
@@ -257,7 +257,7 @@ public class FileUtils
 
     /**
      * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png
-     * 
+     *
      * @param fileName 路径名称
      * @return 没有文件路径的名称
      */
@@ -275,7 +275,7 @@ public class FileUtils
 
     /**
      * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi
-     * 
+     *
      * @param fileName 路径名称
      * @return 没有文件路径和后缀的名称
      */

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java

@@ -5,14 +5,14 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
-import javax.servlet.ServletRequest;
+import jakarta.servlet.ServletRequest;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * 通用http工具封装
- * 
+ *
  * @author ruoyi
  */
 public class HttpHelper

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java

@@ -24,7 +24,7 @@ import com.ruoyi.common.utils.StringUtils;
 
 /**
  * 通用http发送方法
- * 
+ *
  * @author ruoyi
  */
 public class HttpUtils
@@ -271,4 +271,4 @@ public class HttpUtils
             return true;
         }
     }
-}
+}

+ 11 - 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java

@@ -2,13 +2,13 @@ package com.ruoyi.common.utils.ip;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
 
 /**
  * 获取IP方法
- * 
+ *
  * @author ruoyi
  */
 public class IpUtils
@@ -22,7 +22,7 @@ public class IpUtils
 
     /**
      * 获取客户端IP
-     * 
+     *
      * @return IP地址
      */
     public static String getIpAddr()
@@ -32,7 +32,7 @@ public class IpUtils
 
     /**
      * 获取客户端IP
-     * 
+     *
      * @param request 请求对象
      * @return IP地址
      */
@@ -70,7 +70,7 @@ public class IpUtils
 
     /**
      * 检查是否为内部IP地址
-     * 
+     *
      * @param ip IP地址
      * @return 结果
      */
@@ -82,7 +82,7 @@ public class IpUtils
 
     /**
      * 检查是否为内部IP地址
-     * 
+     *
      * @param addr byte地址
      * @return 结果
      */
@@ -125,7 +125,7 @@ public class IpUtils
 
     /**
      * 将IPv4地址转换成字节
-     * 
+     *
      * @param text IPv4地址
      * @return byte 字节
      */
@@ -213,7 +213,7 @@ public class IpUtils
 
     /**
      * 获取IP地址
-     * 
+     *
      * @return 本地IP地址
      */
     public static String getHostIp()
@@ -230,7 +230,7 @@ public class IpUtils
 
     /**
      * 获取主机名
-     * 
+     *
      * @return 本地主机名
      */
     public static String getHostName()
@@ -350,7 +350,7 @@ public class IpUtils
 
     /**
      * 校验ip是否符合过滤串规则
-     * 
+     *
      * @param filter 过滤IP列表,支持后缀'*'通配,支持网段如:`10.10.10.1-10.10.10.99`
      * @param ip 校验IP地址
      * @return boolean 结果
@@ -379,4 +379,4 @@ public class IpUtils
         }
         return false;
     }
-}
+}

+ 35 - 35
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@@ -23,7 +23,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import java.util.stream.Collectors;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.RegExUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
@@ -87,7 +87,7 @@ import com.ruoyi.common.utils.reflect.ReflectUtils;
 
 /**
  * Excel相关处理
- * 
+ *
  * @author ruoyi
  */
 public class ExcelUtil<T>
@@ -284,7 +284,7 @@ public class ExcelUtil<T>
 
     /**
      * 对excel表单默认第一个索引名转换成list
-     * 
+     *
      * @param is 输入流
      * @return 转换后集合
      */
@@ -295,7 +295,7 @@ public class ExcelUtil<T>
 
     /**
      * 对excel表单默认第一个索引名转换成list
-     * 
+     *
      * @param is 输入流
      * @param titleNum 标题占用行数
      * @return 转换后集合
@@ -307,7 +307,7 @@ public class ExcelUtil<T>
 
     /**
      * 对excel表单指定表格索引名转换成list
-     * 
+     *
      * @param sheetName 表格索引名
      * @param titleNum 标题占用行数
      * @param is 输入流
@@ -487,7 +487,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
      * @return 结果
@@ -499,7 +499,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
      * @param title 标题
@@ -513,7 +513,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param response 返回数据
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
@@ -526,7 +526,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param response 返回数据
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
@@ -543,7 +543,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @return 结果
      */
@@ -554,7 +554,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @param title 标题
      * @return 结果
@@ -567,7 +567,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @return 结果
      */
@@ -578,7 +578,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @param title 标题
      * @return 结果
@@ -593,7 +593,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @return 结果
      */
     public void exportExcel(HttpServletResponse response)
@@ -615,7 +615,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @return 结果
      */
     public AjaxResult exportExcel()
@@ -683,7 +683,7 @@ public class ExcelUtil<T>
 
     /**
      * 填充excel数据
-     * 
+     *
      * @param index 序号
      * @param row 单元格行
      */
@@ -754,7 +754,7 @@ public class ExcelUtil<T>
 
     /**
      * 创建表格样式
-     * 
+     *
      * @param wb 工作薄对象
      * @return 样式列表
      */
@@ -807,7 +807,7 @@ public class ExcelUtil<T>
 
     /**
      * 根据Excel注解创建表格头样式
-     * 
+     *
      * @param wb 工作薄对象
      * @return 自定义样式列表
      */
@@ -840,7 +840,7 @@ public class ExcelUtil<T>
 
     /**
      * 根据Excel注解创建表格列样式
-     * 
+     *
      * @param wb 工作薄对象
      * @return 自定义样式列表
      */
@@ -902,7 +902,7 @@ public class ExcelUtil<T>
 
     /**
      * 设置单元格信息
-     * 
+     *
      * @param value 单元格值
      * @param attr 注解相关
      * @param cell 单元格信息
@@ -1071,7 +1071,7 @@ public class ExcelUtil<T>
 
     /**
      * 设置 POI XSSFSheet 单元格提示或选择框
-     * 
+     *
      * @param sheet 表单
      * @param textlist 下拉框显示的内容
      * @param promptContent 提示内容
@@ -1108,7 +1108,7 @@ public class ExcelUtil<T>
 
     /**
      * 设置某些列的值只能输入预制的数据,显示下拉框(兼容超出一定数量的下拉框).
-     * 
+     *
      * @param sheet 要设置的sheet.
      * @param textlist 下拉框显示的内容
      * @param promptContent 提示内容
@@ -1160,7 +1160,7 @@ public class ExcelUtil<T>
 
     /**
      * 解析导出值 0=男,1=女,2=未知
-     * 
+     *
      * @param propertyValue 参数值
      * @param converterExp 翻译注解
      * @param separator 分隔符
@@ -1197,7 +1197,7 @@ public class ExcelUtil<T>
 
     /**
      * 反向解析值 男=0,女=1,未知=2
-     * 
+     *
      * @param propertyValue 参数值
      * @param converterExp 翻译注解
      * @param separator 分隔符
@@ -1234,7 +1234,7 @@ public class ExcelUtil<T>
 
     /**
      * 解析字典值
-     * 
+     *
      * @param dictValue 字典值
      * @param dictType 字典类型
      * @param separator 分隔符
@@ -1247,7 +1247,7 @@ public class ExcelUtil<T>
 
     /**
      * 反向解析值字典值
-     * 
+     *
      * @param dictLabel 字典标签
      * @param dictType 字典类型
      * @param separator 分隔符
@@ -1260,7 +1260,7 @@ public class ExcelUtil<T>
 
     /**
      * 数据处理器
-     * 
+     *
      * @param value 数据值
      * @param excel 数据注解
      * @return
@@ -1337,7 +1337,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取下载路径
-     * 
+     *
      * @param filename 文件名称
      */
     public String getAbsoluteFile(String filename)
@@ -1353,7 +1353,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取bean中的属性值
-     * 
+     *
      * @param vo 实体对象
      * @param field 字段
      * @param excel 注解
@@ -1384,7 +1384,7 @@ public class ExcelUtil<T>
 
     /**
      * 以类的属性的get方法方法形式获取值
-     * 
+     *
      * @param o
      * @param name
      * @return value
@@ -1490,7 +1490,7 @@ public class ExcelUtil<T>
 
     /**
      * 创建工作表
-     * 
+     *
      * @param sheetNo sheet数量
      * @param index 序号
      */
@@ -1507,7 +1507,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取单元格值
-     * 
+     *
      * @param row 获取的行
      * @param column 获取单元格列号
      * @return 单元格值
@@ -1567,7 +1567,7 @@ public class ExcelUtil<T>
 
     /**
      * 判断是否是空行
-     * 
+     *
      * @param row 判断的行
      * @return
      */
@@ -1655,7 +1655,7 @@ public class ExcelUtil<T>
 
     /**
      * 格式化不同类型的日期对象
-     * 
+     *
      * @param dateFormat 日期格式
      * @param val 被格式化的日期对象
      * @return 格式化后的日期字符
@@ -1721,7 +1721,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取对象的子列表方法
-     * 
+     *
      * @param name 名称
      * @param pojoClass 类对象
      * @return 子列表方法

+ 3 - 3
ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java

@@ -1,7 +1,7 @@
 package com.ruoyi.common.xss;
 
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -9,7 +9,7 @@ import java.lang.annotation.Target;
 
 /**
  * 自定义xss校验注解
- * 
+ *
  * @author ruoyi
  */
 @Retention(RetentionPolicy.RUNTIME)

+ 4 - 4
ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java

@@ -1,14 +1,14 @@
 package com.ruoyi.common.xss;
 
 import com.ruoyi.common.utils.StringUtils;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 /**
  * 自定义xss校验注解实现
- * 
+ *
  * @author ruoyi
  */
 public class XssValidator implements ConstraintValidator<Xss, String>
@@ -31,4 +31,4 @@ public class XssValidator implements ConstraintValidator<Xss, String>
         Matcher matcher = pattern.matcher(value);
         return matcher.matches();
     }
-}
+}

+ 6 - 7
ruoyi-framework/pom.xml

@@ -18,7 +18,7 @@
     <dependencies>
 
         <!-- SpringBoot Web容器 -->
-         <dependency>
+        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
@@ -45,8 +45,8 @@
             <artifactId>kaptcha</artifactId>
             <exclusions>
                 <exclusion>
-                    <artifactId>javax.servlet-api</artifactId>
-                    <groupId>javax.servlet</groupId>
+                    <artifactId>jakarta.servlet-api</artifactId>
+                    <groupId>jakarta.servlet</groupId>
                 </exclusion>
             </exclusions>
         </dependency>
@@ -68,10 +68,9 @@
             <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.redisson</groupId>
-            <artifactId>redisson</artifactId>
-            <version>2.15.2</version>
-            <scope>compile</scope>
+            <groupId>com.google.firebase</groupId>
+            <artifactId>firebase-admin</artifactId>
+            <version>9.1.1</version>
         </dependency>
     </dependencies>
 

+ 2 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java

@@ -2,8 +2,8 @@ package com.ruoyi.framework.aspectj;
 
 import java.util.Collection;
 import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.ArrayUtils;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.AfterReturning;

Some files were not shown because too many files changed in this diff