Răsfoiți Sursa

提交测试版

xixi178 10 luni în urmă
părinte
comite
4051540ed5
75 a modificat fișierele cu 185 adăugiri și 5333 ștergeri
  1. 14 0
      .idea/dataSources.local.xml
  2. 7 0
      .idea/dataSources.xml
  3. 93 28
      .idea/workspace.xml
  4. 0 49
      client-api/src/main/java/com/wteam/controller/card/CardAdminController.java
  5. 0 174
      client-api/src/main/java/com/wteam/controller/card/CardController.java
  6. 0 35
      client-api/src/main/java/com/wteam/controller/coupon/CouponController.java
  7. 0 76
      client-api/src/main/java/com/wteam/controller/court/CourtController.java
  8. 0 574
      client-api/src/main/java/com/wteam/controller/hardware/HardwareController.java
  9. 0 38
      client-api/src/main/java/com/wteam/controller/hardware/PollingController.java
  10. 0 57
      client-api/src/main/java/com/wteam/controller/order/OrderController.java
  11. 0 110
      client-api/src/main/java/com/wteam/controller/order/QrCodeController.java
  12. 0 107
      client-api/src/main/java/com/wteam/controller/user/UserController.java
  13. 0 50
      framework/src/main/java/com/wteam/framework/modules/book/entity/Address.java
  14. 0 58
      framework/src/main/java/com/wteam/framework/modules/book/entity/AdminUser.java
  15. 0 65
      framework/src/main/java/com/wteam/framework/modules/book/entity/Card.java
  16. 0 59
      framework/src/main/java/com/wteam/framework/modules/book/entity/Coupon.java
  17. 0 47
      framework/src/main/java/com/wteam/framework/modules/book/entity/CouponUser.java
  18. 0 26
      framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonDeserializer.java
  19. 0 21
      framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonSerializer.java
  20. 0 53
      framework/src/main/java/com/wteam/framework/modules/book/entity/Notice.java
  21. 0 97
      framework/src/main/java/com/wteam/framework/modules/book/entity/OrderInfo.java
  22. 0 44
      framework/src/main/java/com/wteam/framework/modules/book/entity/OrderUser.java
  23. 0 58
      framework/src/main/java/com/wteam/framework/modules/book/entity/PaymentInfo.java
  24. 0 45
      framework/src/main/java/com/wteam/framework/modules/book/entity/Role.java
  25. 0 45
      framework/src/main/java/com/wteam/framework/modules/book/entity/RoleMenu.java
  26. 0 66
      framework/src/main/java/com/wteam/framework/modules/book/entity/Store.java
  27. 0 46
      framework/src/main/java/com/wteam/framework/modules/book/entity/Vdstate.java
  28. 0 65
      framework/src/main/java/com/wteam/framework/modules/book/entity/Venue.java
  29. 0 21
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderCardReq.java
  30. 0 56
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderReq.java
  31. 0 116
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/RefundResult.java
  32. 0 30
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoreForm.java
  33. 0 24
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StorePhotoDto.java
  34. 0 21
      framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoredCardDto.java
  35. 0 33
      framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/TimeCalculation.java
  36. 0 18
      framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/hardwareReq.java
  37. 0 42
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/CardVo.java
  38. 0 89
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderInfoVo.java
  39. 0 89
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderTicketVo.java
  40. 0 18
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderVo.java
  41. 0 30
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/PaymentRequest.java
  42. 0 20
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreDetailsVo.java
  43. 0 42
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreVo.java
  44. 0 18
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimeCodeVo.java
  45. 0 41
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimerOrderInfoVo.java
  46. 0 17
      framework/src/main/java/com/wteam/framework/modules/book/entity/vo/VenueVo.java
  47. 0 21
      framework/src/main/java/com/wteam/framework/modules/book/mapper/CardMapper.java
  48. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponMapper.java
  49. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponUserMapper.java
  50. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/OrderInfoMapper.java
  51. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/PaymentInfoMapper.java
  52. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/StoreMapper.java
  53. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/mapper/VenueMapper.java
  54. 0 40
      framework/src/main/java/com/wteam/framework/modules/book/service/CardService.java
  55. 0 16
      framework/src/main/java/com/wteam/framework/modules/book/service/CouponService.java
  56. 0 33
      framework/src/main/java/com/wteam/framework/modules/book/service/OrderInfoService.java
  57. 0 21
      framework/src/main/java/com/wteam/framework/modules/book/service/PaymentInfoService.java
  58. 0 20
      framework/src/main/java/com/wteam/framework/modules/book/service/StoreService.java
  59. 0 15
      framework/src/main/java/com/wteam/framework/modules/book/service/VenueService.java
  60. 0 739
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/CardServiceImpl.java
  61. 0 18
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/CouponServiceImpl.java
  62. 0 429
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/OrderInfoServiceImpl.java
  63. 0 254
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/PaymentInfoServiceImpl.java
  64. 0 115
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/StoreServiceImpl.java
  65. 0 18
      framework/src/main/java/com/wteam/framework/modules/book/service/impl/VenueServiceImpl.java
  66. 0 47
      framework/src/main/java/com/wteam/framework/modules/card/entity/CbCardAdmin.java
  67. 0 9
      framework/src/main/java/com/wteam/framework/modules/card/mapper/CardAdminMapper.java
  68. 0 17
      framework/src/main/java/com/wteam/framework/modules/card/service/CardAdminService.java
  69. 0 55
      framework/src/main/java/com/wteam/framework/modules/card/service/impl/CardAdminServiceImpl.java
  70. 0 38
      framework/src/main/java/com/wteam/framework/modules/hardware/ApiCallerUtil.java
  71. 0 105
      framework/src/main/java/com/wteam/framework/modules/hardware/ApiQrCodeUtil.java
  72. 0 176
      framework/src/main/java/com/wteam/framework/modules/hardware/QrCodeRegistrationUtil.java
  73. 0 67
      framework/src/main/java/com/wteam/framework/modules/hardware/RegistrationTask.java
  74. 68 163
      framework/src/main/java/com/wteam/framework/modules/user/service/impl/UserServiceImpl.java
  75. 3 3
      generator/src/main/resources/application.yml

+ 14 - 0
.idea/dataSources.local.xml

@@ -29,5 +29,19 @@
         </introspection-scope>
       </schema-mapping>
     </data-source>
+    <data-source name="edu@120.24.169.140" uuid="28d74e5d-d603-42ee-829e-ffa34b3e3e31">
+      <database-info product="MySQL" version="5.7.43-log" jdbc-version="4.0" driver-name="MySQL Connector Java" driver-version="mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )" dbms="MYSQL" exact-version="5.7.43" exact-driver-version="5.1">
+        <extra-name-characters>#@</extra-name-characters>
+        <identifier-quote-string>`</identifier-quote-string>
+      </database-info>
+      <case-sensitivity plain-identifiers="exact" quoted-identifiers="exact" />
+      <secret-storage>master_key</secret-storage>
+      <user-name>edu</user-name>
+      <schema-mapping>
+        <introspection-scope>
+          <node kind="schema" qname="@" />
+        </introspection-scope>
+      </schema-mapping>
+    </data-source>
   </component>
 </project>

+ 7 - 0
.idea/dataSources.xml

@@ -15,5 +15,12 @@
       <jdbc-url>jdbc:mysql://139.9.38.185:3306/cb</jdbc-url>
       <working-dir>$ProjectFileDir$</working-dir>
     </data-source>
+    <data-source source="LOCAL" name="edu@120.24.169.140" uuid="28d74e5d-d603-42ee-829e-ffa34b3e3e31">
+      <driver-ref>mysql.8</driver-ref>
+      <synchronize>true</synchronize>
+      <jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
+      <jdbc-url>jdbc:mysql://120.24.169.140:3306/edu</jdbc-url>
+      <working-dir>$ProjectFileDir$</working-dir>
+    </data-source>
   </component>
 </project>

+ 93 - 28
.idea/workspace.xml

@@ -5,21 +5,83 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="8eaaf244-eba9-47b2-a128-7c46802a5971" name="Changes" comment="finally">
-      <change beforePath="$PROJECT_DIR$/.drone.yml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.local.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/dataSources/a06efed9-eef7-4bc7-9f23-4e9d60c2cb7e.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources/a06efed9-eef7-4bc7-9f23-4e9d60c2cb7e.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/card/CardController.java" beforeDir="false" afterPath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/card/CardController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/hardware/HardwareController.java" beforeDir="false" afterPath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/hardware/HardwareController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/common/enums/ResultCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/common/enums/ResultCode.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/OrderInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/OrderInfo.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Venue.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Venue.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimeCodeVo.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimeCodeVo.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/CardServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/CardServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/card/CardAdminController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/card/CardController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/coupon/CouponController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/court/CourtController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/hardware/HardwareController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/hardware/PollingController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/order/OrderController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/order/QrCodeController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/client-api/src/main/java/com/wteam/controller/user/UserController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Address.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/AdminUser.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Card.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Coupon.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/CouponUser.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonDeserializer.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonSerializer.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Notice.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/OrderInfo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/OrderUser.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/PaymentInfo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Role.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/RoleMenu.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Store.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Vdstate.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/Venue.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderCardReq.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderReq.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/RefundResult.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoreForm.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StorePhotoDto.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoredCardDto.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/TimeCalculation.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/hardwareReq.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/CardVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderInfoVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderTicketVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/PaymentRequest.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreDetailsVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimeCodeVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimerOrderInfoVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/entity/vo/VenueVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/CardMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponUserMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/OrderInfoMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/PaymentInfoMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/StoreMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/mapper/VenueMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/CardService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/CouponService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/OrderInfoService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/PaymentInfoService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/StoreService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/VenueService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/CardServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/CouponServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/OrderInfoServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/PaymentInfoServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/StoreServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/book/service/impl/VenueServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/card/entity/CbCardAdmin.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/card/mapper/CardAdminMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/card/service/CardAdminService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/card/service/impl/CardAdminServiceImpl.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/ApiCallerUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/ApiCallerUtil.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/ApiQrCodeUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/ApiQrCodeUtil.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/QrCodeRegistrationUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/QrCodeRegistrationUtil.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/pay/serviceimpl/WxV3PayPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/pay/serviceimpl/WxV3PayPlugin.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/pay/serviceimpl/handler/MyPayMessageHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/pay/serviceimpl/handler/MyPayMessageHandler.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/RegistrationTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/hardware/RegistrationTask.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/user/service/impl/UserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/framework/src/main/java/com/wteam/framework/modules/user/service/impl/UserServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/target/classes/com/wteam/framework/common/enums/ResultCode.class" beforeDir="false" afterPath="$PROJECT_DIR$/framework/target/classes/com/wteam/framework/common/enums/ResultCode.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/framework/target/classes/com/wteam/framework/modules/user/service/impl/UserServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/framework/target/classes/com/wteam/framework/modules/user/service/impl/UserServiceImpl.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/generator/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/generator/src/main/resources/application.yml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -138,20 +200,7 @@
       </set>
     </option>
   </component>
-  <component name="RunManager" selected="Spring Boot.ClientApiApplication">
-    <configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
-      <option name="MAIN_CLASS_NAME" value="com.wteam.security.Main" />
-      <module name="client-api" />
-      <extension name="coverage">
-        <pattern>
-          <option name="PATTERN" value="com.wteam.security.*" />
-          <option name="ENABLED" value="true" />
-        </pattern>
-      </extension>
-      <method v="2">
-        <option name="Make" enabled="true" />
-      </method>
-    </configuration>
+  <component name="RunManager" selected="Spring Boot.GeneratorApplication">
     <configuration name="RegistrationTask" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
       <option name="MAIN_CLASS_NAME" value="com.wteam.framework.modules.hardware.RegistrationTask" />
       <module name="framework" />
@@ -244,6 +293,19 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration name="GeneratorApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="generator" />
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.wteam.generator.GeneratorApplication" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.wteam.generator.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration name="ManagerApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
       <module name="manager-api" />
       <option name="SPRING_BOOT_MAIN_CLASS" value="com.wteam.ManagerApplication" />
@@ -253,7 +315,6 @@
     </configuration>
     <list>
       <item itemvalue="Application.main" />
-      <item itemvalue="Application.Main" />
       <item itemvalue="Application.StringDataExtractionTest" />
       <item itemvalue="Application.com.wteam.controller.card.Main" />
       <item itemvalue="Application.RegistrationTask" />
@@ -261,14 +322,15 @@
       <item itemvalue="Spring Boot.ClientApiApplication" />
       <item itemvalue="Spring Boot.CommonApiApplication" />
       <item itemvalue="Spring Boot.ManagerApplication" />
+      <item itemvalue="Spring Boot.GeneratorApplication" />
     </list>
     <recent_temporary>
       <list>
+        <item itemvalue="Spring Boot.GeneratorApplication" />
         <item itemvalue="Application.RegistrationTask" />
         <item itemvalue="Application.main" />
         <item itemvalue="Application.com.wteam.controller.card.Main" />
         <item itemvalue="Application.StringDataExtractionTest" />
-        <item itemvalue="Application.Main" />
       </list>
     </recent_temporary>
   </component>
@@ -305,6 +367,9 @@
       <workItem from="1697887182792" duration="6858000" />
       <workItem from="1698057786406" duration="186000" />
       <workItem from="1698059500668" duration="4236000" />
+      <workItem from="1701417552397" duration="1655000" />
+      <workItem from="1701427380779" duration="1603000" />
+      <workItem from="1701432893921" duration="33000" />
     </task>
     <task id="LOCAL-00001" summary="init2">
       <created>1696846465336</created>

+ 0 - 49
client-api/src/main/java/com/wteam/controller/card/CardAdminController.java

@@ -1,49 +0,0 @@
-package com.wteam.controller.card;
-
-import com.wteam.framework.common.enums.CardTypeEnum;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.card.entity.CbCardAdmin;
-import com.wteam.framework.modules.card.service.CardAdminService;
-import io.swagger.annotations.ApiParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/10/7 22:40
- */
-@Slf4j
-@Tag(name = "管理卡相关接口管理")
-@RestController
-@RequestMapping("/v1/cardAdmin")
-public class CardAdminController {
-
-
-
-    @Autowired
-    private CardAdminService cardAdminService;
-
-
-    /**
-     * 展示这个门店的所有卡
-     *
-     * @return
-     */
-    @Operation(summary = "展示该门店所有卡")
-    @GetMapping("/showAllCard/{cardTypeEnum}")
-    public ResultMessage<List<CbCardAdmin>> showAllCard(
-            @NotNull @PathVariable CardTypeEnum cardTypeEnum) {
-        return cardAdminService.showAllCard(cardTypeEnum);
-    }
-
-}

+ 0 - 174
client-api/src/main/java/com/wteam/controller/card/CardController.java

@@ -1,174 +0,0 @@
-package com.wteam.controller.card;
-
-import com.jeequan.jeepay.exception.JeepayException;
-import com.wteam.framework.common.enums.CardTypeEnum;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.dto.OrderCardReq;
-import com.wteam.framework.modules.book.entity.dto.OrderReq;
-import com.wteam.framework.modules.book.entity.vo.CardVo;
-import com.wteam.framework.modules.book.service.CardService;
-import io.swagger.annotations.ApiParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/18 19:18
- */
-@Slf4j
-@Tag(name = "卡相关接口管理")
-@RestController
-@RequestMapping("/v1/card")
-public class CardController {
-
-
-    @Autowired
-    private CardService cardService;
-
-    /**
-     * 查询出该门店下的卡
-     * 通过枚举来区别卡类型
-     *
-     * @param id           门店id
-     * @param cardTypeEnum
-     * @return
-     */
-    @Operation(summary = "展示该门店所有卡")
-    @GetMapping("/{cardTypeEnum}/{id}")
-    public ResultMessage<List<Card>> showCard(
-            @ApiParam(value = "卡ID", required = true) @PathVariable("id") Long id,
-            @PathVariable CardTypeEnum cardTypeEnum) {
-        return cardService.showCard(id, cardTypeEnum);
-    }
-
-
-    /**
-     * 查看卡的详细信息
-     *
-     * @return
-     */
-    @Operation(summary = "展示卡详细信息")
-    @PostMapping("/showCardDetails/{id}")
-    public ResultMessage<CardVo> showCardDetails(@ApiParam(value = "卡ID", required = true) @PathVariable("id") Long id) {
-        return cardService.showCardDetails(id);
-    }
-
-//    /**
-//     * 月卡和次卡的购买
-//     *
-//     * @param accessToken
-//     * @param orderId
-//     * @param cardId
-//     * @return
-//     */
-//    @Operation(summary = "月卡和次卡购买")
-//    @PostMapping("/buyCard/{accessToken}/{orderId}/{cardId}")
-//    public ResultMessage<String> buyCard(
-//            @PathVariable("accessToken") String accessToken,
-//            @ApiParam(value = "订单ID", required = true) @PathVariable String orderId,
-//            @ApiParam(value = "卡ID", required = true) @PathVariable Long cardId) {
-//        return cardService.buyCard(accessToken, orderId, cardId);
-//    }
-
-//    @Operation(summary = "储值卡充值")
-//    @PostMapping("/chargeCard/{accessToken}/{id}")
-//    public ResultMessage chargeCard(@PathVariable("accessToken") String accessToken,
-//                                    @ApiParam(value = "卡ID", required = true) @PathVariable("id") Long id) {
-//        return cardService.chargeCard(accessToken, id);
-//    }
-
-    /**
-     * 租场订单超时的情况为
-     * 支付的时候可以使用微信和储值卡支付
-     * 支付成功变成待使用
-     * 扫码成功第一次变成使用中 第二次如果在规定时间内出来则直接变成已经使用
-     * 如果存在超时的情况 那将会存在超时金额
-     * 前端如果显示存在超时金额 则需要支付
-     * 这里支付也是可以微信支付或者储值卡支付
-     * 两者都是如果支付成功就将状态改为已使用
-     */
-
-
-
-
-
-
-
-    /**
-     * 使用储值卡支付
-     *
-     * @param orderId
-     * @param cardId
-     * @return
-     */
-    @Operation(summary = "使用储值卡支付")
-    @PostMapping("/valueCardPay/{orderId}/{cardId}")
-    public ResultMessage valueCardPay(@PathVariable String orderId, @PathVariable Integer cardId) {
-        return cardService.valueCardPay(orderId, cardId);
-    }
-
-
-    /**
-     * 使用散客储值卡支付
-     * 散客储值卡只能支付计时订单和次卡
-     *
-     * @param orderId
-     * @param cardId
-     * @return
-     */
-    @Operation(summary = "使用散客储值卡支付")
-    @PostMapping("/personCardPay/{orderId}/{cardId}")
-    public ResultMessage personCardPay(@PathVariable String orderId, @PathVariable Integer cardId) {
-        return cardService.personCardPay(orderId, cardId);
-    }
-
-//    /**
-//     * 储值卡的充值操作
-//     *
-//     * @return
-//     */
-//    @Operation(summary = "储值卡充值")
-//    @PostMapping("/cardCharge/{cardId}/{orderId}")
-//    public ResultMessage cardCharge(@PathVariable String orderId, @PathVariable Integer cardId) {
-//        return cardService.cardCharge(orderId, cardId);
-//    }
-
-
-    /**
-     * 获得月卡对应的二维码信息
-     *
-     * @param cardId
-     * @return
-     */
-    //TODO :这个改为使用该卡的购买id查询其对应的二维码
-    @Operation(summary = "获得月卡对应的二维码")
-    @PostMapping("/getQrCodeByCard/{cardId}")
-    public ResultMessage getQrCodeByCard(@PathVariable String cardId) {
-        return cardService.getQrCodeByCard(cardId);
-    }
-
-
-    @Operation(summary = "提交卡购买订单")
-    @PostMapping("/generateCardOrder/{accessToken}")
-    public ResultMessage generateCardOrder(@PathVariable("accessToken") String accessToken,
-                                           @ApiParam(value = "订单参数", required = true) @RequestBody OrderCardReq orderCardReq) {
-        return cardService.generateCardOrder(accessToken, orderCardReq);
-
-    }
-
-    @Operation(summary = "提交充值卡订单信息")
-    @PostMapping("/getChargeCardOrder/{accessToken}/{cardId}")
-    public ResultMessage getChargeCardOrder(@PathVariable("accessToken") String accessToken,
-                                            @ApiParam(value = "卡id", required = true) @PathVariable Integer cardId,
-                                            @RequestParam Double currentBalance) {
-        return cardService.getChargeCardOrder(accessToken, cardId, currentBalance);
-    }
-
-}

+ 0 - 35
client-api/src/main/java/com/wteam/controller/coupon/CouponController.java

@@ -1,35 +0,0 @@
-package com.wteam.controller.coupon;
-
-
-
-import com.wteam.framework.modules.book.service.CouponService;
-
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-
-
-
-
-/**
- * (Coupon)控制层
- *
- * @author doncic
- * @since 2023-09-25 17:09:49
- */
-@Slf4j
-@Tag(name = "优惠卷相关接口管理")
-@RestController
-@RequestMapping("/v1/coupon")
-public class CouponController {
-    /**
-     * 服务对象
-     */
-    @Autowired
-    private CouponService couponService;
-
-
-}
-

+ 0 - 76
client-api/src/main/java/com/wteam/controller/court/CourtController.java

@@ -1,76 +0,0 @@
-package com.wteam.controller.court;
-
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.vo.StoreDetailsVo;
-import com.wteam.framework.modules.book.service.StoreService;
-import com.wteam.framework.modules.image.service.CbImageService;
-import com.wteam.framework.modules.specialValue.service.CbSpecialValueService;
-import io.swagger.annotations.ApiParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.web.bind.annotation.*;
-
-import java.text.ParseException;
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/16 22:54
- */
-@Slf4j
-@Tag(name = "门店相关接口管理")
-@RestController
-@RequestMapping("/v1/court")
-public class CourtController {
-
-    @Autowired
-    private StoreService storeService;
-    @Autowired
-    private CbImageService cbImageService;
-    @Autowired
-    private CbSpecialValueService cbSpecialValueService;
-
-
-//    /**
-//     * 获取对应门店的轮播图信息
-//     *
-//     * @param id
-//     * @return
-//     */
-//    @Operation(summary = "获取轮播图")
-//    @GetMapping("/getPhoto/{id}")
-//    public ResultMessage<List<String>> getPhoto(@ApiParam(value = "门店ID", required = true) @PathVariable("id") Long id) {
-//        return storeService.getPhoto(id);
-//    }
-
-
-    /**
-     * 获取门店信息
-     * 先查缓存 有就直接返回
-     *
-     * @param id 门店id
-     * @return
-     */
-//    @Cacheable(value = "storeDetails", key = "#id")
-    @Operation(summary = "门店信息")
-    @GetMapping("/getCourtDetails/{id}")
-    public ResultMessage<StoreDetailsVo> getCourtDetails(@ApiParam(value = "门店ID", required = true) @PathVariable("id") Long id) {
-        return storeService.getDetails(id);
-    }
-
-
-    @Operation(summary = "获取轮播图")
-    @GetMapping("/getPhoto")
-    public ResultMessage getPhoto() {
-        return cbImageService.getPhoto();
-    }
-
-    @Operation(summary = "获取特殊价格")
-    @GetMapping("/getSpecialValue")
-    public ResultMessage getSpecialValue() {
-        return cbSpecialValueService.getSpecialValue();
-    }
-}

+ 0 - 574
client-api/src/main/java/com/wteam/controller/hardware/HardwareController.java

@@ -1,574 +0,0 @@
-package com.wteam.controller.hardware;
-
-/**
- * @author doncic
- * @date 2023/9/27 19:13
- */
-
-import cn.hutool.core.util.RandomUtil;
-import com.wteam.framework.common.enums.OrderStatusEnum;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.enums.orderTypeEnum;
-import com.wteam.framework.common.security.AuthUser;
-import com.wteam.framework.common.security.context.UserContext;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.vo.TimeCodeVo;
-import com.wteam.framework.modules.book.mapper.CardMapper;
-import com.wteam.framework.modules.book.mapper.OrderInfoMapper;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import com.wteam.framework.modules.hardware.QrCodeRegistrationUtil;
-import com.wteam.framework.modules.user.entity.User;
-import com.wteam.framework.modules.user.mapper.UserMapper;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.time.Duration;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.Temporal;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-@Slf4j
-@Tag(name = "硬件相关接口管理")
-@RestController
-@RequestMapping("/v1/hardware")
-public class HardwareController {
-
-
-    @Autowired
-    private OrderInfoMapper orderInfoMapper;
-    @Autowired
-    private OrderInfoService orderInfoService;
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private CardMapper cardMapper;
-
-    private static String lastRequestTime = null; // 用来记录上一次请求的时间
-    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-    private static SimpleDateFormat sdfTimer = new SimpleDateFormat("HH:mm");
-
-    /**
-     * 这个时间判断是为了避免存在:因为扫码头会有多次扫到同一个码的情况
-     *
-     * @return
-     */
-    private static boolean isTimeElapsed() {
-        String currentTime = sdf.format(new Date()); // 获取当前时间的字符串表示
-        if (lastRequestTime == null) {
-            // 如果是第一次请求,记录当前时间并返回true
-            lastRequestTime = currentTime;
-            return true;
-        } else {
-            try {
-                Date currentDateTime = sdf.parse(currentTime);
-                Date lastRequestDateTime = sdf.parse(lastRequestTime);
-                long timeElapsed = currentDateTime.getTime() - lastRequestDateTime.getTime();
-                return timeElapsed >= 10000; // 10秒等于10000毫秒
-            } catch (Exception e) {
-                e.printStackTrace();
-                return true; // 如果出现异常,默认返回true以执行程序
-            }
-        }
-    }
-
-
-    /**
-     * 这里理一下思路
-     * 这里是反扫码设置,先前已经使用hutool接口进行第三方的url回调设置了
-     * 根据传入的信息解析可以获得  扫码的时间、二维码信息、devmac指的是生命周期
-     * 这里根据二维码信息可以获得对应id
-     * 如果是订场订单生成的code ---》userId和orderId
-     * 如果是计时订单生成的code ---》userId和orderId
-     * 如果是月卡或者次卡生成的code ---》userId和有效天数
-     * 根据orderId获取到对应的订单信息
-     * 如果是计时订单
-     * 先将时间存入starttime
-     * 第二次进行时间校验 -》第二次的时间必须要是
-     * 然后进行业务处理
-     */
-    @Operation(summary = "反扫码设备第三方二维码核销说明")
-    @RequestMapping(value = "/verification", method = RequestMethod.GET)
-    public ResultMessage hardware(@RequestParam(value = "data") String data) throws ParseException {
-        log.info("此时回调的data数据为:{}", data);
-
-        // 使用正则表示判断传入的回调数据是否正确
-        // 定义正则表达式来匹配格式
-        String pattern1 = "\\d{15}_pxo_\\d{8}_\\d{5}_\\d{9}_\\d{2}";
-
-        if (!data.matches(pattern1)) {
-            return ResultUtil.success(ResultCode.HARD_CALL_BACK_DATA_ERROR);
-        }
-
-        String orderId = null;
-
-        // 获取当前时间
-        Date now = new Date();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String time = sdf.format(now); // 格式化当前时间为字符串
-        log.info("此时扫码的时间为:{}", time);
-
-        boolean timeElapsed = isTimeElapsed();
-        log.info("此时的间隔是否大于5秒:{}", timeElapsed);
-
-        if (!timeElapsed) {
-            return ResultUtil.success(ResultCode.SAOMA_TIME_TAI_DUAN);
-        }
-
-        // 定义正则表达式来匹配数字
-        String pattern2 = "\\d{9}"; // 匹配9位数字
-
-        Pattern r = Pattern.compile(pattern2);
-        Matcher m = r.matcher(data);
-
-        String result = null;
-
-        while (m.find()) {
-            result = m.group(); // 获取匹配的子字符串
-        }
-
-        if (result != null) {
-            // 将result的值赋给orderId
-            orderId = result;
-        } else {
-            log.info("此时获得错误的orderId为:{}", result);
-        }
-
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-
-        log.info("此时的订单信息为{}", orderInfo);
-
-        //这里先判断是什么订单
-        String orderType = orderInfo.getOrderType();
-
-        //根据订场类型不同实现不同的扫码逻辑
-        switch (orderType) {
-            case "RENTAL":
-                // 处理租场订单类型的二维码注销逻辑
-                return RentalOrder(orderId, time);
-            case "TICKET":
-                // 处理门票订单类型的二维码注销逻辑
-                return TicketOrder(orderId, time);
-            case "TIMER":
-                // 处理计时订单类型的二维码注销逻辑
-                // 将时间转化为HH:mm 形式
-                return TimerOrder(orderId, time);
-            case "MONTHLY":
-                // 处理月卡订单类型的二维码注销逻辑
-                return MonthlyOrder(orderId, time);
-            default:
-                // 处理未知订单类型的情况
-                return null;
-        }
-    }
-
-
-    /**
-     * 门票的扫码逻辑
-     * 在二维码注册的时候就已经限制的门票只能核销两次
-     *
-     * @param orderId
-     * @return
-     */
-    private ResultMessage TicketOrder(String orderId, String time) throws ParseException {
-        //获取订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-
-        //处理时间格式
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-        Date currentTime = dateFormat.parse(time);
-
-        //处理业务代码
-        //先处理订场订单的情况
-        if (orderTypeEnum.TICKET.toString().equals(orderInfo.getOrderType())) {
-
-            if (orderInfo.getStartTime() == null) {
-
-                // 第一次调用接口,设置startTime
-                orderInfo.setStartTime(currentTime);
-                log.info("使用次卡二维码第一次进入的时间为:{}", currentTime);
-                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.IN_USE));
-                orderInfoMapper.updateById(orderInfo);
-
-            } else {
-
-                if (orderInfo.getEndTime() == null) {
-                    // 第二次调用接口,设置endTime,并计算费用
-                    orderInfo.setEndTime(currentTime);
-                    log.info("使用次卡二维码出门的时间为:{}", currentTime);
-                    orderInfo.setOrderState(String.valueOf(OrderStatusEnum.USED));
-                    orderInfoMapper.updateById(orderInfo);
-//                    return ResultUtil.success(ResultCode.TICKET_ORDER_FINISH);
-                }
-            }
-        }
-        return ResultUtil.error(ResultCode.TICKET_HARD_ERROR);
-    }
-
-    /**
-     * 月卡的核销业务逻辑处理
-     * 月卡的二维码注册的时候有效期直到月卡失效
-     * 先检测二维码是否存在
-     * 再判断此时二维码是否失效
-     * 只要未失效
-     * 不限时间不限次数
-     *
-     * @param orderId
-     * @param time
-     * @return
-     */
-    private ResultMessage MonthlyOrder(String orderId, String time) throws ParseException {
-        //获取order信息
-        //获取订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        //获得卡信息
-        Integer cardId = orderInfo.getCardId();
-        Card card = cardMapper.selectById(cardId);
-        String endDate = card.getEndDate();
-        // 假设时间格式为 "yyyy-MM-dd HH:mm:ss"
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Date timeDate = sdf.parse(time);
-        Date endDateDate = sdf.parse(endDate);
-        //处理扫码业务
-        if (timeDate.before(endDateDate)) {
-            return ResultUtil.success();
-        }
-        return ResultUtil.error(ResultCode.MONTHLY_HARD_ERROR);
-    }
-
-
-    /**
-     * 计时卡逻辑
-     * 根据第一次传入的时间设置为用户进场时间
-     * 根据第一次进场时间判断时间段,根据时间段的不同,设置订单的价格不同
-     * 根据第二次传入的时间设置为用户离场时间
-     * 根据第一次和第二次的差值计算价格
-     */
-    @SneakyThrows
-    private ResultMessage TimerOrder(String orderId, String time) {
-        //获取订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-
-//        // 处理时间格式
-//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
-//        // 获取当前日期和时间
-//        Date currentDate = new Date();
-//        String format = sdf1.format(currentDate);
-
-        Date date = sdf.parse(time);
-        log.info("此刻的传入的时间为:{}", date);
-
-//        // 设置不同时间段的价格
-//        Date startTime1 = sdf.parse(format + " 09:30:00");
-//        Date endTime1 = sdf.parse(format + " 18:00:00");
-//        Date startTime2 = sdf.parse(format + " 18:30:00");
-//        log.info("此时格式化的三个时间段为:{},{},{}", startTime1, endTime1, startTime2);
-
-        //先处理订场订单的情况
-        if (orderInfo.getStartTime() == null) {
-
-            // 第一次调用接口,设置startTime
-            orderInfo.setStartTime(date);
-            orderInfo.setOrderState(String.valueOf(OrderStatusEnum.IN_USE));
-            log.info("此时第一次调用接口设置的计时订单的进场时间为:{}", date);
-            orderInfoMapper.updateById(orderInfo);
-
-//            if (date.after(startTime1) && date.before(endTime1)) {
-//
-//                // 当前时间在 09:30 - 18:00 之间,价格为 8 元/小时
-//                double initialPrice = 8.0;
-//                orderInfo.setOrderPrice(initialPrice);
-//                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.WAITING_TO_PAY));
-//                log.info("09:30 - 18:00这个时间段的订单信息为:{}", orderInfo);
-//                orderInfoService.updateById(orderInfo);
-//
-//            } else if (date.after(startTime2)) {
-//
-//                // 当前时间在 18:30 之后,价格为 10 元/小时
-//                double initialPrice = 10.0;
-//                orderInfo.setOrderPrice(initialPrice);
-//                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.WAITING_TO_PAY));
-//                log.info("18 :30 之后的这个时间段的订单信息为:{}", orderInfo);
-//                orderInfoService.updateById(orderInfo);
-//
-//            }
-
-        } else {
-
-            if (orderInfo.getEndTime() == null && orderInfo.getStartTime() != null) {
-
-                // 第二次调用接口,设置endTime,并计算费用
-                orderInfo.setEndTime(date);
-                log.info("此时第二次调用接口设置的计时订单的进场时间为:{}", date);
-
-                // 计算时间差(以分钟为单位)
-                long timeDifferenceMillis = orderInfo.getEndTime().getTime() - orderInfo.getStartTime().getTime();
-                long minutesDifference = TimeUnit.MILLISECONDS.toMinutes(timeDifferenceMillis);
-
-                // 计算超出一分钟的时间
-                long extraMinutes = Math.max(0, minutesDifference - 60);
-                log.info("计时订单超出一分钟的时间为:{}", extraMinutes);
-
-                // 考虑超时的情况
-                if (extraMinutes > 0) {
-
-                    // 计算超时分钟数
-                    long l = extraMinutes % 60;
-
-                    // 根据超出的分钟计算费用
-                    // 8元/60分钟
-                    double pricePerMinute = 8.0 / 60.0;
-                    double totalPrice = pricePerMinute * l;
-                    orderInfo.setOverPrice(totalPrice);
-                    log.info("计时订单超时金额为:{}", totalPrice);
-                    orderInfo.setOrderState(String.valueOf(OrderStatusEnum.WAITING_SUPPLEMENTS));
-                    orderInfo.setOverTime((int) extraMinutes);
-                    orderInfoService.updateById(orderInfo);
-                    return ResultUtil.success(ResultCode.TIME_ORDER_OVER_FINISH);
-                }
-                //如果没有超时 该计时订单完成
-                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.USED));
-                log.info("使用完成的计时订单信息为:{}", orderInfo);
-                orderInfoService.updateById(orderInfo);
-                return ResultUtil.success(ResultCode.TIME_ORDER_FINISH);
-            }
-        }
-        return ResultUtil.error(ResultCode.TIMER_HARD_ERROR);
-    }
-
-
-    /**
-     * 租场订单实现逻辑
-     * 先获取第一次时间设置为用户进场时间 第二次时间先判断是否在订场时间段之内 如果在就直接放行
-     * 超过订场时间段,则计算超出订场时间
-     *
-     * @param orderId
-     * @return
-     */
-    private ResultMessage RentalOrder(String orderId, String time) throws ParseException {
-        //获取订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        log.info("传入的时间为:{}", time);
-
-        //处理时间格式
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Date currentTime = dateFormat.parse(time);
-        log.info("此刻的时间为:{}", currentTime);
-
-
-        //todo:第2个问题,订场还没有到点的,然后拿着二维码去扫是进不去的,但是只要有这个操作后台就会显示已使用,然后二维码就找不到了。
-        //处理可能会出现提前扫码的情况
-        // 1-->保证在订场开始时间的前30分钟扫码才有效
-        // 获取原始时间
-        Date orderSt = orderInfo.getOrderSt();
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(orderSt);
-
-        // 减去30分钟
-        calendar.add(Calendar.MINUTE, -30);
-        Date newTime = calendar.getTime();
-        Date parse = sdf.parse(newTime.toString());
-        log.info("该订单开始时间减去30分钟之后的时间为:{}", newTime);
-
-        // 判断时间
-        if (currentTime.before(parse)) {
-            return ResultUtil.success(ResultCode.TIME_BU_DAO);
-        }
-
-        //先处理订场订单的情况
-        if (orderTypeEnum.RENTAL.toString().equals(orderInfo.getOrderType())) {
-
-            //如果来回进出场地 或者说用户分享给朋友进行使用的情况
-            // 进入时间就是第一次扫码的时间 但是出门时间要设置为在订单前后的时间
-            if (orderInfo.getStartTime() == null && orderInfo.getOrderState().equals(OrderStatusEnum.WAITING_TO_USE)) {
-
-                // 第一次调用接口,设置startTime
-                orderInfo.setStartTime(currentTime);
-                log.info("使用租场二维码的进场时间为:{}", currentTime);
-                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.IN_USE));
-                orderInfoMapper.updateById(orderInfo);
-
-            } else {
-
-                if (orderInfo.getEndTime() == null) {
-
-                    // 第二次调用接口,设置endTime,并计算费用
-                    orderInfo.setEndTime(currentTime);
-                    log.info("使用租场二维码的出场时间为:{}", currentTime);
-                    orderInfoMapper.updateById(orderInfo);
-
-                    // 校验当前时间是否在ordered时间之前
-                    if (currentTime.before(orderInfo.getOrderEd())) {
-
-                        // 在ordered时间之前,返回状态码200
-                        orderInfo.setOrderState(String.valueOf(OrderStatusEnum.IN_USE));
-                        orderInfoMapper.updateById(orderInfo);
-
-                        if (currentTime.after(orderInfo.getOrderEd())) {
-
-                            orderInfo.setOrderState(String.valueOf(OrderStatusEnum.USED));
-                            orderInfoMapper.updateById(orderInfo);
-                            return ResultUtil.success(ResultCode.RENTAL_ORDER_FINISH);
-
-                        }
-                    } else {
-
-                        // 超过ordered时间,计算超过的分钟数
-                        long minutesDifference = calculateMinutesDifference(orderInfo.getOrderEd(), currentTime);
-
-                        //  计算超时需要付钱金额
-                        double v = calculateAmount(minutesDifference);
-
-                        //获取订单支付金额
-                        Double orderPrice = orderInfo.getOrderPrice();
-
-                        //需要支付的金额
-                        double v1 = v * orderPrice;
-                        log.info("租场超时金额为:{}", v1);
-                        orderInfo.setOverPrice(v1);
-                        orderInfoService.updateById(orderInfo);
-                        return ResultUtil.success(ResultCode.RENTAL_ORDER_OVER_FINISH);
-
-                    }
-                }
-            }
-        }
-        return ResultUtil.error(ResultCode.RENTAL_HARD_ERROR);
-    }
-
-
-    // 计算分钟差
-    private long calculateMinutesDifference(Date startTime, Date endTime) {
-        Duration duration = Duration.between((Temporal) startTime, (Temporal) endTime);
-        return duration.toMinutes();
-    }
-
-    // 定义一个方法来根据时间差计算费用
-    private double calculateAmount(long timeDifferenceMinutes) {
-        // 实现计费计算逻辑
-        // 根据时间差计算费用
-        double billingAmount = 0.0;
-        if (timeDifferenceMinutes >= 45) {
-            billingAmount = 0.75; // 按小时费率的3/4
-        } else if (timeDifferenceMinutes >= 30) {
-            billingAmount = 0.5; // 按小时费率的1/2
-        } else if (timeDifferenceMinutes >= 15) {
-            billingAmount = 0.25; // 按小时费率的1/4
-        }
-        return billingAmount;
-    }
-
-//        // 查询是否存在相同的二维码订单信息
-//        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-//        lambdaQueryWrapper.eq(OrderInfo::getQrCode, qcode);
-//        List<OrderInfo> orderInfos = orderInfoMapper.selectList(lambdaQueryWrapper);
-//        boolean empty = orderInfos.isEmpty();
-//        if (empty) {
-//            orderInfo.setOrderState(String.valueOf(OrderStatusEnum.IN_USE));
-//            orderInfoService.save(orderInfo);
-//            return ResultUtil.success(ResultCode.QRCODE);
-//        }
-//        return ResultUtil.error(ResultCode.QRCODE_ERROR);
-
-
-    /**
-     * 计时卡实现思路
-     * 传入token校验解析 获得userId
-     * 查出昵称
-     * 生成二维码-》计时码注册到硬件只能使用两次 -》调用硬件接口注册-》处理响应数据-》成功-》返回-》 二维码包含userID和手机号信息
-     * 如果二维码注册成功,就生成计时订单
-     * 用户拿着计时码去扫码进场
-     * 一扫码就先支付一个小时的价钱
-     * 然后出来的时候也获得一个时间
-     * 根据时间比对
-     * 如果小于 就直接开闸离开
-     * 如果大于一个小时就继续进行扣费
-     *
-     * @param accessToken
-     * @return
-     */
-    @Operation(summary = "计时卡")
-    @PostMapping("/timeCard/{accessToken}")
-    public ResultMessage timeCard(@PathVariable("accessToken") String accessToken) throws ParseException {
-        //解析校验token获得用户id
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        assert authUser != null;
-        String userId = authUser.getId();
-
-        if (userId.isEmpty()) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-        log.info("此时的用户id为:{}", userId);
-        //根据userId查询user信息
-        User user = userMapper.selectById(userId);
-        // 处理nickName为null的情况
-        //生成一个随机数字
-        String numbersUser = RandomUtil.randomNumbers(4);
-        String nickName = (user.getNickName() != null) ? user.getNickName() : "用户+" + numbersUser;
-
-        // 获取当前时间
-        Date now = new Date();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        // 格式化当前时间为字符串
-        String date = sdf.format(now);
-        long time = sdf.parse(date).getTime();
-        log.info("此刻使用计时码的时间为其对应的时间戳为:{},{}", date, time);
-
-        // 处理时间格式
-        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
-
-        // 获取当前日期和时间
-        Date currentDate = new Date();
-        String format = sdf1.format(currentDate);
-
-        // 设置不同时间段的价格
-        long startTime1 = sdf.parse(format + " 09:30:00").getTime();
-        long endTime1 = sdf.parse(format + " 18:00:00").getTime();
-        long startTime2 = sdf.parse(format + " 18:30:00").getTime();
-        log.info("此时格式化的三个时间段的时间戳为:{},{},{}", startTime1, endTime1, startTime2);
-
-
-        //根据不同的时间判断进场价格
-        double initPrice = 0.0;
-
-        if (time >= startTime1 && time <= endTime1) {
-            initPrice = 8.0;
-        } else if (time >= startTime2) {
-            initPrice = 10.0;
-        }
-        log.info("此时的初始价格为:{}", initPrice);
-
-        //根据不同的时间判断进场价格
-        OrderInfo orderInfo = new OrderInfo();
-        String orderId = RandomUtil.randomNumbers(9);
-        orderInfo.setId(orderId);
-        orderInfo.setUserId(userId);
-        orderInfo.setCreateTime(new Date());
-        orderInfo.setStoreId(9376L);
-        orderInfo.setOrderType(String.valueOf(orderTypeEnum.TIMER));
-        orderInfo.setOrderState(String.valueOf(OrderStatusEnum.WAITING_TO_PAY));
-        orderInfo.setOrderPrice(initPrice);
-        boolean save = orderInfoService.save(orderInfo);
-
-        if (save) {
-            TimeCodeVo timeCodeVo = new TimeCodeVo();
-            timeCodeVo.setOrderInfo(orderInfo);
-            timeCodeVo.setNickName(nickName);
-            return ResultUtil.data(timeCodeVo);
-        }
-        return ResultUtil.error(ResultCode.PRICE);
-    }
-}

+ 0 - 38
client-api/src/main/java/com/wteam/controller/hardware/PollingController.java

@@ -1,38 +0,0 @@
-package com.wteam.controller.hardware;
-
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.nfunk.jep.function.Sum;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.security.KeyStore;
-
-/**
- * @author doncic
- * @date 2023/10/14 13:34
- */
-
-@Slf4j
-@Tag(name = "轮询相关接口管理")
-@RestController
-@RequestMapping("/v1/poll")
-public class PollingController {
-
-    @Autowired
-    private OrderInfoService orderInfoService;
-
-
-    @Operation(summary = "轮询计时码订单状态")
-    @GetMapping("/getTimer/{userId}")
-    public ResultMessage getTimer(@PathVariable String userId) {
-        return orderInfoService.getTimer(userId);
-
-    }
-}

+ 0 - 57
client-api/src/main/java/com/wteam/controller/order/OrderController.java

@@ -1,57 +0,0 @@
-package com.wteam.controller.order;
-
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.dto.OrderReq;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import io.swagger.annotations.ApiParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
-
-/**
- * @author doncic
- * @date 2023/9/19 22:25
- */
-@Slf4j
-@Tag(name = "订单相关接口管理")
-@RestController
-@RequestMapping("/v1/order")
-public class OrderController {
-
-
-    @Autowired
-    private OrderInfoService orderInfoService;
-
-
-    /**
-     * 用户提交订场订单信息
-     *
-     * @param orderReq
-     * @return
-     */
-    @Operation(summary = "提交订单")
-    @PostMapping("/generateOrder/{accessToken}")
-    public ResultMessage<Long> generateOrder(
-            @PathVariable("accessToken") String accessToken,
-            @ApiParam(value = "订单参数", required = true) @RequestBody OrderReq orderReq) {
-        return orderInfoService.generateOrder(accessToken, orderReq);
-    }
-
-    /**
-     * 根据获取当前时间的订单信息,从而得到场地订场情况
-     *
-     * @return
-     */
-    @Operation(summary = "订场情况查询")
-    @GetMapping("/bookStatus/{id}")
-    public ResultMessage<String> bookStatus(
-            @ApiParam(value = "门店ID", required = true) @PathVariable("id") Long id,
-            @RequestParam("dateTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") Date dateTime) {
-        return orderInfoService.bookStatus(id, dateTime);
-    }
-}

+ 0 - 110
client-api/src/main/java/com/wteam/controller/order/QrCodeController.java

@@ -1,110 +0,0 @@
-package com.wteam.controller.order;
-
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.extra.qrcode.QrCodeUtil;
-import cn.hutool.extra.qrcode.QrConfig;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.http.HttpUtil;
-import cn.hutool.json.JSONObject;
-import com.egzosn.pay.common.bean.PayOutMessage;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.hardware.ApiCallerUtil;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.web.bind.annotation.*;
-
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-import java.util.Base64;
-import java.util.Random;
-
-import static java.lang.String.valueOf;
-
-/**
- * @author doncic
- * @date 2023/9/26 20:56
- */
-@Slf4j
-@Tag(name = "二维码相关接口管理")
-@RestController
-@RequestMapping("/v1/qrcode")
-public class QrCodeController {
-
-
-    //TODO :免费场次直接获取二维码进入即可 中间是随机数据 第二位到时候可能加上用户信息
-    @Operation(summary = "获得免费场次的二维码")
-    @GetMapping("/getCode/{userId}")
-    public ResultMessage<String> getCode(@PathVariable String userId) {
-        // 获取当前日期
-        LocalDate currentDate = LocalDate.now();
-        // 格式化日期为字符串
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        String formattedDate = currentDate.format(formatter);
-        String numbers1 = RandomUtil.randomNumbers(5);
-        String numbers2 = RandomUtil.randomNumbers(5);
-        String data = "pxo_" + formattedDate + "_" + numbers1 + "_" + numbers2 + "_00";
-        log.info("此时生成的二维码为:{} ", data);
-
-        // 接口地址和参数
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-        //这个mac为出门
-        String mac1 = "863569068849199";
-        /**
-         * 进
-         * 出
-         * 863569068848969
-         * 863569068849199
-         */
-        //这个mac为进门
-        String mac2 = "863569068848969";
-        String s = callApiWithMac(apiUrl, mac1, mac2, data);
-        log.info("此时mac1注册生成的二维码为:{}", s);
-        return ResultUtil.data(s);
-    }
-
-    public String callApiWithMac(String apiUrl, String mac1, String mac2, String data) {
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-        // 拼接两个 MAC 地址,以逗号分隔
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-
-        //调用hutool接口注册二维码信息
-        HttpResponse response = HttpRequest.post(apiUrl)
-                .form("mac", macParam)
-                .form("tk", tk)
-                .form("qcodetxt", data)
-                .form("enablecount", 100)
-                .execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return data;
-    }
-
-}
-

+ 0 - 107
client-api/src/main/java/com/wteam/controller/user/UserController.java

@@ -1,107 +0,0 @@
-package com.wteam.controller.user;
-
-import com.wteam.framework.common.enums.*;
-import com.wteam.framework.common.security.AuthUser;
-import com.wteam.framework.common.security.context.UserContext;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.CouponUser;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.vo.OrderInfoVo;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import com.wteam.framework.modules.user.entity.User;
-import com.wteam.framework.modules.user.entity.form.UpdateUserForm;
-import com.wteam.framework.modules.user.mapper.UserMapper;
-import com.wteam.framework.modules.user.service.UserService;
-import io.swagger.annotations.ApiParam;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.*;
-import sun.security.provider.Sun;
-
-import javax.validation.constraints.NotNull;
-import java.text.ParseException;
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/16 22:20
- */
-@Slf4j
-@Tag(name = "用户相关接口管理")
-@RestController
-@RequestMapping("/v1/user")
-public class UserController {
-
-    @Autowired
-    private UserService userService;
-    @Autowired
-    private UserMapper userMapper;
-
-
-    /**
-     * 修改用户信息
-     *
-     * @param accessToken
-     * @param userForm
-     * @return
-     */
-    @Operation(summary = "修改用户信息")
-    @PutMapping("/update/{accessToken}")
-    public ResultMessage<UpdateUserForm> updateUser(@NotNull @PathVariable("accessToken") String accessToken, @RequestBody UpdateUserForm userForm) {
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        assert authUser != null;
-        return userService.updateById(userForm) ? ResultUtil.success() : ResultUtil.error(ResultCode.UPDATE_USER_ERROR);
-    }
-
-    /**
-     * 查看订单信息
-     *
-     * @param id
-     * @return
-     */
-    @Operation(summary = "查看订单信息")
-    @PostMapping("/showOrder/{id}")
-    public ResultMessage showOrder(
-            @ApiParam(value = "订单id", required = true) @PathVariable("id") String id) {
-        return userService.showOrder(id);
-    }
-
-
-
-    @Operation(summary = "查看对应类型的订单信息")
-    @GetMapping("/showOrder/{orderTypeEnum}/{id}")
-    public ResultMessage showOrderByType(
-            @PathVariable("id") String id,
-            @PathVariable OrderTypeEnums orderTypeEnum) throws NullPointerException {
-        return userService.showOrderByType(id, orderTypeEnum);
-    }
-
-
-    /**
-     * 查看我的卡情况
-     * id
-     *
-     * @param cardTypeEnum
-     * @return
-     */
-    @Operation(summary = "查看我的卡")
-    @PostMapping("/show/{cardTypeEnum}/{id}")
-    public ResultMessage<List<Card>> showMyCard(
-            @ApiParam(value = "用户id", required = true) @NotNull @PathVariable Long id,
-            @PathVariable CardTypeEnum cardTypeEnum) {
-        return userService.showMyCard(id, cardTypeEnum);
-    }
-
-
-
-    @Operation(summary = "查看我的优惠卷")
-    @PostMapping("/showMyCoupon/{accessToken}")
-    private ResultMessage<CouponUser> showMyCoupon(@NotNull @PathVariable String accessToken) {
-        return userService.showMyCoupon(accessToken);
-
-    }
-}

+ 0 - 50
framework/src/main/java/com/wteam/framework/modules/book/entity/Address.java

@@ -1,50 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import io.swagger.annotations.ApiModel;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (CbAddress)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:29:36
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_address")
-@ApiModel(description = "地址信息")
-public class Address {
-    @TableId
-    private Long addressId;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private String updateTime;
-    //用户id
-    private String userId;
-    //收货人的姓名
-    private String recipientName;
-    //街道地址
-    private String streetAddress;
-    //城市
-    private String city;
-    //州/省份
-    private String stateProvince;
-    //手机号码
-    private String phoneNumber;
-    //是否为默认地址
-    private Integer isDefault;
-}

+ 0 - 58
framework/src/main/java/com/wteam/framework/modules/book/entity/AdminUser.java

@@ -1,58 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (CbAdminUser)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:36:39
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_admin_user")
-public class AdminUser {
-
-    //ID
-    private Long id;
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //更新者
-    private String updateBy;
-    //更新时间
-    private String updateTime;
-    //用户头像
-    private String avatar;
-    //备注
-    private String description;
-    //邮件
-    private String email;
-    //是否是超级管理员 超级管理员/普通管理员
-    private Boolean isSuper;
-    //手机
-    private String mobile;
-    //昵称
-    private String nickName;
-    //密码
-    private String password;
-    //状态 默认true正常 false禁用
-    private Boolean status;
-    //用户名
-    private String username;
-    //角色ID集合
-    private String roleIds;
-    //是否被禁用
-    private Boolean isBan;
-
-
-}

+ 0 - 65
framework/src/main/java/com/wteam/framework/modules/book/entity/Card.java

@@ -1,65 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Card)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:37:49
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_card")
-public class Card {
-    @TableId
-    private Integer id;
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //卡名称
-    private String cardName;
-    //卡类型(储值卡、月卡、次卡枚举)
-    private String cardType;
-    //有效期
-    private Integer days;
-    //生效日期
-    private String startDate;
-    //结束日期
-    private String endDate;
-    //面值
-    private Integer faceValue;
-    //赠送金额
-    private Integer bonusAmount;
-    //当前余额
-    private Double currentBalance;
-    //用户id
-    private String userId;
-    //对应订单id
-    //TODO :把原先的适用门店id改为此卡购买时的订单id
-    private Long storeId;
-    //折扣值
-    private Float discountValue;
-    //TODO :新增次卡使用次数
-    private Integer times;
-    //订单id
-    private String orderId;
-}

+ 0 - 59
framework/src/main/java/com/wteam/framework/modules/book/entity/Coupon.java

@@ -1,59 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Coupon)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:38:17
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_coupon")
-public class Coupon {
-    @TableId
-    private Long id;
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //更新者
-    private String updateBy;
-    //更新时间
-    private String updateTime;
-    //优惠天数
-    private Integer days;
-    //邀请人数
-    private Integer numberInvitees;
-    //是否可叠加
-    private Integer overlay;
-    //兑换码
-    private String code;
-    //生效日期
-    private String startDate;
-    //结束日期
-    private String endDate;
-    //使用次数限制
-    private String usageLimit;
-    //是否有效(0、1)
-    private Boolean isActive;
-    //优惠卷使用次数
-    private String usageCount;
-    //折扣类型
-    private String discountType;
-    //折扣值
-    private String discountValue;
-
-
-}

+ 0 - 47
framework/src/main/java/com/wteam/framework/modules/book/entity/CouponUser.java

@@ -1,47 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * 优惠券用户中间表(CouponUser)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:38:29
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_coupon_user")
-public class CouponUser {
-    //id@TableId
-    private Long id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //更新者
-    private String updateBy;
-    //更新时间
-    private String updateTime;
-    //谁持有优惠券
-    private Long userId;
-    //优惠券id
-    private Long couponId;
-    //是否可用
-    private Integer effective;
-    //优惠券说明
-    private String illustrate;
-
-
-}

+ 0 - 26
framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonDeserializer.java

@@ -1,26 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.IOException;
-
-/**
- * 字符串转为Long
- */
-@Slf4j
-public class LongJsonDeserializer extends JsonDeserializer<Long> {
-
-    @Override
-    public Long deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
-        String value = jsonParser.getText();
-        try {
-            return value == null ? null : Long.parseLong(value);
-        } catch (NumberFormatException e) {
-            log.error("解析长整形错误", e);
-            return null;
-        }
-    }
-}

+ 0 - 21
framework/src/main/java/com/wteam/framework/modules/book/entity/LongJsonSerializer.java

@@ -1,21 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-
-import java.io.IOException;
-
-/**
- * Long 类型字段序列化时转为字符串,避免js丢失精度
- */
-public class LongJsonSerializer extends JsonSerializer<Long> {
-
-    @Override
-    public void serialize(Long value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
-        String text = (value == null ? null : String.valueOf(value));
-        if (text != null) {
-            jsonGenerator.writeString(text);
-        }
-    }
-}

+ 0 - 53
framework/src/main/java/com/wteam/framework/modules/book/entity/Notice.java

@@ -1,53 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Notice)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:38:38
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_notice")
-public class Notice {
-    //id@TableId
-    private Integer id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //通知日期
-    private Date noticeTime;
-    //通知人
-    private String noticePerson;
-    //通知内容
-    private String noticeContent;
-    //通知标题
-    private String noticeTitle;
-    //通知状态 为0代表通知未被删除,1代表通知被删除了
-    private Boolean noticeState;
-    //门店id
-    private Long storeId;
-
-
-}

+ 0 - 97
framework/src/main/java/com/wteam/framework/modules/book/entity/OrderInfo.java

@@ -1,97 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import com.alibaba.fastjson.serializer.ToStringSerializer;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableName;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * (OrderInfo)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:38:46
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_order_info")
-public class OrderInfo {
-
-    //    @JsonSerialize(using = LongJsonSerializer.class)
-//    @JsonDeserialize(using = LongJsonDeserializer.class)
-    @TableId
-    private String id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //用户id
-    private String userId;
-    //门店id
-    private Long storeId;
-    //预约日期
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    private Date orderDate;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "预约开始时间")
-    private Date orderSt;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "预约结束时间")
-    private Date orderEd;
-    //订单状态(枚举)
-    private String orderState;
-    //订单价格
-    private Double orderPrice;
-    //订单类型(枚举)
-    private String orderType;
-    //支付方式
-    private String paymentMethods;
-    //分享次数
-    private Integer share;
-    //场地id
-    private Long venueId;
-    //手机号码
-    private String phoneNumber;
-    //二维码
-    private String qrCode;
-    //用户进场时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "用户进场时间")
-    private Date startTime;
-    //用户离开时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "用户离场时间")
-    private Date endTime;
-    //购买卡的id
-    private Integer cardId;
-    //不知名id
-    private String transactionId;
-    //订单超时金额
-    private Double overPrice;
-    //订单超时时间
-    private Integer overTime;
-}

+ 0 - 44
framework/src/main/java/com/wteam/framework/modules/book/entity/OrderUser.java

@@ -1,44 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (OrderUser)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:38:53
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_order_user")
-public class OrderUser {
-    //id@TableId
-    private Integer id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //订单id
-    private Long orderId;
-    //用户id
-    private Long userId;
-
-
-}

+ 0 - 58
framework/src/main/java/com/wteam/framework/modules/book/entity/PaymentInfo.java

@@ -1,58 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (PaymentInfo)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:39:04
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_payment_info")
-public class PaymentInfo {
-    //支付记录id@TableId
-    private String id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //更新时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //支付类型
-    private String paymentType;
-    //交易类型(这里可能会有退款)
-    private String tradeType;
-    //交易状态
-    private String tradeState;
-    //支付金额(分)
-    private Integer payerTotal;
-    //通知参数
-    private String content;
-    //商户订单编号id
-    private String orderId;
-    //支付系统交易编号
-    private String transactionId;
-    //支付金额
-    private Double orderPrice;
-    //时间
-    private Date time;
-
-
-}

+ 0 - 45
framework/src/main/java/com/wteam/framework/modules/book/entity/Role.java

@@ -1,45 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Role)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:39:22
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_role")
-public class Role {
-    //ID@TableId
-    private Long id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //更新者
-    private String updateBy;
-    //更新时间
-    private String updateTime;
-    //是否为注册默认角色
-    private Boolean defaultRole;
-    //备注
-    private String description;
-    //角色名
-    private String name;
-
-
-}

+ 0 - 45
framework/src/main/java/com/wteam/framework/modules/book/entity/RoleMenu.java

@@ -1,45 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (RoleMenu)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:39:32
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_role_menu")
-public class RoleMenu {
-    //ID@TableId
-    private Long id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private String createTime;
-    //删除标志 true/false 删除/未删除
-    private Boolean deleteFlag;
-    //更新者
-    private String updateBy;
-    //更新时间
-    private String updateTime;
-    //是否拥有操作数据权限
-    private Boolean isSuper;
-    //菜单
-    private String menuId;
-    //角色ID
-    private String roleId;
-
-
-}

+ 0 - 66
framework/src/main/java/com/wteam/framework/modules/book/entity/Store.java

@@ -1,66 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.time.LocalTime;
-import java.util.Date;
-
-import java.io.Serializable;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-/**
- * (Store)表实体类
- *
- * @author doncic
- * @since 2023-10-02 17:45:13
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_store")
-public class Store  {
-    //id@TableId
-    private Long id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //门店名称
-    private String storeName;
-    //场馆介绍
-    private String venueIntroduction;
-    //开店时间
-    private String openingTime;
-    //关店时间
-    private String closingTime;
-    //门店图片
-    private String storeImages;
-    //服务热线
-    private String serviceHotline;
-    //微信号
-    private String wxCode;
-    //实时人数
-    private String realTime;
-    //提前预订天数
-    private String advanceDays;
-    //起订时间
-    private Integer leadTime;
-    //公告
-    private String announcement;
-    //门店地址
-    private String address;
-    //订场须知
-    private String scheduledNotice;
-
-
-
-}

+ 0 - 46
framework/src/main/java/com/wteam/framework/modules/book/entity/Vdstate.java

@@ -1,46 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Vdstate)表实体类
- *
- * @author doncic
- * @since 2023-09-16 20:40:04
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_vdstate")
-public class Vdstate {
-    //id@TableId
-    private Integer id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //门店id
-    private Long storeId;
-    //日期
-    private Date date;
-    //分时状态 第i位代表第i~i+1小时的场馆状态0代表不可用1代表可用2代表已经被预约
-    private String vdstateSt;
-
-
-}

+ 0 - 65
framework/src/main/java/com/wteam/framework/modules/book/entity/Venue.java

@@ -1,65 +0,0 @@
-package com.wteam.framework.modules.book.entity;
-
-import java.util.Date;
-
-import java.io.Serializable;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * (Venue)表实体类
- *
- * @author doncic
- * @since 2023-10-02 17:45:53
- */
-@SuppressWarnings("serial")
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@TableName("cb_venue")
-public class Venue {
-    //id@TableId
-    private Integer id;
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //场地名称
-    private String venueName;
-    //门店id
-    private Long storeId;
-    //上午时间段半场价格
-    private Double amHalfPrice;
-    //下午篮球半场价格
-    private Double pmHalfPrice;
-    //上午篮球场,羽毛球场,乒乓球全场价格
-    private Double amAllPrice;
-    //下午篮球场全场,羽毛球,乒乓球场价格
-    private Double pmAllPrice;
-    //场地关联id
-    private String relevancyId;
-    //场地购买须知
-    private String purchaseInstructions;
-    //特殊价格
-    private String specialValue;
-    //场地类型0为篮球场,1为羽毛球场,2为乒乓球场
-    private String venueType;
-    //TODO:新添加的
-    //场地起订时间
-    private Double leadTime;
-    @Schema(description = "场地分享次数")
-    private Integer shareFrequency;
-
-
-}

+ 0 - 21
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderCardReq.java

@@ -1,21 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-import io.swagger.annotations.ApiModel;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/10/1 19:15
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@ApiModel
-public class OrderCardReq {
-    //卡的id
-    private Integer cardId;
-    //门店id
-    private Long storeId;
-}

+ 0 - 56
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/OrderReq.java

@@ -1,56 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-
-/**
- * @author doncic
- * @date 2023/9/20 12:59
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-@ApiModel
-public class OrderReq {
-    //场地id
-    private Long venueId;
-    //门店id
-    private Long storeId;
-    //门店名称
-    private String storeName;
-    //门店地址
-    private String address;
-    //预约日期
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    private Date orderDate;
-    //预约开始时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "预约开始时间")
-    private Date orderSt;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "预约结束时间")
-    private Date orderEd;
-    //订单类型(枚举)
-    private String orderType;
-    //手机号码
-    private String phoneNumber;
-    //订单价格
-    private Double orderPrice;
-    //优惠卷id
-    private Long id;
-    //场地关联id
-    private String relevancyId;
-
-}

+ 0 - 116
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/RefundResult.java

@@ -1,116 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-import com.egzosn.pay.common.bean.CurType;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Map;
-
-/**
- * 退款结果
- * <p>
- *
- * @author Egan
- * <pre>
- * email egzosn@gmail.com
- * date 2020/8/16 9:55
- * </pre>
- */
-public interface RefundResult extends Serializable {
-    /**
-     * 获取退款结果原信息集
-     *
-     * @return 属性
-     */
-    Map<String, Object> getAttrs();
-
-    /**
-     * 获取退款结果属性值
-     *
-     * @param key 属性名
-     * @return 属性值
-     */
-    Object getAttr(String key);
-
-    /**
-     * 获取退款结果属性值
-     *
-     * @param key 属性名
-     * @return 属性值
-     */
-    String getAttrString(String key);
-
-    /**
-     * 获取退款结果属性值
-     *
-     * @param key 属性名
-     * @return 属性值
-     */
-    BigDecimal getAttrDecimal(String key);
-
-
-    /**
-     * 获取退款请求结果状态码
-     *
-     * @return 状态码
-     */
-    String getCode();
-
-    /**
-     * 获取退款请求结果状态提示信息
-     *
-     * @return 提示信息
-     */
-    String getMsg();
-
-    /**
-     * 返回业务结果状态码
-     *
-     * @return 业务结果状态码
-     */
-    String getResultCode();
-
-    /**
-     * 返回业务结果状态提示信息
-     *
-     * @return 业务结果状态提示信息
-     */
-    String getResultMsg();
-
-    /**
-     * 退款金额
-     *
-     * @return 退款金额
-     */
-    BigDecimal getRefundFee();
-
-    /**
-     * 退款币种信息
-     *
-     * @return 币种信息
-     */
-    CurType getRefundCurrency();
-
-    /**
-     * 支付平台交易号
-     * 发起支付时 支付平台(如支付宝)返回的交易订单号
-     *
-     * @return 支付平台交易号
-     */
-    String getTradeNo();
-
-    /**
-     * 支付订单号
-     * 发起支付时,用户系统的订单号
-     *
-     * @return 支付订单号
-     */
-    String getOutTradeNo();
-
-    /**
-     * 商户退款单号
-     *
-     * @return 商户退款单号
-     */
-    String getRefundNo();
-}

+ 0 - 30
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoreForm.java

@@ -1,30 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/9/18 22:20
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class StoreForm {
-    private Long id;
-    //卡名称
-    private String cardName;
-    //卡类型(储值卡、月卡、次卡枚举)
-    private String cardType;
-    //有效期
-    private Integer days;
-    //生效日期
-    private String startDate;
-    //结束日期
-    private String endDate;
-    //面值
-    private Integer faceValue;
-    //赠送金额
-    private Integer bonusAmount;
-}

+ 0 - 24
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StorePhotoDto.java

@@ -1,24 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.websocket.OnOpen;
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/18 16:56
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class StorePhotoDto {
-    /**
-     * 门店id
-     * 该门店对应的图片信息
-     */
-    private Long store_id;
-    private List<String> images;
-}

+ 0 - 21
framework/src/main/java/com/wteam/framework/modules/book/entity/dto/StoredCardDto.java

@@ -1,21 +0,0 @@
-package com.wteam.framework.modules.book.entity.dto;
-
-import com.wteam.framework.modules.book.entity.Card;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/18 16:54
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class StoredCardDto {
-
-    private List<Card> cardList;
-    private String storeName;
-}

+ 0 - 33
framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/TimeCalculation.java

@@ -1,33 +0,0 @@
-package com.wteam.framework.modules.book.entity.reqp;
-
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.LocalTime;
-import java.time.ZoneOffset;
-
-public class TimeCalculation {
-    public static void main(String[] args) {
-        // 假设您有一个订单的开始时间和结束时间
-        LocalTime orderSt = LocalTime.of(10, 0); // 假设订单开始时间是10:00 AM
-        LocalTime orderEd = LocalTime.of(12, 30); // 假设订单结束时间是12:30 PM
-
-        // 计算比orderSt早5分钟
-        LocalTime fiveMinutesBeforeOrderSt = orderSt.minusMinutes(5);
-
-        // 计算比orderEd晚15分钟
-        LocalTime fifteenMinutesAfterOrderEd = orderEd.plusMinutes(15);
-
-        // 转换为时间戳
-        long timestampFiveMinutesBeforeOrderSt = fiveMinutesBeforeOrderSt.atDate(LocalDate.now())
-                .toInstant(ZoneOffset.UTC)
-                .toEpochMilli();
-
-        long timestampFifteenMinutesAfterOrderEd = fifteenMinutesAfterOrderEd.atDate(LocalDate.now())
-                .toInstant(ZoneOffset.UTC)
-                .toEpochMilli();
-
-        // 打印结果
-        System.out.println("比orderSt早5分钟的时间戳:" + timestampFiveMinutesBeforeOrderSt);
-        System.out.println("比orderEd晚15分钟的时间戳:" + timestampFifteenMinutesAfterOrderEd);
-    }
-}

+ 0 - 18
framework/src/main/java/com/wteam/framework/modules/book/entity/reqp/hardwareReq.java

@@ -1,18 +0,0 @@
-package com.wteam.framework.modules.book.entity.reqp;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/9/27 19:17
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class hardwareReq {
-    private String devmac;
-    private String time;
-    private String qcode;
-}

+ 0 - 42
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/CardVo.java

@@ -1,42 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @author doncic
- * @date 2023/9/23 20:41
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class CardVo {
-    //卡名称
-    private String cardName;
-    //卡类型(储值卡、月卡、次卡枚举)
-    private String cardType;
-    //有效期
-    private Integer days;
-    //生效日期
-    private String startDate;
-    //结束日期
-    private String endDate;
-    //面值
-    private Integer faceValue;
-    //赠送金额
-    private Integer bonusAmount;
-    //当前余额
-    private Double currentBalance;
-    //TODO :新增次卡使用次数
-    private Integer times;
-    @Schema(description = "详情简介")
-    private String detailedIntroduction;
-    @Schema(description = "使用说明")
-    private String usageInstructions;
-    //购买该卡对应的订单id
-    private String orderId;
-}

+ 0 - 89
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderInfoVo.java

@@ -1,89 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.Venue;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * @author doncic
- * @date 2023/10/5 17:25
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class OrderInfoVo {
-
-    @TableId
-    private String id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //用户id
-    private String userId;
-    //门店id
-    private Long storeId;
-    //预约日期
-    @Schema(description = "预约日期")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    private Date orderDate;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "预约开始时间")
-    private Date orderSt;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "预约结束时间")
-    private Date orderEd;
-    //订单状态(枚举)
-    private String orderState;
-    //订单价格
-    private Double orderPrice;
-    //订单类型(枚举)
-    private String orderType;
-    //支付方式
-    private String paymentMethods;
-    //分享次数
-    private Integer share;
-    //场地id
-    private Long venueId;
-    //手机号码
-    private String phoneNumber;
-    //二维码
-    private String qrCode;
-    //用户进场时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "用户进场时间")
-    private Date startTime;
-    //用户离开时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "用户离场时间")
-    private Date endTime;
-    //购买卡的id
-    private Integer cardId;
-    //不知名id
-    private Long transactionId;
-    //订单超时金额
-    private Double overPrice;
-    private String venueName;
-    private String venueType;
-}

+ 0 - 89
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderTicketVo.java

@@ -1,89 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * @author doncic
- * @date 2023/10/6 14:15
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class OrderTicketVo {
-    @TableId
-    private String id;
-
-    //创建者
-    private String createBy;
-    //创建时间
-    private Date createTime;
-    //修改者
-    private String updateBy;
-    //修改时间
-    private Date updateTime;
-    //删除标志 true/false 删除/未删除
-    private Integer deleteFlag;
-    //用户id
-    private String userId;
-    //门店id
-    private Long storeId;
-    //预约日期
-    @Schema(description = "预约日期")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    private Date orderDate;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "预约开始时间")
-    private Date orderSt;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "预约结束时间")
-    private Date orderEd;
-    //订单状态(枚举)
-    private String orderState;
-    //订单价格
-    private Double orderPrice;
-    //订单类型(枚举)
-    private String orderType;
-    //支付方式
-    private String paymentMethods;
-    //分享次数
-    private Integer share;
-    //场地id
-    private Long venueId;
-    //手机号码
-    private String phoneNumber;
-    //二维码
-    private String qrCode;
-    //用户进场时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "用户进场时间")
-    private Date startTime;
-    //用户离开时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
-    @Schema(description = "用户离场时间")
-    private Date endTime;
-    //购买卡的id
-    private Integer cardId;
-    //不知名id
-    private Long transactionId;
-    //订单超时金额
-    private Double overPrice;
-    //有效期
-    private Integer days;
-    //生效日期
-    private String startDate;
-    //结束日期
-    private String endDate;
-
-}

+ 0 - 18
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/OrderVo.java

@@ -1,18 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/10/1 19:31
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class OrderVo {
-
-    private String orderId;
-    private Integer cardId;
-}

+ 0 - 30
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/PaymentRequest.java

@@ -1,30 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class PaymentRequest {
-    private double amount;
-    private String extParam;
-    private String mchOrderNo;
-    private String subject;
-    private String wayCode;
-    private String sign;
-    private String reqTime;
-    private String body;
-    private String version;
-    private String channelExtra;
-    private String appId;
-    private String clientIp;
-    private String notifyUrl;
-    private String signType;
-    private String currency;
-    private String returnUrl;
-    private String mchNo;
-    private int divisionMode;
-}

+ 0 - 20
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreDetailsVo.java

@@ -1,20 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.wteam.framework.modules.book.entity.Venue;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/9/26 18:50
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class StoreDetailsVo {
-    private StoreVo storeVo;
-    private List<Venue> venueList;
-}

+ 0 - 42
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/StoreVo.java

@@ -1,42 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.sql.Time;
-import java.time.LocalTime;
-
-/**
- * @author doncic
- * @date 2023/9/19 22:32
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class StoreVo {
-    //门店名称
-    private String storeName;
-    //地址
-    private String address;
-    //场馆介绍
-    private String venueIntroduction;
-    //开店时间
-    private String openingTime;
-    //关店时间
-    private String closingTime;
-    //服务热线
-    private String serviceHotline;
-    //微信号
-    private String wxCode;
-    //实时人数
-    private String realTime;
-    //提前预订天数
-    private String advanceDays;
-    //起订时间
-    private Integer leadTime;
-    //公告
-    private String announcement;
-    //订场须知
-    private String scheduledNotice;
-}

+ 0 - 18
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimeCodeVo.java

@@ -1,18 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/9/30 1:11
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class TimeCodeVo {
-    private OrderInfo orderInfo;
-    private String nickName;
-}

+ 0 - 41
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/TimerOrderInfoVo.java

@@ -1,41 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
-
-/**
- * @author doncic
- * @date 2023/10/14 13:46
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class TimerOrderInfoVo {
-    @TableId
-    private String id;
-    //订单价格
-    private Double orderPrice;
-    //订单状态(枚举)
-    private String orderState;
-    //订单类型(枚举)
-    private String orderType;
-    //用户进场时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "用户进场时间")
-    private Date startTime;
-    //用户离开时间
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "用户离场时间")
-    private Date endTime;
-    //订单超时金额
-    private Double overPrice;
-}

+ 0 - 17
framework/src/main/java/com/wteam/framework/modules/book/entity/vo/VenueVo.java

@@ -1,17 +0,0 @@
-package com.wteam.framework.modules.book.entity.vo;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author doncic
- * @date 2023/10/5 17:26
- */
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class VenueVo {
-    private String venueName;
-    private String venueType;
-}

+ 0 - 21
framework/src/main/java/com/wteam/framework/modules/book/mapper/CardMapper.java

@@ -1,21 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-
-import java.util.List;
-
-
-/**
- * (Card)表数据库访问层
- *
- * @author doncic
- * @since 2023-09-18 19:19:57
- */
-public interface CardMapper extends BaseMapper<Card> {
-
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.Coupon;
-
-
-/**
- * (Coupon)表数据库访问层
- *
- * @author doncic
- * @since 2023-09-20 14:18:05
- */
-public interface CouponMapper extends BaseMapper<Coupon> {
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/CouponUserMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.CouponUser;
-
-
-/**
- * 优惠券用户中间表(CouponUser)表数据库访问层
- *
- * @author doncic
- * @since 2023-09-25 17:18:54
- */
-public interface CouponUserMapper extends BaseMapper<CouponUser> {
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/OrderInfoMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-
-
-/**
- * (OrderInfo)表数据库访问层
- *
- * @author doncic
- * @since 2023-09-20 13:12:50
- */
-public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/PaymentInfoMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.PaymentInfo;
-
-
-/**
- * (PaymentInfo)表数据库访问层
- *
- * @author doncic
- * @since 2023-09-20 19:20:06
- */
-public interface PaymentInfoMapper extends BaseMapper<PaymentInfo> {
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/StoreMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.Store;
-
-
-/**
- * (Store)表数据库访问层
- *
- * @author doncic
- * @since 2023-10-02 17:45:13
- */
-public interface StoreMapper extends BaseMapper<Store> {
-
-}
-

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/mapper/VenueMapper.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.book.entity.Venue;
-
-
-/**
- * (Venue)表数据库访问层
- *
- * @author doncic
- * @since 2023-10-02 17:45:53
- */
-public interface VenueMapper extends BaseMapper<Venue> {
-
-}
-

+ 0 - 40
framework/src/main/java/com/wteam/framework/modules/book/service/CardService.java

@@ -1,40 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.jeequan.jeepay.exception.JeepayException;
-import com.wteam.framework.common.enums.CardTypeEnum;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.dto.OrderCardReq;
-import org.springframework.stereotype.Service;
-
-
-/**
- * (Card)表服务接口
- * @author doncic
- * @since 2023-09-18 19:19:57
- */
-@Service
-public interface CardService extends IService<Card> {
-
-    ResultMessage showCard(Long id, CardTypeEnum cardTypeEnum);
-
-    ResultMessage showCardDetails(Long id);
-
-    ResultMessage buyCard(String accessToken, String id, Long cardId);
-
-    ResultMessage chargeCard(String accessToken, Long id);
-
-    ResultMessage generateCardOrder(String accessToken, OrderCardReq orderCardReq);
-
-    ResultMessage valueCardPay(String orderId, Integer cardId);
-
-    ResultMessage getQrCodeByCard(String cardId);
-
-    ResultMessage cardCharge(String orderId, Integer cardId);
-
-    ResultMessage getChargeCardOrder(String accessToken, Integer cardId,Double currentBalance);
-
-    ResultMessage personCardPay(String orderId, Integer cardId);
-}

+ 0 - 16
framework/src/main/java/com/wteam/framework/modules/book/service/CouponService.java

@@ -1,16 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.modules.book.entity.Coupon;
-
-
-/**
- * (Coupon)表服务接口
- *
- * @author doncic
- * @since 2023-09-20 14:18:05
- */
-public interface CouponService extends IService<Coupon> {
-
-
-}

+ 0 - 33
framework/src/main/java/com/wteam/framework/modules/book/service/OrderInfoService.java

@@ -1,33 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.common.enums.orderTypeEnum;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.dto.OrderReq;
-import com.wteam.framework.modules.pay.entity.vo.CallbackParamVO;
-
-
-import java.util.Date;
-
-
-/**
- * (OrderInfo)表服务接口
- *
- * @author doncic
- * @since 2023-09-20 13:12:50
- */
-public interface OrderInfoService extends IService<OrderInfo> {
-
-
-    ResultMessage generateOrder(String accessToken, OrderReq orderReq);
-
-    Boolean checkOrder(Long id);
-
-    void processOrders(CallbackParamVO callbackParamVO);
-
-
-    ResultMessage bookStatus(Long id, Date dateTime);
-
-    ResultMessage getTimer(String userId);
-}

+ 0 - 21
framework/src/main/java/com/wteam/framework/modules/book/service/PaymentInfoService.java

@@ -1,21 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.PaymentInfo;
-
-
-/**
- * (PaymentInfo)表服务接口
- *
- * @author doncic
- * @since 2023-09-20 19:20:06
- */
-public interface PaymentInfoService extends IService<PaymentInfo> {
-
-    void wxpay(Long id);
-
-    ResultMessage refund(Long id);
-
-    ResultMessage cardPay(String accessToken, Long userId, Long orderId);
-}

+ 0 - 20
framework/src/main/java/com/wteam/framework/modules/book/service/StoreService.java

@@ -1,20 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Store;
-
-
-/**
- * (Store)表服务接口
- *
- * @author doncic
- * @since 2023-09-16 22:56:03
- */
-public interface StoreService extends IService<Store> {
-
-    ResultMessage getPhoto(Long id);
-
-
-    ResultMessage getDetails(Long id);
-}

+ 0 - 15
framework/src/main/java/com/wteam/framework/modules/book/service/VenueService.java

@@ -1,15 +0,0 @@
-package com.wteam.framework.modules.book.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.modules.book.entity.Venue;
-
-
-/**
- * (Venue)表服务接口
- *
- * @author doncic
- * @since 2023-09-20 14:17:47
- */
-public interface VenueService extends IService<Venue> {
-
-}

+ 0 - 739
framework/src/main/java/com/wteam/framework/modules/book/service/impl/CardServiceImpl.java

@@ -1,739 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.jeequan.jeepay.Jeepay;
-import com.jeequan.jeepay.JeepayClient;
-import com.jeequan.jeepay.exception.JeepayException;
-import com.jeequan.jeepay.model.PayOrderCreateReqModel;
-import com.jeequan.jeepay.request.PayOrderCreateRequest;
-import com.jeequan.jeepay.response.PayOrderCreateResponse;
-import com.wteam.framework.common.enums.*;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.common.security.AuthUser;
-import com.wteam.framework.common.security.context.UserContext;
-import com.wteam.framework.common.utils.BeanUtil;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.Store;
-import com.wteam.framework.modules.book.entity.Venue;
-import com.wteam.framework.modules.book.entity.dto.OrderCardReq;
-import com.wteam.framework.modules.book.entity.dto.StoredCardDto;
-import com.wteam.framework.modules.book.entity.vo.CardVo;
-import com.wteam.framework.modules.book.entity.vo.OrderVo;
-import com.wteam.framework.modules.book.mapper.CardMapper;
-import com.wteam.framework.modules.book.mapper.OrderInfoMapper;
-import com.wteam.framework.modules.book.mapper.StoreMapper;
-import com.wteam.framework.modules.book.mapper.VenueMapper;
-import com.wteam.framework.modules.book.service.CardService;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import com.wteam.framework.modules.card.entity.CbCardAdmin;
-import com.wteam.framework.modules.card.mapper.CardAdminMapper;
-import com.wteam.framework.modules.hardware.ApiCallerUtil;
-import com.wteam.framework.modules.hardware.QrCodeRegistrationUtil;
-import com.wteam.framework.modules.pay.serviceimpl.CashierSupport;
-import com.wteam.framework.modules.system.entity.dto.WechatPaymentSetting;
-import com.wteam.framework.modules.system.service.SettingService;
-import com.wteam.framework.modules.user.entity.User;
-import com.wteam.framework.modules.user.mapper.UserMapper;
-import lombok.EqualsAndHashCode;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.stereotype.Service;
-
-import javax.validation.constraints.NotNull;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-import java.time.format.DateTimeParseException;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-import static com.wteam.framework.modules.book.service.impl.OrderInfoServiceImpl.getWechatPaymentSetting;
-
-/**
- * (Card)表服务实现类
- *
- * @author doncic
- * @since 2023-09-18 19:19:57
- */
-@Slf4j
-@Service("cardService")
-public class CardServiceImpl extends ServiceImpl<CardMapper, Card> implements CardService {
-
-    @Autowired
-    private CardMapper cardMapper;
-    @Autowired
-    private StoreMapper storeMapper;
-    @Autowired
-    private OrderInfoMapper orderInfoMapper;
-    @Autowired
-    private SettingService settingService;
-    @Autowired
-    private OrderInfoService orderInfoService;
-    @Autowired
-    private RedisTemplate redisTemplate;
-    @Autowired
-    private CardService cardService;
-    @Autowired
-    private VenueMapper venueMapper;
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private CardAdminMapper cardAdminMapper;
-
-    @Override
-    public ResultMessage showCard(@NotNull Long id, CardTypeEnum cardTypeEnum) {
-        //根据id查到此店名称
-        Store store = storeMapper.selectById(id);
-        if (ObjectUtil.isNull(store)) {
-            return ResultUtil.error(ResultCode.ENTITY_NULL);
-        }
-        String storeName = store.getStoreName();
-        //创建lambdaQueryWrapper对象
-        LambdaQueryWrapper<Card> queryWrapper = new LambdaQueryWrapper<>();
-        //传入id和card表里面storeId比对
-        queryWrapper.eq(Card::getStoreId, id);
-        //获取cards集合
-        List<Card> cards = cardMapper.selectList(queryWrapper);
-        if (ObjectUtil.isNull(cards)) {
-            return ResultUtil.error(ResultCode.ENTITY_NULL);
-        }
-        log.info("此时获取到的卡有:{}", cards);
-        String cardType = String.valueOf(cardTypeEnum);
-        List<Card> cardList = cards.stream().filter(card -> Objects.equals(card.getCardType(), cardType)).collect(Collectors.<Card>toList());
-        log.info("此时获取到的卡是:{}", cardList);
-        StoredCardDto storedCardDto = new StoredCardDto(cardList, storeName);
-        return ResultUtil.data(storedCardDto);
-    }
-
-    @Override
-    public ResultMessage showCardDetails(@NotNull Long id) {
-        //查找卡信息
-        CbCardAdmin card = cardAdminMapper.selectById(id);
-        if (ObjectUtil.isNull(card)) {
-            throw new ServiceException("查不到对应卡信息");
-        }
-        CardVo cardVo = new CardVo();
-        //bean拷贝
-        BeanUtil.copyProperties(card, cardVo);
-        return ResultUtil.data(cardVo);
-    }
-
-    @Override
-    public ResultMessage buyCard(@NotNull String accessToken, @NotNull String orderId, Long cardId) {
-        // 校验token
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        assert authUser != null;
-        String id = authUser.getId();
-        log.info("此时的userId信息为:{}", id);
-
-        // 先查询卡是否存在
-        Card card = cardMapper.selectById(cardId);
-        log.info("此时的卡信息为:{}", card);
-
-        if (ObjectUtil.isNull(card)) {
-            throw new ServiceException("查不到对应卡信息");
-        }
-
-        //查询订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        log.info("此时的订单信息为:{}", orderInfo);
-
-        if (ObjectUtil.isNotNull(orderInfo)) {
-            // 调用微信支付的接口
-            String paymentEndpointUrl = "http://139.9.38.185:8889/v1/payment/pay/WECHAT/JSAPI?" + "sn=" + orderId;
-            // 构建GET请求
-            HttpRequest request = HttpRequest.get(paymentEndpointUrl);
-            // 发送请求并获取响应
-            HttpResponse response = request.execute();
-            // 处理响应
-            if (response.isOk()) {
-                String responseBody = response.body();
-                log.info("此时的响应信息为:{}", responseBody);// 保存卡信息
-                Card cardUser = new Card();
-                cardUser.setCardType(card.getCardType());
-                cardUser.setDays(card.getDays());
-                cardUser.setStartDate(String.valueOf(new Date()));
-                cardUser.setEndDate(cardUser.getStartDate() + cardUser.getDays());
-                log.info("此时的cardUser信息为:{}", cardUser);
-                cardService.save(cardUser);
-                // 处理成功响应
-
-            } else {
-                // 处理错误响应
-                System.err.println("Error Response: " + response.getStatus() + " " + response.body());
-            }
-        }
-        return ResultUtil.error(ResultCode.ORDER_NOT_EXIST);
-    }
-
-    @Override
-    public ResultMessage chargeCard(String accessToken, Long id) {
-        try {
-            // 校验token
-            AuthUser authUser = UserContext.getAuthUser(accessToken);
-            assert authUser != null;
-            Long userId = Long.valueOf(authUser.getId());
-
-            // 查找卡信息
-            Card card = cardMapper.selectById(id);
-            if (ObjectUtil.isNull(card)) {
-                return ResultUtil.error(ResultCode.ENTITY_NULL);
-            }
-            Integer faceValue = card.getFaceValue();
-
-            // 获取微信支付设置
-            WechatPaymentSetting wechatPaymentSetting = getWechatPaymentSetting(settingService);
-            JeepayClient jeepayClient = JeepayClient.getInstance(wechatPaymentSetting.getAppId(), wechatPaymentSetting.getApiKey3());
-
-            // 构建支付请求
-            PayOrderCreateRequest request = buildPaymentRequest(card, faceValue, wechatPaymentSetting);
-
-            // 执行支付请求
-            PayOrderCreateResponse response = jeepayClient.execute(request);
-
-            // 验签结果
-            log.info("验签结果:{}", response.checkSign(Jeepay.apiKey));
-
-            if (response.isSuccess(Jeepay.apiKey)) {
-                // 下单成功,保存卡信息
-                saveCardInfo(card, userId, response);
-                log.info("payOrderId:{}", response.get().getPayOrderId());
-                log.info("mchOrderNo:{}", response.get().getMchOrderNo());
-                return ResultUtil.success(ResultCode.YAOCHONGXINKANYIXIADAIMA);
-            } else {
-                log.info("下单失败:{}", request.getBizModel());
-                log.info("通道错误码:{}", response.get().getErrCode());
-                log.info("通道错误信息:{}", response.get().getErrMsg());
-                return ResultUtil.data(response.get().getErrCode());
-            }
-        } catch (JeepayException e) {
-            log.error("支付过程中发生异常: " + e.getMessage(), e);
-            return ResultUtil.error(ResultCode.PAYMENT_ERROR);
-        }
-    }
-
-    /**
-     * 这里的提交购买卡订单  可以是次卡、月卡、储值卡、散客储值卡
-     *
-     * @param accessToken
-     * @param orderCardReq
-     * @return
-     */
-    @Override
-    public ResultMessage generateCardOrder(String accessToken, OrderCardReq orderCardReq) {
-        // 检查参数是否有效
-        if (accessToken == null || orderCardReq == null) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-
-        // 获取用户ID
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        String userId = authUser.getId();
-
-
-//        //判断用户是否已经购买过储值卡
-//        LambdaQueryWrapper<Card> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-//
-//        lambdaQueryWrapper.eq(Card::getUserId, userId)
-//                .and(wrapper -> wrapper.eq(Card::getCardType, CardTypeEnum.STORED_VALUE)
-//                        .or()
-//                        .eq(Card::getCardType, CardTypeEnum.PERSON_CARD));
-//
-//        List<Card> cards = cardMapper.selectList(lambdaQueryWrapper);
-//        if (cards != null && !cards.isEmpty()) {
-//            return ResultUtil.success(ResultCode.USER_ALREADY_BUY_STORE_CARD);
-//        }
-
-
-        // 检查用户是否存在
-        User user = userMapper.selectById(userId);
-        log.info("此时用户信息为{}", user);
-        if (user == null) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-
-        //获取卡信息
-        Integer cardId = orderCardReq.getCardId();
-        CbCardAdmin card = cardAdminMapper.selectById(cardId);
-
-        log.info("此时卡信息为{}", card);
-
-//        //要先校验这个卡是否购买多次
-//        String cardType = "MONTHLY";
-//        LambdaQueryWrapper<Card> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-//        lambdaQueryWrapper.eq(Card::getUserId, userId)
-//                .eq(Card::getCardType, cardType);
-//        List<Card> cards = cardMapper.selectList(lambdaQueryWrapper);
-//        if (cards != null) {
-//            return ResultUtil.success(ResultCode.CARD_ALREADY_EXITS);
-//        }
-
-        //创建订单
-        OrderInfo orderInfo = new OrderInfo();
-        String orderId = RandomUtil.randomNumbers(9);
-        orderInfo.setId(orderId);
-        orderInfo.setCreateTime(new Date());
-        orderInfo.setUserId(userId);
-        orderInfo.setStoreId(orderCardReq.getStoreId());
-        orderInfo.setOrderPrice(Double.valueOf(card.getFaceValue()));
-        orderInfo.setOrderType(card.getCardType());
-        //这里的卡id是指买的哪张卡
-        orderInfo.setCardId(cardId);
-        orderInfo.setPhoneNumber(user.getPhoneNumber());
-
-        //保存订单 返回id
-        boolean save = orderInfoService.save(orderInfo);
-
-        if (save) {
-            OrderVo orderVo = new OrderVo();
-            String id = orderInfo.getId();
-            log.info("这里的订单id为:{}", id);
-            orderVo.setCardId(cardId);
-            orderVo.setOrderId(id);
-            // 订单成功保存后,设置订单的过期时间为15分钟
-            String key = "orderInfo:" + orderInfo.getId();
-            redisTemplate.opsForValue().set(key, orderInfo, 15, TimeUnit.MINUTES);
-            log.info("这里的订单id为:{}", orderInfo.getId());
-            return ResultUtil.data(orderVo);
-        }
-        return ResultUtil.error(ResultCode.ERROR);
-    }
-
-    /**
-     * 储值卡支付的逻辑还是有点问题 需要改变一下
-     * 这里的卡是用户购买之后的卡
-     *
-     * @param orderId
-     * @param cardId
-     * @return
-     */
-    @Override
-    public ResultMessage valueCardPay(@NotNull String orderId, @NotNull Integer cardId) {
-        //获取当前订单信息
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        log.info("此时的订单信息为:{}", orderInfo);
-
-        Long venueId = orderInfo.getVenueId();
-        Venue venue = venueMapper.selectById(venueId);
-        Integer realTime = Integer.valueOf(venue.getShareFrequency());
-        realTime = realTime * 2;
-        log.info("此时的核销次数为:{}", realTime);
-
-        //获得使用的储值卡具体信息
-        Card card = cardMapper.selectById(cardId);
-
-        //设置卡id到订单里面
-        orderInfo.setCardId(cardId);
-        orderInfoMapper.updateById(orderInfo);
-
-        // 获取当前日期
-        LocalDate currentDate = LocalDate.now();
-
-        //生成5位随机数字
-        String numbers1 = RandomUtil.randomNumbers(5);
-        //生成5位随机数字
-        String numbers2 = RandomUtil.randomNumbers(5);
-
-        //生成二维码
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        String formattedDate = currentDate.format(formatter);
-        String data = "pxo_" + formattedDate + "_" + numbers1 + "_" + numbers2 + "_00";
-        log.info("此时生成的二维码为:{} ", data);
-
-        //如果是使用储值卡支付订单超时的情况
-        Double overPrice = orderInfo.getOverPrice();
-        if (overPrice != null) {
-            //获取储值卡信息
-            Float discountValue = card.getDiscountValue() != null ? card.getDiscountValue() / 10 : 1.0f;
-            double v = overPrice * discountValue;
-            Double currentBalance = card.getCurrentBalance();
-            if (v < currentBalance) {
-                //计算支付金额
-                double v1 = currentBalance - v;
-                card.setCurrentBalance(v1);
-                cardMapper.updateById(card);
-                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.USED));
-                orderInfo.setOverPrice(v);
-                String qrCode = QrCodeRegistrationUtil.registerOneQrCode(data);
-                log.info("生成的一次核销的二维码为:{}", qrCode);
-                orderInfo.setQrCode(qrCode);
-                orderInfoMapper.updateById(orderInfo);
-                return ResultUtil.success(ResultCode.PAY_SUCCESS);
-            }
-            return ResultUtil.success(ResultCode.CURRENTBALANCE_NOT);
-        }
-
-
-        log.info("此时的卡信息为:{}", card);
-        try {
-            //先获取卡的截至时间,看此储值卡是否过期
-            String endDate = card.getEndDate();
-            endDate = endDate.trim();
-            log.info("此时得到卡的截至时间为:{}", endDate);
-
-            // 创建DateTimeFormatter对象,用于解析日期时间字符串
-            DateTimeFormatter formatter3 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-
-            // 将截至日期字符串转换为LocalDate对象
-            LocalDate endDateStr = LocalDate.parse(endDate, formatter3);
-
-            // 比较截至日期和当前日期
-            if (currentDate.isAfter(endDateStr)) {
-                return ResultUtil.data("储值卡已经过期!");
-            } else {
-                //获取当前储值卡的余额
-                Double currentBalance = card.getCurrentBalance();
-                log.info("此时的余额为:{}", currentBalance);
-                //这里处理可能为null的情况
-                Float discountValue = card.getDiscountValue() != null ? card.getDiscountValue() / 10 : 1.0f;
-
-                Double orderPrice = orderInfo.getOrderPrice();
-                log.info("订单价格为:{}", orderPrice);
-
-                double v1 = orderPrice * discountValue;
-                log.info("需要支付金额为:{}", v1);
-
-
-                if (v1 > currentBalance) {
-                    return ResultUtil.success(ResultCode.CURRENTBALANCE_NOT);
-                }
-
-                if (v1 < currentBalance) {
-
-                    double v = currentBalance - v1;
-                    log.info("支付之后的余额为:{}", v);
-                    card.setCurrentBalance(v);
-                    cardMapper.updateById(card);
-                    //TODO :这里修改订单价格
-                    //更改订单价格
-                    orderInfo.setOverPrice(v1);
-                    orderInfoMapper.updateById(orderInfo);
-
-                    // 支付成功生成二维码
-                    // 修改订单状态为已支付
-                    orderInfo.setOrderState(String.valueOf(OrderStatusEnum.WAITING_TO_USE));
-                    log.info("此时的OrderState信息为{}", orderInfo.getOrderState());
-
-                    // 修改订单支付方式
-                    orderInfo.setPaymentMethods("CARD");
-                    log.info("此时的PaymentMethods信息为{}", orderInfo.getPaymentMethods());
-
-                    // 获取当前日期
-                    LocalDate currentDate1 = LocalDate.now();
-
-                    //格式转化一下
-                    String id = orderInfo.getId();
-                    log.info("转化之后的id为:{}", id);
-                    String numbers = RandomUtil.randomNumbers(5);
-
-                    // 格式化日期为字符串
-                    DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyyMMdd");
-                    String formattedDate1 = currentDate1.format(formatter1);
-                    String data1 = "pxo_" + formattedDate1 + "_" + numbers + "_" + id + "_00";
-                    log.info("此时生成的二维码为:{} ", data1);
-
-                    // 保存入数据库
-                    orderInfo.setQrCode(data);
-                    int save = orderInfoMapper.updateById(orderInfo);
-
-                    if (save > 0) {
-                        //TODO : 这里的二维码生成需要修改
-                        // 接口地址和参数
-                        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-                        String mac1 = "863569068849199";
-                        String mac2 = "863569068848969";
-                        String tk = ApiCallerUtil.callApi(mac1);
-                        log.info("此时获取到的token为:{} ", tk);
-                        //获取订单开始和结束时间
-                        Date orderSt = orderInfo.getOrderSt();
-                        Date orderEd = orderInfo.getOrderEd();
-
-                        // todo:第1个问题订场提前半小时内可以进,刚才离开开场前33分钟也能进
-                        // 转化为时间戳
-                        // 前30后30
-                        // 获取当前时间的时间戳(秒级)
-                        long currentTimeMillis = System.currentTimeMillis() / 1000;
-
-                        // 将订单开始时间前推30分钟并转换为时间戳
-                        long orderStTimestamp = (orderSt.getTime() / 1000) - (30 * 60);
-                        log.info("开场进场时间戳为:{}", orderStTimestamp);
-
-                        // 将订单结束时间后推30分钟并转换为时间戳
-                        long orderEdTimestamp = (orderEd.getTime() / 1000) + (30 * 60);
-                        log.info("退场出门时间戳为:{}", orderEdTimestamp);
-
-
-                        // 如果需要确保不早于当前时间,可以添加以下逻辑
-                        orderStTimestamp = Math.max(orderStTimestamp, currentTimeMillis);
-                        orderEdTimestamp = Math.max(orderEdTimestamp, currentTimeMillis);
-
-                        // 拼接两个 MAC 地址,以逗号分隔
-                        String macParam = mac1 + "_" + mac2;
-                        log.info("此时拼接的macParam为:{}", macParam);
-
-
-                        //调用hutool接口注册二维码信息
-                        HttpResponse response = HttpRequest.post(apiUrl)
-                                .form("mac", macParam)
-                                .form("tk", tk)
-                                .form("qcodetxt", data)
-                                .form("starttime", orderStTimestamp)
-                                .form("enabletime", orderEdTimestamp)
-                                .form("enablecount", realTime)
-                                .execute();
-
-                        String body = response.body();
-                        JSONObject json = new JSONObject(body);
-                        int code = json.getInt("code");
-                        log.info("此时返回的code为:{}", code);
-                        String qcodetxt = json.getStr("qcodetxt");
-                        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-                        String desc = json.getStr("desc");
-                        log.info("此时返回的desc为:{}", desc);
-
-                        if (code != 0 && code != 4) {
-                            throw new ServiceException("硬件回调url设置接口异常!");
-                        }
-                        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-                        return ResultUtil.data(orderInfo.getId());
-                    }
-                }
-            }
-        } catch (DateTimeParseException e) {
-            //日期字符串解析失败,处理异常情况
-            log.error("Failed to parse date string: {}", e);
-        }
-        return ResultUtil.data(orderInfo.getId());
-    }
-
-
-    public String callApiWithMac(String apiUrl, String mac1, String mac2, String data) {
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-        // 拼接两个 MAC 地址,以逗号分隔
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-
-        //调用hutool接口注册二维码信息
-        HttpResponse response = HttpRequest.post(apiUrl).form("mac", macParam).form("tk", tk).form("qcodetxt", data).form("enablecount", 100).execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return data;
-    }
-
-    /**
-     * 传入卡id和userid,去得到该用户买这个卡的记录 然后比对卡的类型
-     *
-     * @param cardId
-     * @return
-     */
-    @Override
-    public ResultMessage getQrCodeByCard(@NotNull String cardId) {
-        //获取card信息
-        Card card = cardMapper.selectById(cardId);
-        log.info("此时的card信息为:{}", card);
-        //获得此刻的订单信息
-        String orderId = card.getOrderId();
-        //根据orderId出得到二维码
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        String orderType = orderInfo.getOrderType();
-        String cardType = card.getCardType();
-        if ("MONTHLY".equals(cardType) && "MONTHLY".equals(orderType)) {
-            String qrCode = orderInfo.getQrCode();
-            return ResultUtil.data(qrCode);
-        }
-        return ResultUtil.success(ResultCode.GET_MONTHLY_CODE_ERROR);
-    }
-
-    /**
-     * 储值卡充值
-     *
-     * @param orderId
-     * @param cardId
-     * @return
-     */
-    @Override
-    public ResultMessage cardCharge(String orderId, Integer cardId) {
-        return null;
-    }
-
-    @Override
-    public ResultMessage getChargeCardOrder(String accessToken, Integer cardId, Double currentBalance) {
-
-        // 检查参数是否有效
-        if (accessToken == null) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-
-        // 获取用户ID
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        String userId = authUser.getId();
-
-        // 检查用户是否存在
-        User user = userMapper.selectById(userId);
-        if (user == null) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-
-        //获取卡信息
-        Card card = cardMapper.selectById(cardId);
-        log.info("此时的card信息为:{}", card);
-
-        if (ObjectUtil.isNull(card)) {
-            return ResultUtil.error(ResultCode.ENTITY_NULL);
-        }
-
-        OrderInfo orderInfo = new OrderInfo();
-        String orderId = RandomUtil.randomNumbers(9);
-        orderInfo.setId(orderId);
-        orderInfo.setOrderType(String.valueOf(orderTypeEnum.STORED_VALUE));
-        orderInfo.setCardId(card.getId());
-        orderInfo.setStoreId(9376L);
-        orderInfo.setCreateTime(new Date());
-        orderInfo.setUserId(userId);
-        orderInfo.setOrderPrice(currentBalance);
-        log.info("此时的订单信息为:{}", orderInfo);
-        boolean save = orderInfoService.save(orderInfo);
-        if (save) {
-            // 订单成功保存后,设置订单的过期时间为15分钟
-            String key = "orderInfo:" + orderInfo.getId();
-            redisTemplate.opsForValue().set(key, orderInfo, 15, TimeUnit.MINUTES);
-            log.info("这里的订单id为:{}", orderInfo.getId());
-            return ResultUtil.data(orderInfo.getId());
-        }
-        return ResultUtil.success();
-    }
-
-    /**
-     * 散客储值卡支付只能支付计时订单
-     *
-     * @param orderId
-     * @param cardId
-     * @return
-     */
-    @Override
-    public ResultMessage personCardPay(@NotNull String orderId, @NotNull Integer cardId) {
-        // 获取订单信息
-        OrderInfo orderInfo = orderInfoService.getById(orderId);
-
-        // 获取卡信息
-        Card card = cardService.getById(cardId);
-
-        if (orderInfo == null || card == null) {
-            // 处理订单信息或卡信息不存在的情况
-            return ResultUtil.success(ResultCode.ORDER_INFO_NOT_EXIT);
-        }
-
-        boolean equals = card.getCardType().equals(CardTypeEnum.PERSON_CARD.name());
-        boolean equals1 = orderInfo.getOrderType().equals(OrderTypeEnums.TIMER.name());
-
-        if (equals1 && equals) {
-            // 获得订单价格和卡余额和折扣信息
-            Double orderPrice = orderInfo.getOrderPrice();
-            Double currentBalance = card.getCurrentBalance();
-            Float discountValue = card.getDiscountValue() != null ? card.getDiscountValue() / 10 : 1.0f;
-
-            // 获取需要支付的金额
-            double v = orderPrice * discountValue;
-
-            // 超时金额
-            Double overdueAmount = orderInfo.getOverPrice() != null ? orderInfo.getOverPrice() : 0.0;
-            log.info("此时的超时金额为:{}", overdueAmount);
-
-
-            if (orderInfo.getOrderState().equals(OrderStatusEnum.WAITING_SUPPLEMENTS.name())) {
-                //校验超时金额
-                if (overdueAmount != null) {
-                    double newBalance = currentBalance - overdueAmount;
-                    if (newBalance >= 0) {
-                        card.setCurrentBalance(newBalance);
-                        cardService.updateById(card);
-
-                        // 修改订单状态
-                        orderInfo.setOrderState(OrderStatusEnum.USED.toString());
-                        orderInfoService.updateById(orderInfo);
-
-                        return ResultUtil.success(ResultCode.PAY_SUCCESS);
-                    } else {
-                        // Handle insufficient balance, e.g., raise an error or take appropriate action
-                        return ResultUtil.success(ResultCode.CURRENTBALANCE_NOT);
-                    }
-                }
-            }
-
-            if (v <= currentBalance && orderInfo.getOrderState().equals(OrderStatusEnum.WAITING_TO_PAY.name())) {
-                double totalAmountToDeduct = v;
-                if (totalAmountToDeduct <= currentBalance) {
-                    double newBalance = currentBalance - totalAmountToDeduct;
-                    card.setCurrentBalance(newBalance);
-                    cardService.updateById(card);
-
-                    // 修改订单状态
-                    orderInfo.setOrderState(OrderStatusEnum.IN_USE.toString());
-                    String qrCode = QrCodeRegistrationUtil.registerCode(orderInfo);
-                    orderInfo.setQrCode(qrCode);
-                    orderInfoService.updateById(orderInfo);
-                    return ResultUtil.success(ResultCode.PAY_SUCCESS);
-                } else {
-                    // 处理余额不足的情况
-                    return ResultUtil.success(ResultCode.CURRENTBALANCE_NOT);
-                }
-            }
-        }
-        return ResultUtil.success(ResultCode.CURRENTBALANCE_NOT);
-
-    }
-
-    private PayOrderCreateRequest buildPaymentRequest(Card card, Integer faceValue, WechatPaymentSetting paymentSetting) {
-        PayOrderCreateRequest request = new PayOrderCreateRequest();
-        PayOrderCreateReqModel model = new PayOrderCreateReqModel();
-        model.setMchNo(paymentSetting.getMchId());
-        model.setAppId(paymentSetting.getAppId());
-        String orderNo = "mho" + new Date().getTime();
-        model.setMchOrderNo(orderNo);
-        model.setWayCode("WX_LITE");
-        model.setAmount(Long.valueOf(faceValue));
-        model.setCurrency("CNY");
-        model.setClientIp("1.14.25.22");
-        model.setSubject(card.getCardType());
-        model.setBody(card.getCardName());
-        request.setBizModel(model);
-        return request;
-    }
-
-    private void saveCardInfo(Card card, Long userId, PayOrderCreateResponse response) {
-        Card cardInfo = new Card();
-        cardInfo.setDays(card.getDays());
-        cardInfo.setFaceValue(card.getFaceValue());
-        cardInfo.setCardType(card.getCardType());
-        cardInfo.setBonusAmount(card.getBonusAmount());
-        cardInfo.setCurrentBalance((double) (card.getFaceValue() + card.getBonusAmount()));
-        cardService.save(cardInfo);
-    }
-}
-
-
-

+ 0 - 18
framework/src/main/java/com/wteam/framework/modules/book/service/impl/CouponServiceImpl.java

@@ -1,18 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.wteam.framework.modules.book.entity.Coupon;
-import com.wteam.framework.modules.book.mapper.CouponMapper;
-import com.wteam.framework.modules.book.service.CouponService;
-import org.springframework.stereotype.Service;
-
-/**
- * (Coupon)表服务实现类
- *
- * @author doncic
- * @since 2023-09-20 14:18:05
- */
-@Service("couponService")
-public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> implements CouponService {
-
-}

+ 0 - 429
framework/src/main/java/com/wteam/framework/modules/book/service/impl/OrderInfoServiceImpl.java

@@ -1,429 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.core.util.StrUtil;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.gson.Gson;
-import com.wteam.framework.common.enums.OrderStatus;
-import com.wteam.framework.common.enums.OrderTypeEnums;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.common.security.AuthUser;
-import com.wteam.framework.common.security.context.UserContext;
-import com.wteam.framework.common.utils.BeanUtil;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.Venue;
-import com.wteam.framework.modules.book.entity.dto.OrderReq;
-import com.wteam.framework.modules.book.entity.vo.TimerOrderInfoVo;
-import com.wteam.framework.modules.book.mapper.OrderInfoMapper;
-import com.wteam.framework.modules.book.mapper.VenueMapper;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import com.wteam.framework.modules.book.service.PaymentInfoService;
-import com.wteam.framework.modules.pay.entity.vo.CallbackParamVO;
-import com.wteam.framework.modules.pay.entity.vo.OrderStatusEnum;
-import com.wteam.framework.modules.system.entity.dos.Setting;
-import com.wteam.framework.modules.system.entity.dto.WechatPaymentSetting;
-import com.wteam.framework.modules.system.entity.enums.SettingEnum;
-import com.wteam.framework.modules.system.service.SettingService;
-import com.wteam.framework.modules.user.entity.User;
-import com.wteam.framework.modules.user.mapper.UserMapper;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.validation.constraints.NotNull;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * (OrderInfo)表服务实现类
- *
- * @author doncic
- * @since 2023-09-20 13:12:50
- */
-@Slf4j
-@Service("orderInfoService")
-public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
-
-
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private OrderInfoService orderInfoService;
-    @Autowired
-    private OrderInfoMapper orderInfoMapper;
-    @Autowired
-    private SettingService settingService;
-    @Autowired
-    private VenueMapper venueMapper;
-    @Autowired
-    private RedisTemplate redisTemplate;
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public ResultMessage generateOrder(String accessToken, OrderReq orderReq) {
-        // 检查参数是否有效
-        if (accessToken == null || orderReq == null) {
-            return ResultUtil.error(ResultCode.USER_AUTHORITY_ERROR);
-        }
-
-        // 获取用户ID
-        String userId = getUserIdFromAccessToken(accessToken);
-
-        if (userId.isEmpty()) {
-            return ResultUtil.error(ResultCode.USER_NEED_LOGIN);
-        }
-
-        User user = userMapper.selectById(userId);
-
-//        //要进行时间的校验
-//        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-//        lambdaQueryWrapper.eq(OrderInfo::getOrderDate, orderReq.getOrderDate());
-//        List<OrderInfo> orderInfos = orderInfoMapper.selectList(lambdaQueryWrapper);
-
-
-        // 创建订单
-//            OrderInfo orderInfo = mapOrderRequestToOrderInfo(orderReq, userId);
-
-        OrderInfo orderInfo = new OrderInfo();
-        String orderId = RandomUtil.randomNumbers(9);
-        log.info("此时的生成的订单id为:{}", orderId);
-        orderInfo.setId(orderId);
-        orderInfo.setUserId(userId);
-        orderInfo.setStoreId(orderReq.getStoreId());
-        orderInfo.setCreateTime(new Date());
-        orderInfo.setCreateBy(user.getNickName());
-        orderInfo.setVenueId(orderReq.getVenueId());
-        orderInfo.setOrderDate(orderReq.getOrderDate());
-        orderInfo.setOrderSt(orderReq.getOrderSt());
-        orderInfo.setOrderEd(orderReq.getOrderEd());
-        orderInfo.setOrderType(orderReq.getOrderType());
-        orderInfo.setPhoneNumber(orderReq.getPhoneNumber());
-        orderInfo.setOrderPrice(orderReq.getOrderPrice());
-        log.info("此时的请求参数为:{}", orderReq);
-        log.info("此时的订单信息为:{}", orderInfo);
-
-        Double orderPrice = orderInfo.getOrderPrice();
-        Double reqOrderPrice = orderReq.getOrderPrice();
-        if (orderPrice != reqOrderPrice) {
-            return ResultUtil.error(ResultCode.PRICE_ERROR);
-        }
-        boolean save = orderInfoService.save(orderInfo);
-        log.info("保存之后的订单信息为:{}", orderInfo);
-        String id = orderInfo.getId();
-        if (save) {
-            // TODO:这个功能好像问题,实际并没有实现
-            // 订单成功保存后,设置订单的过期时间为15分钟
-            String key = "orderInfo:" + orderInfo.getId();
-            redisTemplate.opsForValue().set(key, orderInfo, 15, TimeUnit.MINUTES);
-            log.info("这里的订单id为:{}", orderInfo.getId());
-            // 启动一个定时任务,在15分钟后检查订单支付状态
-            // 这里使用异步任务来执行检查订单支付状态的操作
-            CompletableFuture.runAsync(() -> {
-                try {
-                    // 等待15分钟
-                    Thread.sleep(15 * 60 * 1000);
-                    // 检查订单支付状态,这部分需要根据实际逻辑实现
-                    // 如果订单未支付,可以从Redis中删除订单
-                    if (!isOrderPaid(orderInfo)) {
-                        redisTemplate.delete(key);
-                        log.info("订单{}未支付,已删除。", orderInfo.getId());
-                    }
-                } catch (InterruptedException e) {
-                    // 处理异常
-                    log.error("定时任务被中断:{}", e.getMessage());
-                }
-            });
-            return ResultUtil.data(id);
-        }
-        return ResultUtil.error(ResultCode.GET_ORDER_PROBLEM);
-    }
-
-    private boolean isOrderPaid(OrderInfo orderInfo) {
-        String orderState = orderInfo.getOrderState();
-        if (ObjectUtil.isNull(orderState)) {
-            return true;
-        }
-        return false;
-    }
-
-
-    public void checkAndRemoveExpiredOrders() {
-        // 这里遍历所有订单,检查订单的过期时间,如果过期则删除
-        Set<String> keys = redisTemplate.keys("orderInfo:*");
-        if (keys != null) {
-            for (String key : keys) {
-                Long remainingTime = redisTemplate.getExpire(key);
-                if (remainingTime != null && remainingTime <= 0) {
-                    redisTemplate.delete(key);
-                    // 在这里你可以执行其他处理,如发送订单过期通知
-                }
-            }
-        }
-    }
-
-    @Override
-    public Boolean checkOrder(Long id) {
-        OrderInfo orderInfo = this.getById(id);
-        if (null == orderInfo) {
-            log.info("回调处理,支付订单号{}不存在", id);
-            return false;
-        }
-        return OrderStatusEnum.PAID.name().equals(orderInfo.getOrderState()) ? Boolean.FALSE : Boolean.TRUE;
-    }
-
-    @Override
-    public void processOrders(CallbackParamVO callbackParamVO) {
-        OrderInfo orderInfo = this.getById(callbackParamVO.getSn());
-        if (null == orderInfo) {
-            log.info("回调处理,支付订单号{}不存在", callbackParamVO.getSn());
-            throw new ServiceException(ResultCode.ORDER_NOT_EXIST);
-        }
-        // 更新订单转态
-        this.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getId, callbackParamVO.getSn()).set(OrderInfo::getOrderState, OrderStatusEnum.PAID).set(OrderInfo::getCreateTime, callbackParamVO.getSuccessTime()).set(OrderInfo::getTransactionId, callbackParamVO.getTransactionId()));
-    }
-
-
-    @Override
-    public ResultMessage bookStatus(@NotNull Long id, Date dateTime) {
-        // 将传入的日期(dateTime)转换为年月日格式的字符串
-        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        String targetDate = dateFormat.format(dateTime);
-        log.info("此时的时间为:{}", targetDate);
-
-        // 使用 LambdaQueryWrapper 构造查询条件
-        // 删除退款成功的订场信息
-        LambdaQueryWrapper<OrderInfo> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(OrderInfo::getStoreId, id).eq(OrderInfo::getOrderDate, targetDate).eq(OrderInfo::getOrderType, OrderTypeEnums.RENTAL).ne(OrderInfo::getOrderState, com.wteam.framework.common.enums.OrderStatusEnum.REFUNDED);
-        List<OrderInfo> orderInfos = orderInfoMapper.selectList(wrapper);
-
-        log.info("对应的订单信息为:{}", orderInfos);
-
-        /**
-         * 这里过滤掉订场情况为null的订单信息
-         * 也要除去退款的情况
-         *
-         */
-
-        //过滤掉订场信息为null的订单信息
-        List<OrderInfo> collect = orderInfos.stream().filter(orderInfo -> orderInfo.getOrderState() != null).collect(Collectors.toList());
-
-
-        log.info("此时过滤后对应的订单信息为:{}", collect);
-
-        /**
-         * 这里订场情况拆线呢分为
-         * 1-->根据该场地id没有查到关联id,就把当天的订场情况全部返回
-         * 2-->根据该场地id查到关联id
-         *   1-->此时的关联id只有一个,那此时这个场地即为篮球半场,那次此时的对应的关联id为篮球全场,那同一时间段的篮球全场就无法进行预订
-         *   2-->此时的关联id为两个,那此时的这个场地即为篮球全场,那次的关联id为两个篮球半场,那同一时间段的另外两个篮球半场就无法进行预订
-         * 返回给前端要禁用的场地
-         */
-        List<OrderInfo> orderInfoList = new ArrayList<>();
-        for (OrderInfo order : collect) {
-            //获取场地id
-            Long venueId = order.getVenueId();
-            log.info("对应的场地id为:{}", venueId);
-            //获取场地信息
-            Venue venue = venueMapper.selectById(venueId);
-            log.info("对应的场地为:{}", venue);
-            //得到该场地是否有关联id
-            String relevancyId = venue.getRelevancyId();
-            log.info("对应的场地相关id为:{}", relevancyId);
-            if ("0".equals(relevancyId)) {
-                // 1. 处理场地没有关联的情况,返回当天的订场情况
-                orderInfoList.add(order);
-            } else {
-                // 2. 处理场地有关联的情况,需要进一步判断
-                String[] relevantIds = relevancyId.split(","); // 假设关联 id 以逗号分隔
-                if (relevantIds.length == 1) {
-                    // 2.1 处理关联 id 只有一个的情况,即半场
-                    // 那此时同时间段的全场不允许进行预订
-                    String newVariable0 = relevantIds[0]; // 将第一个 id 赋给新变量
-                    log.info("对应的场地id为:{}", newVariable0);
-                    String cleanedId = newVariable0.replaceAll("\\[|\\]|\"", "");
-                    log.info("此时优化之后的id为:{}", cleanedId);
-                    //构建订单信息
-                    OrderInfo orderInfo1 = new OrderInfo();
-                    orderInfo1.setVenueId(Long.valueOf(cleanedId));
-                    orderInfo1.setOrderSt(order.getOrderSt());
-                    orderInfo1.setOrderEd(order.getOrderEd());
-                    log.info("对应的订单信息1为:{}", orderInfo1);
-                    OrderInfo orderInfo2 = new OrderInfo();
-                    orderInfo2.setVenueId(venueId);
-                    orderInfo2.setOrderSt(order.getOrderSt());
-                    orderInfo2.setOrderEd(order.getOrderEd());
-                    log.info("对应的订单信息2为:{}", orderInfo2);
-                    orderInfoList.add(orderInfo1);
-                    orderInfoList.add(orderInfo2);
-                } else {
-                    // 2.2 处理关联 id 多个的情况,即全场
-                    String newVariable0 = relevantIds[0];
-                    String cleanedId1 = newVariable0.replaceAll("\\[|\\]|\"", "");
-                    log.info("此时的cleanedId1:{}", cleanedId1);
-                    String newVariable1 = relevantIds[1];
-                    String cleanedId2 = newVariable1.replaceAll("\\[|\\]|\"", "");
-                    log.info("此时的cleanedId2:{}", cleanedId2);
-                    //构建订单信息
-                    OrderInfo orderInfo1 = new OrderInfo();
-                    orderInfo1.setVenueId(Long.valueOf(cleanedId1));
-                    orderInfo1.setOrderSt(order.getOrderSt());
-                    orderInfo1.setOrderEd(order.getOrderEd());
-                    log.info("对应的订单信息1为:{}", orderInfo1);
-                    OrderInfo orderInfo2 = new OrderInfo();
-                    orderInfo2.setVenueId(Long.valueOf(cleanedId2));
-                    orderInfo2.setOrderSt(order.getOrderSt());
-                    orderInfo2.setOrderEd(order.getOrderEd());
-                    log.info("对应的订单信息2为:{}", orderInfo2);
-                    OrderInfo orderInfo3 = new OrderInfo();
-                    orderInfo3.setVenueId(venueId);
-                    orderInfo3.setOrderSt(order.getOrderSt());
-                    orderInfo3.setOrderEd(order.getOrderEd());
-                    log.info("对应的订单信息3为:{}", orderInfo3);
-                    orderInfoList.add(orderInfo1);
-                    orderInfoList.add(orderInfo2);
-                    orderInfoList.add(orderInfo3);
-                }
-            }
-        }
-        Map<String, List<Map<String, Object>>> stringListMap = formatOrderInfo(orderInfoList, targetDate);
-        log.info("此时返回订场情况为:{}", stringListMap);
-        return ResultUtil.data(stringListMap);
-    }
-
-    @Override
-    public ResultMessage getTimer(@NotNull String userId) {
-        //构造查询条件
-        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(OrderInfo::getUserId, userId).eq(OrderInfo::getOrderType, OrderTypeEnums.TIMER);
-        List<OrderInfo> orderInfos = orderInfoMapper.selectList(lambdaQueryWrapper);
-        List<TimerOrderInfoVo> timerOrderInfoVoList = new ArrayList<>();
-        for (OrderInfo orderInfo : orderInfos) {
-            TimerOrderInfoVo timerOrderInfoVo = new TimerOrderInfoVo();
-            BeanUtil.copyProperties(orderInfo, timerOrderInfoVo);
-            timerOrderInfoVoList.add(timerOrderInfoVo);
-        }
-        return ResultUtil.data(timerOrderInfoVoList);
-    }
-
-
-    public Map<String, List<Map<String, Object>>> formatOrderInfo(List<OrderInfo> orderInfos, String targetDate) {
-        Map<String, List<Map<String, Object>>> result = new HashMap<>();
-        List<Map<String, Object>> dataList = new ArrayList<>();
-
-        for (OrderInfo orderInfo : orderInfos) {
-            Map<String, Object> orderMap = new HashMap<>();
-            orderMap.put("venueId", orderInfo.getVenueId());
-            orderMap.put("orderSt", formatTime(orderInfo.getOrderSt()));
-            orderMap.put("orderEd", formatTime(orderInfo.getOrderEd()));
-            dataList.add(orderMap);
-        }
-
-        result.put(targetDate, dataList);
-        return result;
-    }
-
-    private String formatTime(Date time) {
-        SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
-        return timeFormat.format(time);
-    }
-
-
-    /**
-     * 数组格式化方法
-     *
-     * @param data
-     * @return
-     */
-    private String formatJson(List<Map<String, String>> data) {
-        StringBuilder result = new StringBuilder();
-        result.append("[\n");
-
-        for (int i = 0; i < data.size(); i++) {
-            Map<String, String> item = data.get(i);
-            result.append("  {\n");
-            int j = 0;
-            for (Map.Entry<String, String> entry : item.entrySet()) {
-                result.append("    \"").append(entry.getKey()).append("\" : \"").append(entry.getValue()).append("\"");
-                if (j < item.size() - 1) {
-                    result.append(",");
-                }
-                result.append("\n");
-                j++;
-            }
-            result.append("  }");
-            if (i < data.size() - 1) {
-                result.append(",");
-            }
-            result.append("\n");
-        }
-
-        result.append("]\n");
-        return result.toString();
-    }
-
-
-    public static WechatPaymentSetting getWechatPaymentSetting(SettingService settingService) {
-        Setting setting = settingService.get(SettingEnum.WECHAT_PAYMENT.name());
-        if (StrUtil.isBlank(setting.getSettingValue())) {
-            throw new ServiceException(ResultCode.WECHAT_PAYMENT_NOT_SETTING);
-        }
-        return new Gson().fromJson(setting.getSettingValue(), WechatPaymentSetting.class);
-    }
-
-
-    private String getUserIdFromAccessToken(String accessToken) {
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        String id = authUser.getId();
-        return id;
-    }
-
-//
-//    private OrderInfo mapOrderRequestToOrderInfo(OrderReq orderReq, String userId) {
-//        log.info("此时的请求参数为:{}", orderReq);
-//        User user = userMapper.selectById(userId);
-//        OrderInfo orderInfo = new OrderInfo();
-////        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-////        Date orderSt = orderInfo.getOrderSt();
-////        Date orderEd = orderInfo.getOrderEd();
-////        String formatSt = sim.format(orderSt);
-////        String formatEd = sim.format(orderEd);
-////        Date dateSt = Convert.toDate(formatSt);
-////        Date dateEd = Convert.toDate(formatEd);
-//        orderInfo.setUserId(userId);
-//        orderInfo.setStoreId(orderReq.getStoreId());
-//        orderInfo.setCreateTime(new Date());
-//        orderInfo.setCreateBy(user.getNickName());
-//        orderInfo.setVenueId(orderReq.getVenueId());
-//        orderInfo.setOrderDate(orderReq.getOrderDate());
-//        orderInfo.setOrderSt(orderReq.getOrderSt());
-//        orderInfo.setOrderEd(orderReq.getOrderEd());
-//        orderInfo.setOrderType(orderReq.getOrderType());
-//        orderInfo.setPhoneNumber(orderReq.getPhoneNumber());
-//        orderInfo.setOrderPrice(orderReq.getOrderPrice());
-//        log.info("此时的订单信息为:{}", orderInfo);
-//        return orderInfo;
-//    }
-
-    // 在这里添加订单状态的验证逻辑,例如检查订单时间是否有效等
-// 如果订单有效返回true,否则返回false
-    private boolean isOrderValid(OrderReq orderReq) {
-        return false;
-    }
-}

+ 0 - 254
framework/src/main/java/com/wteam/framework/modules/book/service/impl/PaymentInfoServiceImpl.java

@@ -1,254 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.jeequan.jeepay.Jeepay;
-import com.jeequan.jeepay.JeepayClient;
-import com.jeequan.jeepay.exception.JeepayException;
-import com.jeequan.jeepay.model.PayOrderCreateReqModel;
-import com.jeequan.jeepay.model.RefundOrderCreateReqModel;
-import com.jeequan.jeepay.request.PayOrderCreateRequest;
-import com.jeequan.jeepay.request.RefundOrderCreateRequest;
-import com.jeequan.jeepay.response.PayOrderCreateResponse;
-import com.jeequan.jeepay.response.RefundOrderCreateResponse;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.common.security.AuthUser;
-import com.wteam.framework.common.security.context.UserContext;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import com.wteam.framework.modules.book.entity.PaymentInfo;
-import com.wteam.framework.modules.book.entity.Venue;
-import com.wteam.framework.modules.book.mapper.CardMapper;
-import com.wteam.framework.modules.book.mapper.OrderInfoMapper;
-import com.wteam.framework.modules.book.mapper.PaymentInfoMapper;
-import com.wteam.framework.modules.book.mapper.VenueMapper;
-import com.wteam.framework.modules.book.service.CardService;
-import com.wteam.framework.modules.book.service.OrderInfoService;
-import com.wteam.framework.modules.book.service.PaymentInfoService;
-import com.wteam.framework.modules.system.entity.dto.WechatPaymentSetting;
-import com.wteam.framework.modules.system.service.SettingService;
-import com.wteam.framework.modules.user.mapper.UserMapper;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.validation.constraints.NotNull;
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Date;
-
-import static com.wteam.framework.modules.book.service.impl.OrderInfoServiceImpl.getWechatPaymentSetting;
-
-/**
- * (PaymentInfo)表服务实现类
- *
- * @author doncic
- * @since 2023-09-20 19:20:06
- */
-@Slf4j
-@Service("paymentInfoService")
-public class PaymentInfoServiceImpl extends ServiceImpl<PaymentInfoMapper, PaymentInfo> implements PaymentInfoService {
-
-
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private OrderInfoService orderInfoService;
-    @Autowired
-    private OrderInfoMapper orderInfoMapper;
-    @Autowired
-    private SettingService settingService;
-    @Autowired
-    private VenueMapper venueMapper;
-    @Autowired
-    private PaymentInfoService paymentInfoService;
-    @Autowired
-    private CardMapper cardMapper;
-    @Autowired
-    private CardService cardService;
-//    @Autowired
-//    private RedisTemplate<String, OrderInfo> redisTemplate;
-
-    /**
-     * 调用jeepay统一下单接口
-     *
-     * @param id
-     * @return
-     * @throws JeepayException
-     */
-
-    @Override
-    public void wxpay(@NotNull Long id) {
-        //根据传入的订单id查询支付金额
-        OrderInfo orderInfo = orderInfoMapper.selectById(id);
-        if (orderInfo == null) {
-            throw new ServiceException("对应订单不存在");
-        }
-        //获取到对应场地信息
-        Long venueId = orderInfo.getVenueId();
-        log.info("此时场地的id为:{}", venueId);
-        Venue venue = venueMapper.selectById(venueId);
-        if (venue == null) {
-            throw new ServiceException("对应场地信息不存在");
-        }
-        Long orderPrice = orderInfo.getOrderPrice().longValue();
-        log.info("该订单支付金额为:{}", orderPrice);
-        // 调用 getWechatPaymentSetting 方法获取微信支付配置信息
-        WechatPaymentSetting wechatPaymentSetting = getWechatPaymentSetting(settingService);
-        log.info("微信支付配置信息为:{}", wechatPaymentSetting);
-        JeepayClient jeepayClient = JeepayClient.getInstance(wechatPaymentSetting.getAppId(), wechatPaymentSetting.getApiKey3());
-        String wayCode = "WX_LITE";                           // 支付方式
-        PayOrderCreateRequest request = new PayOrderCreateRequest();
-        PayOrderCreateReqModel model = new PayOrderCreateReqModel();
-        model.setMchNo(wechatPaymentSetting.getMchId());                       // 商户号
-        model.setAppId(jeepayClient.getAppId());            // 应用ID
-        String orderNo = "mho" + new Date().getTime();
-        model.setMchOrderNo(orderNo);                       // 商户订单号
-        model.setWayCode(wayCode);                          // 支付方式
-        model.setAmount(orderPrice);                                // 金额,单位分
-        model.setCurrency("CNY");                           // 币种,目前只支持cny
-        model.setClientIp("1.14.25.22");                 // 发起支付请求客户端的IP地址
-        model.setSubject("商品标题");                         // 商品标题
-        model.setBody("商品描述");                            // 商品描述
-        model.setNotifyUrl("https://www.jeequan.com");      // 异步通知地址
-        model.setReturnUrl("");                             // 前端跳转地址
-        model.setChannelExtra("");       // 渠道扩展参数
-        model.setExtParam("");                              // 商户扩展参数,回调时原样返回
-        log.info("此时的model参数为:{}", model);
-        request.setBizModel(model);
-        try {
-            PayOrderCreateResponse response = jeepayClient.execute(request);
-            log.info("验签结果:{}", response.checkSign(Jeepay.apiKey));
-            // 下单成功
-            if (response.isSuccess(Jeepay.apiKey)) {
-                String payOrderId = response.get().getPayOrderId();
-                log.info("payOrderId:{}", payOrderId);
-                log.info("mchOrderNo:{}", response.get().getMchOrderNo());
-            } else {
-                log.info("下单失败:{}", orderNo);
-                log.info("通道错误码:{}", response.get().getErrCode());
-                log.info("通道错误信息:{}", response.get().getErrMsg());
-            }
-        } catch (JeepayException e) {
-            log.error(e.getMessage());
-        }
-    }
-
-
-    @Override
-    public ResultMessage refund(@NotNull Long id) {
-        JeepayClient jeepayClient = JeepayClient.getInstance(Jeepay.appId, Jeepay.apiKey, Jeepay.getApiBase());
-        RefundOrderCreateRequest request = new RefundOrderCreateRequest();
-        RefundOrderCreateReqModel model = new RefundOrderCreateReqModel();
-        model.setMchNo(getWechatPaymentSetting(settingService).getMchId());                       // 商户号
-        model.setAppId(jeepayClient.getAppId());            // 应用ID
-        model.setMchOrderNo("");                            // 商户支付单号(与支付订单号二者传一)
-        model.setPayOrderId("P202106181104177050002");      // 支付订单号(与商户支付单号二者传一)
-        String refundOrderNo = "mho" + new Date().getTime();
-        model.setMchRefundNo(refundOrderNo);                // 商户退款单号
-        model.setRefundAmount(4l);                          // 退款金额,单位分
-        model.setCurrency("cny");                           // 币种,目前只支持cny
-        model.setClientIp("192.166.1.132");                 // 发起支付请求客户端的IP地址
-        model.setRefundReason("退款测试");                    // 退款原因
-        model.setNotifyUrl("https://www.jeequan.com");      // 异步通知地址
-        model.setChannelExtra("");                          // 渠道扩展参数
-        model.setExtParam("");                              // 商户扩展参数,回调时原样返回
-        request.setBizModel(model);
-        try {
-            RefundOrderCreateResponse response = jeepayClient.execute(request);
-            log.info("验签结果:{}", response.checkSign(Jeepay.apiKey));
-            // 判断退款发起是否成功(并不代表退款成功)
-            if (response.isSuccess(Jeepay.apiKey)) {
-                String refundOrderId = response.get().getRefundOrderId();
-                log.info("refundOrderId:{}", refundOrderId);
-                log.info("mchRefundNo:{}", response.get().getMchRefundNo());
-            } else {
-                log.info("下单失败:refundOrderNo={}, msg={}", refundOrderNo, response.getMsg());
-                log.info("通道错误码:{}", response.get().getErrCode());
-                log.info("通道错误信息:{}", response.get().getErrMsg());
-            }
-        } catch (JeepayException e) {
-            log.error(e.getMessage());
-        }
-        return ResultUtil.success();
-    }
-
-    @Override
-    public ResultMessage cardPay(String accessToken, @NotNull Long cardId, @NotNull Long orderId) {
-        // 根据传入的token获取用户信息
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        if (authUser == null) {
-            return ResultUtil.error(ResultCode.USER_NOT_FOUND);
-        }
-        // 获得用户id
-        Long userId = Long.valueOf(authUser.getId());
-        Card card = cardMapper.selectById(cardId);
-        //获取折扣值
-        Float discountValue = card.getDiscountValue();
-        //获得金额
-        OrderInfo orderInfo = orderInfoMapper.selectById(orderId);
-        if (ObjectUtil.isNull(orderInfo)) {
-            throw new ServiceException("此时订单信息为空");
-        }
-        if (ObjectUtil.isNull(card)) {
-            throw new ServiceException("此时卡信息为空");
-        }
-        if (!userId.equals(card.getUserId())) {
-            return ResultUtil.error(ResultCode.UNAUTHORIZED); // 非法操作,不是卡的所有者
-        }
-        // 检查余额是否足够支付订单
-        Double currentBalance = Double.valueOf(card.getCurrentBalance());
-        // 获取支付金额
-        Double orderPrice = orderInfo.getOrderPrice();
-        double v = orderPrice * discountValue;
-        if (v < currentBalance) {
-            throw new ServiceException("余额不足!");
-        }
-        //计算扣除值
-        card.setCurrentBalance((currentBalance - v));
-        boolean save = cardService.save(card);
-        if (save) {
-            return ResultUtil.success();
-        }
-        return ResultUtil.error(ResultCode.CARD_PAY_ERROR);
-    }
-
-    /**
-     * md5签名生成算法
-     *
-     * @param input
-     * @return
-     */
-    public String generateMD5Signature(String input) {
-        try {
-            // 创建MessageDigest对象,指定算法为MD5
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            // 将输入字符串转换为字节数组
-            byte[] inputBytes = input.getBytes(StandardCharsets.UTF_8);
-            // 计算MD5摘要
-            byte[] hashBytes = md.digest(inputBytes);
-            // 将摘要转换为十六进制字符串
-            StringBuilder result = new StringBuilder();
-            for (byte hashByte : hashBytes) {
-                // 将每个字节转换为两位的十六进制表示
-                result.append(String.format("%02x", hashByte));
-            }
-            return result.toString();
-        } catch (NoSuchAlgorithmException e) {
-            // 处理异常
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    private PaymentInfo paymentInfo(String payOrderId) {
-        PaymentInfo paymentInfo = new PaymentInfo();
-        paymentInfo.setId(payOrderId);
-        return paymentInfo;
-    }
-
-}

+ 0 - 115
framework/src/main/java/com/wteam/framework/modules/book/service/impl/StoreServiceImpl.java

@@ -1,115 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.wteam.framework.common.enums.ResultCode;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.common.utils.BeanUtil;
-import com.wteam.framework.common.vo.ResultMessage;
-
-import com.wteam.framework.modules.book.entity.Store;
-import com.wteam.framework.modules.book.entity.Venue;
-import com.wteam.framework.modules.book.entity.vo.StoreDetailsVo;
-import com.wteam.framework.modules.book.entity.vo.StoreVo;
-import com.wteam.framework.modules.book.mapper.StoreMapper;
-import com.wteam.framework.modules.book.mapper.VenueMapper;
-import com.wteam.framework.modules.book.service.StoreService;
-
-import lombok.extern.slf4j.Slf4j;
-
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.stereotype.Service;
-
-
-import javax.validation.constraints.NotNull;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * (Store)表服务实现类
- *
- * @author doncic
- * @since 2023-09-16 22:56:04
- */
-@Slf4j
-@Service("storeService")
-public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
-
-
-    @Autowired
-    private StoreMapper storeMapper;
-    @Autowired
-    private VenueMapper venueMapper;
-
-
-    @Override
-    public ResultMessage<List<String>> getPhoto(@NotNull Long id) {
-        // 校验参数信息
-        Store store = storeMapper.selectById(id);
-        if (ObjectUtil.isEmpty(store)) {
-            return ResultUtil.error(ResultCode.ENTITY_NULL);
-        }
-        // 创建一个List来存储URL值
-        List<String> imageUrlList = new ArrayList<>();
-        try {
-            // 解析存储图片信息的 JSON 数据
-            String storeImagesJson = store.getStoreImages();
-            JSONObject imagesJson = new JSONObject(storeImagesJson);
-            //获取"images"数组
-            JSONArray imagesArray = imagesJson.getJSONArray("images");
-            // 遍历数组并获取每个URL值
-            for (Object obj : imagesArray) {
-                String imageUrl = obj.toString();
-                imageUrlList.add(imageUrl);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return ResultUtil.data(imageUrlList);
-    }
-
-
-    @Override
-    public ResultMessage getDetails(@NotNull Long id) {
-        try {
-            Store store = Optional.ofNullable(storeMapper.selectById(id))
-                    .orElseThrow(() -> new ServiceException(ResultCode.ENTITY_NULL));
-            List<Venue> venues = Optional.ofNullable(venueMapper.selectList(new LambdaQueryWrapper<Venue>().eq(Venue::getStoreId, id)))
-                    .orElseThrow(() -> new ServiceException(ResultCode.ENTITY_NULL));
-            StoreVo storeVo = new StoreVo();
-            BeanUtil.copyProperties(store, storeVo);
-            log.info("此时的门店信息为:{}", storeVo);
-            StoreDetailsVo storeDetailsVo = new StoreDetailsVo(storeVo, venues);
-            return ResultUtil.data(storeDetailsVo);
-        } catch (ServiceException ce) {
-            log.error("获取门店信息时出现异常: {}", ce.getMessage(), ce);
-            return ResultUtil.error(ce.getResultCode());
-        } catch (Exception e) {
-            log.error("获取门店信息时出现异常: {}", e.getMessage(), e);
-            return ResultUtil.error(ResultCode.INTERNAL_ERROR);
-        }
-    }
-}
-
-//    @Override
-//    public ResultMessage getAnnouncement(@NotNull Long id) {
-//        try {
-//            Store store = storeMapper.selectById(id);
-//            if (ObjectUtil.isEmpty(store)) {
-//                return ResultUtil.error(ResultCode.ENTITY_NULL);
-//            }
-//            String announcement = store.getAnnouncement();
-//            return ResultUtil.data(announcement);
-//        } catch (Exception e) {
-//            // 处理可能的异常情况,例如数据库查询失败
-//            log.error("获取门店公告时出现异常: {}", e.getMessage(), e);
-//            return ResultUtil.error(ResultCode.INTERNAL_ERROR);
-//        }
-//    }
-

+ 0 - 18
framework/src/main/java/com/wteam/framework/modules/book/service/impl/VenueServiceImpl.java

@@ -1,18 +0,0 @@
-package com.wteam.framework.modules.book.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.wteam.framework.modules.book.entity.Venue;
-import com.wteam.framework.modules.book.mapper.VenueMapper;
-import com.wteam.framework.modules.book.service.VenueService;
-import org.springframework.stereotype.Service;
-
-/**
- * (Venue)表服务实现类
- *
- * @author doncic
- * @since 2023-09-20 14:17:47
- */
-@Service("venueService")
-public class VenueServiceImpl extends ServiceImpl<VenueMapper, Venue> implements VenueService {
-
-}

+ 0 - 47
framework/src/main/java/com/wteam/framework/modules/card/entity/CbCardAdmin.java

@@ -1,47 +0,0 @@
-package com.wteam.framework.modules.card.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-
-import java.util.Date;
-
-@Data
-@TableName("cb_card_admin")
-@Schema(description = "管理员储值卡表")
-public class CbCardAdmin {
-
-    @Schema(description = "id")
-    private Integer id;
-    @Schema(description = "卡名称")
-    private String cardName;
-    @Schema(description = "卡类型(储值卡,月卡,次卡,散客储值卡枚举)")
-    private String cardType;
-    @Schema(description = "有效期")
-    private Integer days;
-    @Schema(description = "面值")
-    private Integer faceValue;
-    @Schema(description = "赠送金额")
-    private Integer bonusAmount;
-    @Schema(description = "折扣值")
-    private Float discountValue;
-    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-    @Schema(description = "次卡次数")
-    private Integer times;
-    @Schema(description = "详情简介")
-    private String detailedIntroduction;
-    @Schema(description = "使用说明")
-    private String usageInstructions;
-    @Schema(description = "生效日期")
-    private String startDate;
-    @Schema(description = "结束日期")
-    private String endDate;
-}

+ 0 - 9
framework/src/main/java/com/wteam/framework/modules/card/mapper/CardAdminMapper.java

@@ -1,9 +0,0 @@
-package com.wteam.framework.modules.card.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.wteam.framework.modules.card.entity.CbCardAdmin;
-
-public interface CardAdminMapper extends BaseMapper<CbCardAdmin> {
-
-
-}

+ 0 - 17
framework/src/main/java/com/wteam/framework/modules/card/service/CardAdminService.java

@@ -1,17 +0,0 @@
-package com.wteam.framework.modules.card.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.wteam.framework.common.enums.CardTypeEnum;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.card.entity.CbCardAdmin;
-
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/10/7 22:37
- */
-public interface CardAdminService extends IService<CbCardAdmin> {
-    ResultMessage<List<CbCardAdmin>> showAllCard(CardTypeEnum cardTypeEnum);
-}

+ 0 - 55
framework/src/main/java/com/wteam/framework/modules/card/service/impl/CardAdminServiceImpl.java

@@ -1,55 +0,0 @@
-package com.wteam.framework.modules.card.service.impl;
-
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.wteam.framework.common.enums.CardTypeEnum;
-import com.wteam.framework.common.enums.ResultUtil;
-import com.wteam.framework.common.vo.ResultMessage;
-import com.wteam.framework.modules.book.entity.Card;
-import com.wteam.framework.modules.book.entity.Store;
-import com.wteam.framework.modules.book.mapper.StoreMapper;
-import com.wteam.framework.modules.book.service.StoreService;
-import com.wteam.framework.modules.card.entity.CbCardAdmin;
-import com.wteam.framework.modules.card.mapper.CardAdminMapper;
-import com.wteam.framework.modules.card.service.CardAdminService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-/**
- * @author doncic
- * @date 2023/10/7 22:38
- */
-@Slf4j
-@Service
-public class CardAdminServiceImpl extends ServiceImpl<CardAdminMapper, CbCardAdmin> implements CardAdminService {
-
-
-    @Autowired
-    private CardAdminMapper cardAdminMapper;
-
-    /**
-     * 根据传入的卡类型不同
-     * 展示对应的卡
-     *
-     * @param cardTypeEnum
-     * @return
-     */
-    @Override
-    public ResultMessage<List<CbCardAdmin>> showAllCard(@NotNull CardTypeEnum cardTypeEnum) {
-        // 使用 LambdaQueryWrapper 进行查询
-        LambdaQueryWrapper<CbCardAdmin> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(CbCardAdmin::getCardType, cardTypeEnum);
-        List<CbCardAdmin> cbCardAdmins = cardAdminMapper.selectList(lambdaQueryWrapper);
-        log.info("此时从管理员设置的卡信息为:{}", cbCardAdmins);
-        if (ObjectUtil.isNull(cbCardAdmins)) {
-            return ResultUtil.success();
-        }
-        return ResultUtil.data(cbCardAdmins);
-    }
-}

+ 0 - 38
framework/src/main/java/com/wteam/framework/modules/hardware/ApiCallerUtil.java

@@ -1,38 +0,0 @@
-package com.wteam.framework.modules.hardware;
-
-
-import cn.hutool.http.HttpUtil;
-import cn.hutool.json.JSONObject;
-import com.wteam.framework.common.exception.ServiceException;
-
-/**
- * 固定方法用来获取token
- */
-public class ApiCallerUtil {
-
-    public static String callApi(String mac) {
-
-        // 固定的接口URL
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/get_tokenv2.x";
-
-        // 固定的参数
-        String pwd = "239818";
-        String apikey = "889a7a889678edfef18fa669def89";
-
-        // 构建请求参数
-        String urlWithParams = apiUrl + "?mac=" + mac + "&pwd=" + pwd + "&apikey=" + apikey;
-
-        // 发起GET请求并获取响应
-        String response = HttpUtil.get(urlWithParams);
-        // 解析JSON响应
-        JSONObject json = new JSONObject(response);
-        // 获取code和token的值
-        int code = json.getInt("code");
-        String token = json.getStr("token");
-        if (code == 0) {
-            return token;
-        } else {
-            throw new ServiceException("请求接口有误!");
-        }
-    }
-}

+ 0 - 105
framework/src/main/java/com/wteam/framework/modules/hardware/ApiQrCodeUtil.java

@@ -1,105 +0,0 @@
-//package com.wteam.framework.modules.hardware;
-//
-///**
-// * @author doncic
-// * @date 2023/9/29 15:42
-// */
-//
-//
-//import cn.hutool.http.HttpRequest;
-//import cn.hutool.http.HttpResponse;
-//import cn.hutool.http.HttpUtil;
-//import cn.hutool.json.JSONObject;
-//import com.wteam.framework.common.enums.ResultUtil;
-//import com.wteam.framework.common.exception.ServiceException;
-//import com.wteam.framework.modules.book.entity.Card;
-//import lombok.extern.slf4j.Slf4j;
-//import org.apache.ibatis.logging.Log;
-//
-//import java.time.LocalDate;
-//import java.time.ZoneOffset;
-//
-//@Slf4j
-//public class ApiQrCodeUtil {
-//    private static final String API_URL = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-//    private static final String MAC_ADDRESS = "863569068849199";
-//
-//    // 这个方法获取token,你需要根据你的实际需求实现它
-//    public static String getToken(String mac) {
-//        // 实现获取token的逻辑
-//        String token = ApiCallerUtil.callApi(mac);
-//        return token;
-//    }
-//
-//    public static Boolean callApiWithOrderInfo(Card card, String data) {
-//        //获得token
-//        String tk = getToken();
-//        //获取二维码有效时间
-//        Integer days = card.getDays();
-//        // 计算二维码的过期时间
-//        LocalDate baseDate = LocalDate.now();
-//        LocalDate targetDate = baseDate.plusDays(days);
-//        long timestamp = targetDate.atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli();
-//        // 使用hutool调用接口
-//        HttpResponse response = HttpRequest.post(API_URL)
-//                .form("mac", MAC_ADDRESS)
-//                .form("tk", tk)
-//                .form("qcodetxt", data)
-//                .form("enabletime", timestamp)
-//                .form("enablecount", 6000)
-//                .execute();
-//        // 获取响应结果
-//        String responseBody = response.body();
-//        int status = response.getStatus();
-//
-//        // 处理响应
-//        if (status == 200) {
-//            // 请求成功,可以处理响应数据
-//            JSONObject jsonObject = new JSONObject(responseBody);
-//            int code = jsonObject.getInt("code");
-//            String desc = jsonObject.getStr("desc");
-//            log.info("此时的code为:{}", code);
-//            log.info("此时的desc为:{}", desc);
-//            return true;
-//        }
-//        return false;
-//    }
-//
-//    public static Boolean callApiWithUser(String data) {
-//        //获得token
-//        String tk = getToken();
-//        // 使用hutool调用接口
-//        String baseUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-//        String mac = "863569068849199";
-//        String qcodetxt = data;
-//        int enablecount = 2;
-//        // 使用StringBuilder拼接URL
-//        StringBuilder urlBuilder = new StringBuilder(baseUrl);
-//        urlBuilder.append("?mac=").append(mac)
-//                .append("&tk=").append(tk)
-//                .append("&qcodetxt=").append(qcodetxt)
-//                .append("&enablecount=").append(enablecount);
-//        String finalUrl = urlBuilder.toString();
-//        // 发送HTTP GET 请求
-//        HttpResponse response = HttpUtil.createGet(finalUrl)
-//                .execute();
-//        // 获取响应状态码
-//        int statusCode = response.getStatus();
-//        // 获取响应内容
-//        String responseBody = response.body();
-//        // 处理响应
-//        if (statusCode == 200) {
-//            // 请求成功,可以处理响应数据
-//            JSONObject jsonObject = new JSONObject(responseBody);
-//            int code = jsonObject.getInt("code");
-//            String desc = jsonObject.getStr("desc");
-//            log.info("此时的code为:{}", code);
-//            log.info("此时的desc为:{}", desc);
-//            return true;
-//        }
-//        return false;
-//    }
-//}
-//
-//
-//

+ 0 - 176
framework/src/main/java/com/wteam/framework/modules/hardware/QrCodeRegistrationUtil.java

@@ -1,176 +0,0 @@
-package com.wteam.framework.modules.hardware;
-
-import cn.hutool.core.util.RandomUtil;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.json.JSONObject;
-import com.wteam.framework.common.exception.ServiceException;
-import com.wteam.framework.modules.book.entity.OrderInfo;
-import lombok.extern.slf4j.Slf4j;
-
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
-
-@Slf4j
-public class QrCodeRegistrationUtil {
-
-
-    /**
-     * @param data
-     * @return
-     */
-    public static Boolean registerTimerQrCode(String data) {
-
-        // 获取当前时间戳
-        long currentTime = System.currentTimeMillis() / 1000;
-
-        // 获取60秒之后的时间戳
-        long sixtySecondsLater = currentTime + 60;
-
-
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-        String mac1 = "863569068849199";
-        String mac2 = "863569068848969";
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-        HttpResponse response = HttpRequest.post(apiUrl)
-                .form("mac", macParam)
-                .form("tk", tk)
-                .form("qcodetxt", data)
-                .form("starttime", currentTime)
-                .form("enabletime", sixtySecondsLater)
-                .form("enablecount", 2)
-                .execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return true;
-    }
-
-
-    /**
-     * @param data
-     * @return
-     */
-    public static Boolean registerMonthQrCode(String data) {
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-        String mac1 = "863569068849199";
-        String mac2 = "863569068848969";
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-        HttpResponse response = HttpRequest.post(apiUrl)
-                .form("mac", macParam)
-                .form("tk", tk)
-                .form("qcodetxt", data)
-                .form("enablecount", 50)
-                .execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return true;
-    }
-
-    public static Boolean registerTicketQrCode(String data) {
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-        String mac1 = "863569068849199";
-        String mac2 = "863569068848969";
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-        HttpResponse response = HttpRequest.post(apiUrl).form("mac", macParam).form("tk", tk).form("qcodetxt", data).form("enablecount", 2).execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return true;
-    }
-
-
-    public static String registerOneQrCode(String data) {
-        String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/reg_access_qcode.x";
-        String mac1 = "863569068849199";
-        String mac2 = "863569068848969";
-        String tk = ApiCallerUtil.callApi(mac1);
-        log.info("此时获取到的token为:{} ", tk);
-
-        String macParam = mac1 + "_" + mac2;
-        log.info("此时拼接的macParam为:{}", macParam);
-
-        HttpResponse response = HttpRequest.post(apiUrl).form("mac", macParam).form("tk", tk).form("qcodetxt", data).form("enablecount", 1).execute();
-
-        String body = response.body();
-        JSONObject json = new JSONObject(body);
-        int code = json.getInt("code");
-        log.info("此时返回的code为:{}", code);
-        String qcodetxt = json.getStr("qcodetxt");
-        log.info("此时返回的qcodetxt为:{}", qcodetxt);
-        String desc = json.getStr("desc");
-        log.info("此时返回的desc为:{}", desc);
-        if (code != 0 && code != 4) {
-            throw new ServiceException("硬件回调url设置接口异常!");
-        }
-        log.info("此时接口响应数据为:{} (不要记录敏感信息在日志中)", body);
-        return data;
-    }
-
-    public static String registerCode(OrderInfo orderInfo) {
-        // 获取当前日期
-        LocalDate currentDate1 = LocalDate.now();
-        // 格式化日期为字符串
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        String formattedDate = currentDate1.format(formatter);
-
-        //生成一个随机数字
-        String numbers = RandomUtil.randomNumbers(5);
-
-        String data = "pxo_" + formattedDate + "_" + numbers + "_" + orderInfo.getId() + "_00";
-
-        Boolean b = QrCodeRegistrationUtil.registerTimerQrCode(data);
-
-        if (b) {
-            return data;
-        }
-        return "注册二维码错误!";
-    }
-}

+ 0 - 67
framework/src/main/java/com/wteam/framework/modules/hardware/RegistrationTask.java

@@ -1,67 +0,0 @@
-package com.wteam.framework.modules.hardware;
-
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpResponse;
-import cn.hutool.http.HttpUtil;
-import cn.hutool.json.JSONObject;
-import com.wteam.framework.common.exception.ServiceException;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 定时任务,每24小时向硬件注册回调url
- */
-@Slf4j
-public class RegistrationTask {
-
-    private static final String apiUrl = "https://xiaofeng.pankzone.com/api/openapi/set_dev_callbackv2.x";
-    private static final String url = "http://139.9.38.185:8889/v1/hardware/verification?data=";
-
-    public static void setCallbackForMAC(String mac) {
-        String tk = ApiCallerUtil.callApi(mac);
-        log.info("获取到的token为:{}", tk);
-
-        // 初始化任务,立即执行一次
-        Runnable registrationTask = () -> {
-            HttpResponse httpResponse = HttpRequest.post(apiUrl)
-                    .form("mac", mac)
-                    .form("url", url)
-                    .form("tk", tk)
-                    .execute();
-            String body = httpResponse.body();
-            // 解析JSON响应
-            JSONObject json = new JSONObject(body);
-            // 获取code和token的值
-            int code = json.getInt("code");
-            if (code != 0) {
-                throw new ServiceException("硬件回调url设置接口异常!");
-            }
-            log.info("响应结果为:{}", json);
-        };
-
-        // 每24小时执行一次任务
-        long initialDelay = 0; // 初始延迟为0秒,即立即执行
-        long period = 24 * 60 * 60; // 24小时,以秒为单位
-
-        // 创建一个定时任务执行器
-        ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
-
-        // 启动定时任务
-        scheduler.scheduleAtFixedRate(registrationTask, initialDelay, period, TimeUnit.SECONDS);
-    }
-
-    public static void main(String[] args) {
-        // 分别调用设置回调地址方法,传入不同的MAC地址
-        String mac1 = "863569068848969";
-        String mac2 = "863569068849199";
-        setCallbackForMAC(mac1);
-        setCallbackForMAC(mac2);
-    }
-}
-
-
-
-

+ 68 - 163
framework/src/main/java/com/wteam/framework/modules/user/service/impl/UserServiceImpl.java

@@ -85,16 +85,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     private UserTokenGenerate UserTokenGenerate;
     @Autowired
     private UserService userService;
-    @Autowired
-    private OrderInfoMapper orderInfoMapper;
-    @Autowired
-    private CardMapper cardMapper;
-    @Autowired
-    private CouponUserMapper couponUserMapper;
-    @Autowired
-    private VenueMapper venueMapper;
-    @Autowired
-    private OrderInfoService orderInfoService;
+
 
 
     @Override
@@ -268,164 +259,78 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         }
     }
 
-    @Override
-    public ResultMessage showOrderType(String accessToken, orderTypeEnum orderTypeEnum) {
-        // 根据传入的token获取用户信息
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        if (authUser == null) {
-            return ResultUtil.error(ResultCode.USER_NOT_FOUND);
-        }
-        Long userId = Long.valueOf(authUser.getId());
-        //构造查询条件
-        LambdaQueryWrapper<OrderInfo> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(OrderInfo::getUserId, userId).eq(OrderInfo::getOrderType, orderTypeEnum);
-        // 获取用户的订单信息
-        List<OrderInfo> orderInfos = orderInfoMapper.selectList(queryWrapper);
-        //校验
-        if (orderInfos.isEmpty()) {
-            return ResultUtil.success();
-        }
-        // 返回成功结果
-        return ResultUtil.data(orderInfos);
-    }
-
-    @Override
-    public ResultMessage showMyCard(Long id, CardTypeEnum cardTypeEnum) {
-        //构造查询条件
-        LambdaQueryWrapper<Card> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(Card::getUserId, id).eq(Card::getCardType, cardTypeEnum);
-        // 获取用户的该类型卡的信息
-        List<Card> cardsInfos = cardMapper.selectList(queryWrapper);
-        //校验
-        if (cardsInfos.isEmpty()) {
-            return ResultUtil.success();
-        }
-        // 返回成功结果
-        return ResultUtil.data(cardsInfos);
-    }
 
-    @Override
-    public ResultMessage showMyCoupon(@NotNull String accessToken) {
-        // 根据传入的token获取用户信息
-        AuthUser authUser = UserContext.getAuthUser(accessToken);
-        if (authUser == null) {
-            return ResultUtil.error(ResultCode.USER_NOT_FOUND);
-        }
-        Long userId = Long.valueOf(authUser.getId());
-        //查询信息
-        CouponUser couponUser = couponUserMapper.selectById(userId);
-        return ResultUtil.data(couponUser);
-    }
 
-    @Override
-    public ResultMessage showOrder(@NotNull String id) {
-        OrderInfo orderInfo = orderInfoMapper.selectById(id);
-        //先判断订单状态
-        if (orderInfo == null) {
-            return ResultUtil.error(ResultCode.ORDER_STATE_ERROR);
-        }
-        log.info("此时获得的订单信息为:{}", orderInfo);
-        String orderType = orderInfo.getOrderType();
-        String qrCode = orderInfo.getQrCode();
-        //如果是次卡订单或者月卡订单,就直接弹出二维码返回即可
-        if ("TICKET".equals(orderType) || "MONTHLY".equals(orderType)) {
-            return ResultUtil.data(qrCode);
-        }
 
-        if ("TIMER".equals(orderType)) {
-            return ResultUtil.data(orderInfo);
-        }
-        Long venueId = orderInfo.getVenueId();
-        log.info("此时获得的场地id为:{}", venueId);
-        Venue venue = venueMapper.selectById(venueId);
-        String venueName = venue.getVenueName();
-        String venueType = venue.getVenueType();
-        OrderInfoVo orderInfoVo = new OrderInfoVo();
-        BeanUtil.copyProperties(orderInfo, orderInfoVo);
-        orderInfoVo.setVenueName(venueName);
-        orderInfoVo.setVenueType(venueType);
-        if (ObjectUtil.isNull(orderInfoVo)) {
-            return ResultUtil.success();
-        }
-        return ResultUtil.data(orderInfoVo);
-    }
 
 
-    public void queryOrdersAndDeleteNullStatusOrders() {
-        //构成查询条件
-        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(OrderInfo::getOrderState, null);
-        orderInfoMapper.delete(lambdaQueryWrapper);
-    }
-
-
-    //TODO:这里的订单状态要修改
-    @Override
-    public ResultMessage showOrderByType(@NotNull String id, OrderTypeEnums orderTypeEnum) throws NullPointerException {
-        log.info("此时传入的订单类型为:{}", orderTypeEnum);
-        //删除订单状态为null的订单
-        //构成查询条件
-        LambdaQueryWrapper<OrderInfo> deleteQueryWrapper = new LambdaQueryWrapper<>();
-        deleteQueryWrapper.eq(OrderInfo::getOrderState, null);
-        orderInfoService.remove(deleteQueryWrapper);
-
-        //先获取到这个用户的所有订单
-        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(OrderInfo::getOrderType, orderTypeEnum).eq(OrderInfo::getUserId, id);
-        List<OrderInfo> orderInfos = orderInfoMapper.selectList(lambdaQueryWrapper);
-
-        //过滤掉订单状态异常和没有二维码的订单
-        List<OrderInfo> collect = orderInfos.stream().filter(orderInfo -> orderInfo.getOrderState() != null).filter(orderInfo -> orderInfo.getQrCode() != null).collect(Collectors.toList());
-        log.info("过滤之后的订单信息为:{}", collect);
-
-        //TODO:这里查询出来过期的订单对应的订单状态需要修改
-        //修改过期的订单状态
-        List<OrderInfo> orderInfoList = new ArrayList<>();
-
-        // 获取当前时间
-        Date currentTime = new Date();
-        for (OrderInfo orderInfo : collect) {
-            // 订单结束时间字符串解析为Date对象
-            Date orderEndTime = orderInfo.getOrderEd();
-            log.info("订单结束时间为:{}", orderEndTime);
-
-            // 假设订单已经过期的阈值为5分钟
-            long threshold = 5 * 60 * 1000;
-            if (orderEndTime != null && orderEndTime.getTime() + threshold < currentTime.getTime()) {
-                // 订单已经过期,将订单状态设置为已经过期
-                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.EXPIRED));
-
-                // 更新订单状态到数据库
-                orderInfoService.updateById(orderInfo);
-                orderInfoList.add(orderInfo);
-                log.info("更新的订单信息为:{}", orderInfo);
-
-            } else {
-
-                orderInfoList.add(orderInfo);
-
-            }
-        }
-
-        List<OrderInfoVo> rentalOrders = new ArrayList<>();
-
-        // 租场订单提供租场信息
-        if (orderTypeEnum.equals(OrderTypeEnums.RENTAL)) {
-            for (OrderInfo orderInfo : orderInfoList) {
-                Long venueId = orderInfo.getVenueId();
-                Venue venue = venueMapper.selectById(venueId);
-                OrderInfoVo orderInfoVo = new OrderInfoVo();
-                BeanUtil.copyProperties(orderInfo, orderInfoVo);
-                orderInfoVo.setVenueType(venue.getVenueType());
-                orderInfoVo.setVenueName(venue.getVenueName());
-                log.info("此时的返回数据为:{}", orderInfoVo);
-                rentalOrders.add(orderInfoVo);
-            }
-        }
-        log.info("此时的rentalOrders为:{}", rentalOrders);
-        return orderTypeEnum.equals(OrderTypeEnums.RENTAL) ? ResultUtil.data(rentalOrders) : ResultUtil.data(orderInfoList);
-    }
-
+//    //TODO:这里的订单状态要修改
+//    @Override
+//    public ResultMessage showOrderByType(@NotNull String id, OrderTypeEnums orderTypeEnum) throws NullPointerException {
+//        log.info("此时传入的订单类型为:{}", orderTypeEnum);
+//        //删除订单状态为null的订单
+//        //构成查询条件
+//        LambdaQueryWrapper<OrderInfo> deleteQueryWrapper = new LambdaQueryWrapper<>();
+//        deleteQueryWrapper.eq(OrderInfo::getOrderState, null);
+//        orderInfoService.remove(deleteQueryWrapper);
+//
+//        //先获取到这个用户的所有订单
+//        LambdaQueryWrapper<OrderInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+//        lambdaQueryWrapper.eq(OrderInfo::getOrderType, orderTypeEnum).eq(OrderInfo::getUserId, id);
+//        List<OrderInfo> orderInfos = orderInfoMapper.selectList(lambdaQueryWrapper);
+//
+//        //过滤掉订单状态异常和没有二维码的订单
+//        List<OrderInfo> collect = orderInfos.stream().filter(orderInfo -> orderInfo.getOrderState() != null).filter(orderInfo -> orderInfo.getQrCode() != null).collect(Collectors.toList());
+//        log.info("过滤之后的订单信息为:{}", collect);
+//
+//        //TODO:这里查询出来过期的订单对应的订单状态需要修改
+//        //修改过期的订单状态
+//        List<OrderInfo> orderInfoList = new ArrayList<>();
+//
+//        // 获取当前时间
+//        Date currentTime = new Date();
+//        for (OrderInfo orderInfo : collect) {
+//            // 订单结束时间字符串解析为Date对象
+//            Date orderEndTime = orderInfo.getOrderEd();
+//            log.info("订单结束时间为:{}", orderEndTime);
+//
+//            // 假设订单已经过期的阈值为5分钟
+//            long threshold = 5 * 60 * 1000;
+//            if (orderEndTime != null && orderEndTime.getTime() + threshold < currentTime.getTime()) {
+//                // 订单已经过期,将订单状态设置为已经过期
+//                orderInfo.setOrderState(String.valueOf(OrderStatusEnum.EXPIRED));
+//
+//                // 更新订单状态到数据库
+//                orderInfoService.updateById(orderInfo);
+//                orderInfoList.add(orderInfo);
+//                log.info("更新的订单信息为:{}", orderInfo);
+//
+//            } else {
+//
+//                orderInfoList.add(orderInfo);
+//
+//            }
+//        }
+//
+//        List<OrderInfoVo> rentalOrders = new ArrayList<>();
+//
+//        // 租场订单提供租场信息
+//        if (orderTypeEnum.equals(OrderTypeEnums.RENTAL)) {
+//            for (OrderInfo orderInfo : orderInfoList) {
+//                Long venueId = orderInfo.getVenueId();
+//                Venue venue = venueMapper.selectById(venueId);
+//                OrderInfoVo orderInfoVo = new OrderInfoVo();
+//                BeanUtil.copyProperties(orderInfo, orderInfoVo);
+//                orderInfoVo.setVenueType(venue.getVenueType());
+//                orderInfoVo.setVenueName(venue.getVenueName());
+//                log.info("此时的返回数据为:{}", orderInfoVo);
+//                rentalOrders.add(orderInfoVo);
+//            }
+//        }
+//        log.info("此时的rentalOrders为:{}", rentalOrders);
+//        return orderTypeEnum.equals(OrderTypeEnums.RENTAL) ? ResultUtil.data(rentalOrders) : ResultUtil.data(orderInfoList);
+//    }
+//
 
     @Override
     public ResultMessage exit(HttpServletRequest request) {

+ 3 - 3
generator/src/main/resources/application.yml

@@ -9,9 +9,9 @@ spring:
     type: com.alibaba.druid.pool.DruidDataSource
     #MySQL配置:
     driverClassName: com.mysql.cj.jdbc.Driver
-    username: hf_lms
-    password: MZLhMy6JbSM36Ffx
-    url: jdbc:mysql://43.138.210.149:3306/hf_lms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+    username: edu
+    password: CFHPKpZzGcrzY7Hm
+    url: jdbc:mysql://120.24.169.140:3306/edu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
     #oracle配置
 #    driverClassName: oracle.jdbc.OracleDriver
 #    url: jdbc:oracle:thin:@192.168.10.10:1521:xe