liu 2 лет назад
Родитель
Сommit
418cb0f7be
100 измененных файлов с 9795 добавлено и 561 удалено
  1. 1 0
      .idea/encodings.xml
  2. 580 101
      .idea/workspace.xml
  3. 0 222
      hs_err_pid5336.log
  4. 35 0
      pom.xml
  5. 1 1
      src/main/java/com/template/AutoCode.java
  6. 22 0
      src/main/java/com/template/MybatisPlusApplication.java
  7. 21 3
      src/main/java/com/template/api/AdminAPI.java
  8. 15 8
      src/main/java/com/template/api/AdminMenuAPI.java
  9. 7 0
      src/main/java/com/template/api/AlarmMessageControllerAPI.java
  10. 27 0
      src/main/java/com/template/api/ApartmentSettingControllerAPI.java
  11. 25 0
      src/main/java/com/template/api/AppletLoginControllerAPI.java
  12. 43 0
      src/main/java/com/template/api/ApplicationProcedureControllerAPI.java
  13. 21 0
      src/main/java/com/template/api/ApplicationProcedureSettingControllerApi.java
  14. 34 0
      src/main/java/com/template/api/ApplicationProcedureTemporaryControllerAPI.java
  15. 23 0
      src/main/java/com/template/api/CallSystemControllerAPI.java
  16. 27 0
      src/main/java/com/template/api/CheckOutSettingControllerAPI.java
  17. 9 0
      src/main/java/com/template/api/ElectricEquipmentControllerAPI.java
  18. 38 0
      src/main/java/com/template/api/FacilityServicesControllerAPI.java
  19. 19 5
      src/main/java/com/template/api/HouseAPI.java
  20. 44 0
      src/main/java/com/template/api/HouseLockControllerAPI.java
  21. 36 0
      src/main/java/com/template/api/HouseNumberControllerAPI.java
  22. 46 6
      src/main/java/com/template/api/HouseOrderAPI.java
  23. 4 0
      src/main/java/com/template/api/LoginControllerAPI.java
  24. 17 0
      src/main/java/com/template/api/OperatingRecordControllerAPI.java
  25. 7 0
      src/main/java/com/template/api/PayRecordControllerAPI.java
  26. 2 0
      src/main/java/com/template/api/PermissionSettingAPI.java
  27. 22 0
      src/main/java/com/template/api/SubsidySetupControllerAPI.java
  28. 36 0
      src/main/java/com/template/api/UnlockingAdminControllerAPI.java
  29. 10 0
      src/main/java/com/template/api/UnlockingControllerAPI.java
  30. 16 0
      src/main/java/com/template/api/UnlockingRecordControllerAPI.java
  31. 17 4
      src/main/java/com/template/api/UsersAPI.java
  32. 8 9
      src/main/java/com/template/api/UsersMenuAPI.java
  33. 2 0
      src/main/java/com/template/common/utils/AesUtils.java
  34. 114 0
      src/main/java/com/template/common/utils/HttpUtils.java
  35. 535 0
      src/main/java/com/template/common/utils/HttpsClient.java
  36. 23 0
      src/main/java/com/template/common/utils/JWTUtil.java
  37. 85 0
      src/main/java/com/template/common/utils/MessageDecryptUtil.java
  38. 23 0
      src/main/java/com/template/common/utils/MyX509TrustManager.java
  39. 111 0
      src/main/java/com/template/common/utils/PasswordChecker.java
  40. 49 0
      src/main/java/com/template/common/utils/PushMessage.java
  41. 165 0
      src/main/java/com/template/common/utils/RSATest.java
  42. 14 3
      src/main/java/com/template/common/utils/RSAUtils.java
  43. 42 0
      src/main/java/com/template/common/utils/SHA1.java
  44. 105 0
      src/main/java/com/template/common/utils/StrUtils.java
  45. 261 0
      src/main/java/com/template/common/utils/SubscribeSample.java
  46. 657 0
      src/main/java/com/template/common/utils/TimeExchange.java
  47. 270 0
      src/main/java/com/template/common/utils/WechatPayApiV3Util.java
  48. 53 0
      src/main/java/com/template/common/utils/WxConstants.java
  49. 445 0
      src/main/java/com/template/common/utils/WxUtil.java
  50. 1 1
      src/main/java/com/template/common/utils/weixin/DictionaryCompare.java
  51. 237 0
      src/main/java/com/template/common/utils/weixin/UnifiedOrderVO.java
  52. 26 0
      src/main/java/com/template/config/WxPayV3Config.java
  53. 229 7
      src/main/java/com/template/controller/AdminController.java
  54. 114 1
      src/main/java/com/template/controller/AdminMenuController.java
  55. 21 0
      src/main/java/com/template/controller/AlarmMessageController.java
  56. 133 0
      src/main/java/com/template/controller/ApartmentSettingController.java
  57. 174 0
      src/main/java/com/template/controller/AppletLoginController.java
  58. 424 0
      src/main/java/com/template/controller/ApplicationProcedureController.java
  59. 65 0
      src/main/java/com/template/controller/ApplicationProcedureSettingController.java
  60. 405 0
      src/main/java/com/template/controller/ApplicationProcedureTemporaryController.java
  61. 93 0
      src/main/java/com/template/controller/CallSystemController.java
  62. 88 0
      src/main/java/com/template/controller/CheckOutSettingController.java
  63. 21 0
      src/main/java/com/template/controller/ElectricEquipmentController.java
  64. 145 0
      src/main/java/com/template/controller/FacilityServicesController.java
  65. 166 14
      src/main/java/com/template/controller/HouseController.java
  66. 326 3
      src/main/java/com/template/controller/HouseLockController.java
  67. 269 2
      src/main/java/com/template/controller/HouseNumberController.java
  68. 168 16
      src/main/java/com/template/controller/HouseNumberStateController.java
  69. 1340 109
      src/main/java/com/template/controller/HouseOrderController.java
  70. 17 1
      src/main/java/com/template/controller/LoginController.java
  71. 68 0
      src/main/java/com/template/controller/OperatingRecordController.java
  72. 240 26
      src/main/java/com/template/controller/PasswordIssController.java
  73. 21 0
      src/main/java/com/template/controller/PayRecordController.java
  74. 21 0
      src/main/java/com/template/controller/RefundRecordController.java
  75. 85 0
      src/main/java/com/template/controller/SubsidySetupController.java
  76. 260 0
      src/main/java/com/template/controller/UnlockingAdminController.java
  77. 2 2
      src/main/java/com/template/controller/UnlockingController.java
  78. 69 0
      src/main/java/com/template/controller/UnlockingRecordController.java
  79. 10 5
      src/main/java/com/template/controller/UploadServlet.java
  80. 51 4
      src/main/java/com/template/controller/UsersController.java
  81. 41 0
      src/main/java/com/template/controller/UsersMenuController.java
  82. 21 0
      src/main/java/com/template/controller/WaterEquipmentController.java
  83. 1 1
      src/main/java/com/template/core/JwtlnterceptorConfig.java
  84. 15 7
      src/main/java/com/template/handler/MyMetaObjectHandler.java
  85. 20 0
      src/main/java/com/template/mapper/AlarmMessageMapper.java
  86. 18 0
      src/main/java/com/template/mapper/ApartmentSettingMapper.java
  87. 27 0
      src/main/java/com/template/mapper/ApplicationProcedureMapper.java
  88. 16 0
      src/main/java/com/template/mapper/ApplicationProcedureSettingMapper.java
  89. 28 0
      src/main/java/com/template/mapper/ApplicationProcedureTemporaryMapper.java
  90. 18 0
      src/main/java/com/template/mapper/CallSystemMapper.java
  91. 18 0
      src/main/java/com/template/mapper/CheckOutSettingMapper.java
  92. 18 0
      src/main/java/com/template/mapper/ElectricEquipmentMapper.java
  93. 18 0
      src/main/java/com/template/mapper/FacilityServicesMapper.java
  94. 3 0
      src/main/java/com/template/mapper/HouseMapper.java
  95. 5 0
      src/main/java/com/template/mapper/HouseNumberMapper.java
  96. 18 0
      src/main/java/com/template/mapper/OperatingRecordMapper.java
  97. 18 0
      src/main/java/com/template/mapper/PayRecordMapper.java
  98. 18 0
      src/main/java/com/template/mapper/RefundRecordMapper.java
  99. 18 0
      src/main/java/com/template/mapper/SubsidySetupMapper.java
  100. 0 0
      src/main/java/com/template/mapper/UnlockingAdminMapper.java

+ 1 - 0
.idea/encodings.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="Encoding">
+    <file url="file://D:/soft/maven-repository/org/springframework/boot/spring-boot-starter-parent/2.4.0/src/main/resources" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
   </component>
 </project>

+ 580 - 101
.idea/workspace.xml

@@ -5,52 +5,434 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="42a0d34b-c484-4704-92dd-be5ac61d2f66" name="Changes" comment="">
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/AlarmMessageControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/ApartmentSettingControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/AppletLoginControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/ApplicationProcedureControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/ApplicationProcedureSettingControllerApi.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/ApplicationProcedureTemporaryControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/CallSystemControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/CheckOutSettingControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/ElectricEquipmentControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/FacilityServicesControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/HouseLockControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/HouseNumberControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/OperatingRecordControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/PayRecordControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/SubsidySetupControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/UnlockingAdminControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/UnlockingControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/api/UnlockingRecordControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/HttpUtils.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/HttpsClient.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/MessageDecryptUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/MyX509TrustManager.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/PasswordChecker.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/PushMessage.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/SHA1.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/StrUtils.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/SubscribeSample.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/TimeExchange.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/WechatPayApiV3Util.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/WxConstants.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/WxUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/weixin/UnifiedOrderVO.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/config/WxPayV3Config.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/AppletLoginController.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/AdminDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/ApartmentSettingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/AppletApprovalProcessDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/ApplicationProcedurSettingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/ApplicationProcedureDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/ApplicationProcedureTemporaryDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/ApprovalProcessDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/BingingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CallSystemSaveOrUpdateDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CancelAppletDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CheckOutAppletDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CheckOutSettingSaveOrUpdateDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/FacilityServicesSaveDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/FacilityServicesUpdateDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/HouseNumberBindingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/HouseNumberDeleteBindingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/KeyCardDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/KeyFingerprintDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/KeyPassWordDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/RemoteUnlocking.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/SaveAdminDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/SubsidySetupSaveOrUpdateDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/UpdateAdminDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/UpdateMenuPermissionSettingDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/WxPayDto.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/enumModel/ePayStatu.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/mqtt/MqttConfiguration.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/mqtt/MqttPushClient.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/mqtt/PushCallback.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/mqtt/SpringUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/AdminMenuVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/AdminVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/ApartmentSettingVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/ApplicationProcedureTemporaryVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/ApplicationProcedureVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/CoverPictureVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/HouseAppletPageVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/HouseOrderVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/OrderPageVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/UnlockingKeyVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/UsersPageVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/houseLockListVo.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/BizCodeEnume.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/DateTimeZoneUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/FileIOUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/JSAPIPayParamVO.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/MyRestTempleteUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/PayUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/RRException.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/SecurityUtil.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/WechatPayV3Util.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/resources/cert/apiclient_cert.p12" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/resources/cert/apiclient_cert.pem" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/resources/cert/apiclient_key.pem" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/resources/cert/wx_cert.pem" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hs_err_pid5336.log" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/AutoCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/AutoCode.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/MybatisPlusApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/MybatisPlusApplication.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/AdminAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/AdminAPI.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/AdminMenuAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/AdminMenuAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/HouseAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/HouseAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/HouseOrderAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/HouseOrderAPI.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/LoginControllerAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/LoginControllerAPI.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/RepairAdminControllerAPI.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/PermissionSettingAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/PermissionSettingAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/UsersAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/UsersAPI.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/UsersMenuAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/UsersMenuAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/AesUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/AesUtils.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/JWTUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/JWTUtil.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/RSAUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/RSAUtils.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/weixin/DictionaryCompare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/weixin/DictionaryCompare.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/AdminController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/AdminController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/AdminMenuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/AdminMenuController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseLockController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseLockController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/LoginController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/LoginController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/RepairAdminController.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/PasswordIssController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/PasswordIssController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/UnlockingController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/UnlockingController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/UploadServlet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/UploadServlet.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/UsersController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/UsersController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/UsersMenuController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/UsersMenuController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/RepairAdminMapper.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/core/JwtlnterceptorConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/core/JwtlnterceptorConfig.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/handler/MyMetaObjectHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/handler/MyMetaObjectHandler.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/HouseMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/mapper/HouseMapper.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/HouseNumberMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/mapper/HouseNumberMapper.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/UnlockingMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/mapper/UnlockingMapper.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/mapper/UsersMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/mapper/UsersMapper.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CardInfoDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CardInfoDto.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CheckIdCardDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/CheckIdCardDto.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/dto/RoomChangeDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/RoomChangeDto.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/dto/UsersDto.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/dto/UsersDto.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/enumModel/PasswordUrlEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/enumModel/PasswordUrlEnum.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Admin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Admin.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/RepairAdmin.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/AdminMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/AdminMenu.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/ClassSchedule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/ClassSchedule.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/House.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/House.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseLock.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseLock.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseNumber.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseNumber.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseNumberState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseNumberState.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseOrder.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseOrder.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseOrderBill.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HouseOrderBill.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HousePrice.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/HousePrice.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/PermissionSetting.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/PermissionSetting.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Unlocking.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Unlocking.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Users.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/Users.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/request/changePasswordRequest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/request/changePasswordRequest.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/UsersMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/pojo/UsersMenu.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/vo/LoginVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/model/vo/LoginVO.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/RepairAdminService.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/AccessToken.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/CodeEntity.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/CodeEntityVo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/Ordering.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/Pay.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/PayResult.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/Users.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/WechatResult.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/WechatUnifiedOrder.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/Wechat_userinfo.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/WeiXinUtil.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/model/weixin/Wx_user.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/AdminMenuService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/AdminMenuService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/AdminService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/AdminService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/HouseNumberService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/HouseNumberService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/HouseService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/HouseService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/PermissionSettingService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/PermissionSettingService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/UnlockingService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/UnlockingService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/UsersMenuService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/UsersMenuService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/UsersService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/UsersService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/AdminMenuServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/AdminMenuServiceImpl.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/AdminServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/AdminServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/RepairAdminServiceImpl.java" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/RepairAdminMapper.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/repair/model/request/changePasswordRequest.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/AdminAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/api/AdminAPI.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/AdminMenuAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/api/AdminMenuAPI.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/LoginControllerAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/api/LoginControllerAPI.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/RepairAdminControllerAPI.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/UsersMenuAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/api/UsersMenuAPI.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/JWTUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/common/utils/JWTUtil.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/RSAUtils.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/common/utils/RSAUtils.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/AdminController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/controller/AdminController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/AdminMenuController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/controller/AdminMenuController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/LoginController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/controller/LoginController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/RepairAdminController.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UsersController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/controller/UsersController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UsersMenuController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/controller/UsersMenuController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/RepairAdminMapper.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Admin.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Admin.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/RepairAdmin.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Users.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Users.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/LoginVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/model/vo/LoginVO.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/RepairAdminService.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/AdminServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/template/services/impl/AdminServiceImpl.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/RepairAdminServiceImpl.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/RepairAdminMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/HouseNumberServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/HouseNumberServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/HouseServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/HouseServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/PermissionSettingServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/PermissionSettingServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UnlockingServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UnlockingServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UsersMenuServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UsersMenuServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UsersServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/services/impl/UsersServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-dev.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application-prod.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-prod.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/HouseMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/HouseMapper.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/HouseNumberMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/HouseNumberMapper.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/UnlockingMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/UnlockingMapper.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/mapper/template/UsersMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/mapper/template/UsersMapper.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/META-INF/spring-configuration-metadata.json" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application-dev.yml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application-prod.yml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application.yml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/repair/model/request/freezeRepairAdminRequest.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/repair/model/request/queryAccountPageRequest.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/repair/model/request/updateRepairAdminRequest.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/AutoCode.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/MybatisPlusApplication.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/annotation/ControllerIsShow.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/annotation/Encrypt.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/annotation/PassToken.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/annotation/UserLoginCheck.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/aop/LoginCheckAspect.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/AdminAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/AdminMenuAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/ClassScheduleAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/ExcelControllerAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/HouseAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/HouseNumberStateAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/HouseOrderAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/HousePriceAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/LoginControllerAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/PermissionSettingAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/UsersAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/api/UsersMenuAPI.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/annotation/Generator.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/annotation/IgnorePermissionsCheck.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/exception/EmsException.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/exception/EmsExceptionHandler.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/exception/MyCustomException.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/result/Code.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/result/ResponseStatusEnum.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/AES.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/AesUtils.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/CommonUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/DateUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/DoorLockAESUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/DoorLockMD5Util.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/EncryptionUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/ExcelUtils.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/FileUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/Func.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/HttpClientHelper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/JWTUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/MD5.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/MyBase64.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/RSAUtils.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/SendSms.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/ValidateCode.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/WaterElectricDataEncAndDecUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/WaterElectricSignUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/paramUtils.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/smsUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/DictionaryCompare.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/EndPay.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/JaxbUtil$CollectionWrapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/JaxbUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/PayWxUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/common/utils/weixin/TongYiReturn.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/component/WaterElectricComponent.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/component/WeiXiaoComponent$1.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/component/WeiXiaoComponent.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/config/DoorLockConfig.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/config/MyBatisPlusConfig.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/config/MySecurity.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/config/WaterElectricConfig.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/config/WeixiaoConfig.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/AdminController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/AdminMenuController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/ClassScheduleController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/ExcelController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseLockController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseNumberController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseNumberStateController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseOrderBillController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HouseOrderController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/HousePriceController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/LoginController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/PasswordIssController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/PermissionSettingController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UnlockingController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UploadServlet.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UsersController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/controller/UsersMenuController.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/CORSConfiguration$1.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/CORSConfiguration.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/JwtAuthenticationInterceptor.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/JwtlnterceptorConfig.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/ReplaceStreamFilter.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/RequestWrapper$1.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/RequestWrapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/core/SwaggerConfiguration.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/handle/NonStaticResourceHttpRequestHandler.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/handler/MyMetaObjectHandler.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/AdminMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/AdminMenuMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/ClassScheduleMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseLockMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseNumberMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseNumberStateMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseOrderBillMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HouseOrderMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/HousePriceMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/PermissionSettingMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/UnlockingMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/UsersMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/mapper/UsersMenuMapper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/AlterDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/AlterPriceDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/BillHandleResultDTO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/CancelDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/CardInfoDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/CheckIdCardDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/CheckOutDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/CleanRoomDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/DirtyRoomDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/EstablishOrderDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/EventMessageDTO$EventMessageDTOBuilder.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/EventMessageDTO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/FingerprintDataDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/HouseDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/HousePriceAlterDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/LockRoomDTO$LockRoomDTOBuilder.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/LockRoomDTO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/MaintainDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/PasswordDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/ReserveDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/RoomChangeDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/SaveParentDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/SaveParentUserDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/SaveSecondaryDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/SaveSecondaryUserDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/UsersDetailsDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/dto/UsersDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/enumModel/PasswordUrlEnum.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/enumModel/eIsSuper.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/enumModel/eStatu.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Admin.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/AdminMenu.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/ClassSchedule.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/House.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HouseLock.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HouseNumber.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HouseNumberState.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HouseOrder.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HouseOrderBill.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/HousePrice.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/LockRoomDto.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/PermissionSetting.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Unlocking.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/Users.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/pojo/UsersMenu.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/request/changePasswordRequest.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/request/loginRequest.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/result/BaseResult.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/result/CommonResult.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/result/PageUtils.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/AdminMenuTreeVo$AdminMenuTreeVoBuilder.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/AdminMenuTreeVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/AlterPriceRecordVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/CalendarPageVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/ClassListVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseNumberStateDateVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseNumberStatePageVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseOrderPageListVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HousePricePageVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HousePriceVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseStateVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseStustaVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HouseVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/HousedetailsVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/LoginVO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/ParticularHouseNumberStatusVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/PermissionsDetailVO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/PermissionsTreeVO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/PermissionsVO.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/PriceVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/QueryExportVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/ReserveDayVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/RoomTypeVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/vo/ScheduleVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/AccessToken.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/CodeEntity.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/CodeEntityVo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/Ordering.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/Pay.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/PayResult.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/Users.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/WechatResult.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/WechatUnifiedOrder.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/Wechat_userinfo.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/WeiXinUtil.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/model/weixin/Wx_user.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/AdminMenuService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/AdminService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/ClassScheduleService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseLockService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseNumberService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseNumberStateService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseOrderBillService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseOrderService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HousePriceService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/HouseService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/PermissionSettingService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/UnlockingService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/UsersMenuService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/UsersService.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/AdminMenuServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/AdminServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/ClassScheduleServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseLockServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseNumberServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseNumberStateServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseOrderBillServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseOrderServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HousePriceServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/HouseServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/PermissionSettingServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/UnlockingServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/UsersMenuServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/template/services/impl/UsersServiceImpl.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/AdminMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/AdminMenuMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/ClassScheduleMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseLockMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseNumberMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseNumberStateMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseOrderBillMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HouseOrderMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/HousePriceMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/PermissionSettingMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/UnlockingMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/UsersMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/mapper/template/UsersMenuMapper.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-archiver/pom.properties" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/test-classes/com/template/MybatisPlusApplicationTests.class" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/test-classes/com/template/WrapperTest.class" beforeDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -90,40 +472,45 @@
     <option name="showExcludedFiles" value="false" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "RequestMappingsPanelOrder0": "0",
-    "RequestMappingsPanelOrder1": "1",
-    "RequestMappingsPanelWidth0": "75",
-    "RequestMappingsPanelWidth1": "75",
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "SHARE_PROJECT_CONFIGURATION_FILES": "true",
-    "WebServerToolWindowFactoryState": "false",
-    "last_opened_file_path": "E:/company/backend_code",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "project.structure.last.edited": "Project",
-    "project.structure.proportion": "0.15",
-    "project.structure.side.proportion": "0.0",
-    "settings.editor.selected.configurable": "MavenSettings",
-    "spring.configuration.checksum": "f6966ce39847c3d9a18b4a1dfc3fec06"
+  <component name="PropertiesComponent">{
+  &quot;keyToString&quot;: {
+    &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
+    &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
+    &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
+    &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
+    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+    &quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
+    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
+    &quot;last_opened_file_path&quot;: &quot;E:/2024project/iHotel_student_houtai&quot;,
+    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+    &quot;project.structure.last.edited&quot;: &quot;Project&quot;,
+    &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
+    &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
+    &quot;settings.editor.selected.configurable&quot;: &quot;MavenSettings&quot;,
+    &quot;spring.configuration.checksum&quot;: &quot;f6966ce39847c3d9a18b4a1dfc3fec06&quot;
   }
-}]]></component>
+}</component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="E:\2024project\iHotel_student_houtai\src\main\resources" />
       <recent name="E:\company\iHotel_student_houtai\src\main\java\com\template\common\utils" />
       <recent name="E:\company\iHotel_student_houtai\src\main\java\com\template\model\weixin" />
     </key>
     <key name="MoveFile.RECENT_KEYS">
+      <recent name="E:\2024project\iHotel_student_houtai\src\main\resources\mapper\template" />
       <recent name="E:\company\iHotel_student_houtai\src\main\resources\mapper\template" />
       <recent name="E:\company\iHotel_student_houtai\src\main\resources\mapper" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
       <recent name="com.template.common.utils" />
+      <recent name="com.template.common.utils.weixin" />
       <recent name="com.template.model.weixin" />
+      <recent name="com.template.config" />
     </key>
   </component>
   <component name="RunDashboard">
@@ -134,6 +521,32 @@
     </option>
   </component>
   <component name="RunManager" selected="Spring Boot.MybatisPlusApplication">
+    <configuration name="AesUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.template.common.utils.AesUtils" />
+      <module name="iHotel_student_houtai" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.template.common.utils.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="AppletLoginController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.template.controller.AppletLoginController" />
+      <module name="iHotel_student_houtai" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.template.controller.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration name="AutoCode" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
       <option name="MAIN_CLASS_NAME" value="com.template.AutoCode" />
       <module name="iHotel_student_houtai" />
@@ -147,12 +560,12 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="RSAUtils" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
-      <option name="MAIN_CLASS_NAME" value="com.template.common.utils.RSAUtils" />
+    <configuration name="DateTimeZoneUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.template.model.weixin.DateTimeZoneUtil" />
       <module name="iHotel_student_houtai" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="com.template.common.utils.*" />
+          <option name="PATTERN" value="com.template.model.weixin.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
@@ -160,8 +573,8 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
-    <configuration name="UsersMenuController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
-      <option name="MAIN_CLASS_NAME" value="com.template.controller.UsersMenuController" />
+    <configuration name="HouseOrderController" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.template.controller.HouseOrderController" />
       <module name="iHotel_student_houtai" />
       <extension name="coverage">
         <pattern>
@@ -188,20 +601,27 @@
       </method>
     </configuration>
     <list>
+      <item itemvalue="Application.AesUtils" />
+      <item itemvalue="Application.AppletLoginController" />
+      <item itemvalue="Application.DateTimeZoneUtil" />
+      <item itemvalue="Application.HouseOrderController" />
       <item itemvalue="Application.AutoCode" />
-      <item itemvalue="Application.RSAUtils" />
-      <item itemvalue="Application.UsersMenuController" />
       <item itemvalue="Spring Boot.MybatisPlusApplication" />
     </list>
     <recent_temporary>
       <list>
-        <item itemvalue="Application.RSAUtils" />
-        <item itemvalue="Application.UsersMenuController" />
+        <item itemvalue="Application.DateTimeZoneUtil" />
+        <item itemvalue="Application.AppletLoginController" />
+        <item itemvalue="Application.AesUtils" />
+        <item itemvalue="Application.HouseOrderController" />
         <item itemvalue="Application.AutoCode" />
       </list>
     </recent_temporary>
   </component>
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="SpringBootOptions">
+    <option name="showAdditionalConfigNotification" value="false" />
+  </component>
   <component name="SshConsoleOptionsProvider">
     <option name="myEncoding" value="UTF-8" />
   </component>
@@ -215,6 +635,35 @@
       <workItem from="1700186265128" duration="1452000" />
       <workItem from="1700187845025" duration="272442000" />
       <workItem from="1701824578863" duration="148698000" />
+      <workItem from="1703235523569" duration="695000" />
+      <workItem from="1707035814786" duration="26000" />
+      <workItem from="1707125933388" duration="758000" />
+      <workItem from="1707127543620" duration="194000" />
+      <workItem from="1707183565887" duration="4060000" />
+      <workItem from="1708478601045" duration="43000" />
+      <workItem from="1708672733279" duration="19000" />
+      <workItem from="1708672767815" duration="12000" />
+      <workItem from="1708672786015" duration="3000" />
+      <workItem from="1708672802540" duration="50451000" />
+      <workItem from="1709263276404" duration="690000" />
+      <workItem from="1709272855362" duration="148572000" />
+      <workItem from="1710723486251" duration="146091000" />
+      <workItem from="1711501418779" duration="16617000" />
+      <workItem from="1711588157060" duration="32709000" />
+      <workItem from="1711935512322" duration="2237000" />
+      <workItem from="1711955623454" duration="111270000" />
+      <workItem from="1712711167230" duration="81261000" />
+      <workItem from="1713230566228" duration="80634000" />
+      <workItem from="1714016912493" duration="11299000" />
+      <workItem from="1714984629640" duration="102282000" />
+      <workItem from="1715826083663" duration="6440000" />
+      <workItem from="1716780091292" duration="1118000" />
+      <workItem from="1717117321985" duration="1228000" />
+      <workItem from="1717380643450" duration="6764000" />
+      <workItem from="1718351916607" duration="1852000" />
+      <workItem from="1718589597123" duration="9394000" />
+      <workItem from="1718790560373" duration="618000" />
+      <workItem from="1718855981011" duration="9047000" />
     </task>
     <servers />
   </component>
@@ -246,74 +695,99 @@
           <option name="timeStamp" value="16" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
-          <line>168</line>
-          <option name="timeStamp" value="31" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
+          <line>533</line>
+          <option name="timeStamp" value="48" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
-          <line>418</line>
-          <option name="timeStamp" value="38" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
+          <line>858</line>
+          <option name="timeStamp" value="50" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
-          <line>172</line>
-          <option name="timeStamp" value="41" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
+          <line>623</line>
+          <option name="timeStamp" value="61" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
-          <line>141</line>
-          <option name="timeStamp" value="42" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
+          <line>678</line>
+          <option name="timeStamp" value="62" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>149</line>
-          <option name="timeStamp" value="47" />
+          <line>642</line>
+          <option name="timeStamp" value="64" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>521</line>
-          <option name="timeStamp" value="48" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/UsersMenuController.java</url>
+          <line>108</line>
+          <option name="timeStamp" value="72" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>827</line>
-          <option name="timeStamp" value="50" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/common/utils/SubscribeSample.java</url>
+          <line>103</line>
+          <option name="timeStamp" value="129" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/PasswordIssController.java</url>
-          <line>110</line>
-          <option name="timeStamp" value="55" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/common/utils/SubscribeSample.java</url>
+          <line>114</line>
+          <option name="timeStamp" value="130" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>210</line>
-          <option name="timeStamp" value="58" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/common/utils/SubscribeSample.java</url>
+          <line>131</line>
+          <option name="timeStamp" value="131" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/common/utils/SubscribeSample.java</url>
+          <line>135</line>
+          <option name="timeStamp" value="132" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/UnlockingAdminController.java</url>
+          <line>112</line>
+          <option name="timeStamp" value="163" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/UnlockingAdminController.java</url>
+          <line>102</line>
+          <option name="timeStamp" value="166" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
-          <line>344</line>
-          <option name="timeStamp" value="60" />
+          <line>1754</line>
+          <option name="timeStamp" value="179" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>611</line>
-          <option name="timeStamp" value="61" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
+          <line>1570</line>
+          <option name="timeStamp" value="181" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>666</line>
-          <option name="timeStamp" value="62" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/model/weixin/MyRestTempleteUtil.java</url>
+          <line>48</line>
+          <option name="timeStamp" value="203" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseNumberStateController.java</url>
-          <line>630</line>
-          <option name="timeStamp" value="64" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/model/weixin/MyRestTempleteUtil.java</url>
+          <line>33</line>
+          <option name="timeStamp" value="207" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/UsersMenuController.java</url>
-          <line>101</line>
-          <option name="timeStamp" value="72" />
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/model/weixin/MyRestTempleteUtil.java</url>
+          <line>49</line>
+          <option name="timeStamp" value="213" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
+          <line>1674</line>
+          <option name="timeStamp" value="218" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/HouseOrderController.java</url>
+          <line>1649</line>
+          <option name="timeStamp" value="223" />
         </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>
@@ -323,4 +797,9 @@
       </configuration>
     </watches-manager>
   </component>
+  <component name="com.intellij.coverage.CoverageDataManagerImpl">
+    <SUITE FILE_PATH="coverage/iHotel_student_houtai$SubscribeSample.ic" NAME="SubscribeSample Coverage Results" MODIFIED="1710380614726" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false">
+      <FILTER>com.template.common.utils.*</FILTER>
+    </SUITE>
+  </component>
 </project>

Разница между файлами не показана из-за своего большого размера
+ 0 - 222
hs_err_pid5336.log


+ 35 - 0
pom.xml

@@ -21,6 +21,41 @@
 
     <dependencies>
 
+
+        <!--<dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-java</artifactId>
+        </dependency>-->
+
+
+       <!-- <dependency>
+            <groupId>com.github.binarywang</groupId>
+            <artifactId>weixin-java-mp</artifactId>
+            <version>4.3.0</version>
+        </dependency>-->
+
+        <!-- xk-time -->
+        <dependency>
+            <groupId>com.github.xkzhangsan</groupId>
+            <artifactId>xk-time</artifactId>
+            <version>3.1.0</version>
+        </dependency>
+
+        <!-- hutool cache -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-cache</artifactId>
+            <version>5.3.3</version>
+        </dependency>
+
+
+        <!--        mqtt-->
+        <dependency>
+            <groupId>org.eclipse.paho</groupId>
+            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
+            <version>1.2.0</version>
+        </dependency>
+
         <dependency>
             <groupId>javax.validation</groupId>
             <artifactId>validation-api</artifactId>

+ 1 - 1
src/main/java/com/template/AutoCode.java

@@ -56,7 +56,7 @@ public class AutoCode {
         mpg.setPackageInfo(pc);
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("users_menu"); // 设置要映射的表名
+        strategy.setInclude("refund_record"); // 设置要映射的表名
         strategy.setNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);//下划线转驼峰
         strategy.setEntityLombokModel(true); // 自动lombok;

+ 22 - 0
src/main/java/com/template/MybatisPlusApplication.java

@@ -1,5 +1,7 @@
 package com.template;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cache.annotation.EnableCaching;
@@ -12,8 +14,28 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableScheduling//开启定时任务
 public class MybatisPlusApplication {
 
+//    //读取mqtt配置
+//    @Autowired
+//    private MqttConfiguration mqttConfiguration;
+
+
     public static void main(String[] args) {
 
         SpringApplication.run(MybatisPlusApplication.class, args);
     }
+
+//    /**
+//     * mqtt 初始化
+//     * @param args
+//     * @throws Exception
+//     */
+//    @Override
+//    public void run(ApplicationArguments args) throws Exception {
+//        if(true){
+//            MqttPushClient mqttPushClient = new MqttPushClient();
+//            mqttPushClient.connect(mqttConfiguration);
+//        }
+//    }
+
+
 }

+ 21 - 3
src/main/java/com/template/api/AdminAPI.java

@@ -1,18 +1,36 @@
 package com.template.api;
 
+import com.template.model.dto.AdminDto;
+import com.template.model.dto.SaveAdminDto;
+import com.template.model.dto.UpdateAdminDto;
+import com.template.model.pojo.Admin;
 import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("/auto/admin")
 public interface AdminAPI {
 
     @GetMapping("/getListPage")
     @ApiOperation(value = "管理端用户页面展示", notes = "管理端用户页面展示", httpMethod = "GET")
-    CommonResult getListPage(int page,int size,String keyWord );
+    CommonResult getListPage(@RequestParam int permissionSettingId,@RequestParam int page,@RequestParam int size, String keyWord,String startTime,String endTime,String status );
 
+    @PostMapping("/save")
+    @ApiOperation(value = "添加管理端用户", notes = "添加管理端用户", httpMethod = "GET")
+    CommonResult save(@RequestBody SaveAdminDto saveAdminDto);
 
+    @PostMapping("/update")
+    @ApiOperation(value = "管理端用户编辑", notes = "管理端用户编辑", httpMethod = "POST")
+    CommonResult update(@RequestBody UpdateAdminDto updateAdminDto);
 
 
+    @GetMapping("/delete")
+    @ApiOperation(value = "管理端用户删除", notes = "管理端用户删除", httpMethod = "GET")
+    CommonResult delete(@RequestParam int permissionSettingId,@RequestParam int id);
+
+
+    @GetMapping("/getUsersPage")
+    @ApiOperation(value = "移动端用户搜索栏", notes = "移动端用户搜索栏", httpMethod = "GET")
+    CommonResult getUsersPage(int permissionSettingId,int page,int size,String keyWord);
 }

+ 15 - 8
src/main/java/com/template/api/AdminMenuAPI.java

@@ -1,15 +1,12 @@
 package com.template.api;
 
-import com.template.model.dto.SaveParentDto;
-import com.template.model.dto.SaveSecondaryDto;
-import com.template.model.dto.UsersDto;
+import com.template.model.dto.*;
+import com.template.model.pojo.Admin;
+import com.template.model.pojo.AdminMenu;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("/auto/admin-menu")
 public interface AdminMenuAPI {
@@ -28,8 +25,18 @@ public interface AdminMenuAPI {
 
     @GetMapping("/adminListPage")
     @ApiOperation(value = "管理端角色分页列表", notes = "管理端角色分页列表", httpMethod = "GET")
-    CommonResult adminListPage(int adminMenuId,int page,int size,String keyWord,String startTime,String endTime);
+    CommonResult adminListPage(@RequestParam int adminMenuId, @RequestParam int page,@RequestParam int size, String keyWord, String startTime, String endTime);
 
+    @GetMapping("/getMenuPermissionSetting")
+    @ApiOperation(value = "获取角色权限", notes = "获取角色权限", httpMethod = "GET")
+    CommonResult getMenuPermissionSetting(@RequestParam String adminMenuId,@RequestParam String permissionSettingId);
 
+    @PostMapping("/updateMenuPermissionSetting")
+    @ApiOperation(value = "修改角色权限", notes = "修改角色权限", httpMethod = "POST")
+    CommonResult updateMenuPermissionSetting(@RequestBody UpdateMenuPermissionSettingDto updateMenuPermissionSetting);
+
+    @GetMapping("/delete")
+    @ApiOperation(value = "删除角色", notes = "删除角色", httpMethod = "GET")
+    CommonResult delete(@RequestParam Integer adminMenuId,@RequestParam String permissionSettingId);
 
 }

+ 7 - 0
src/main/java/com/template/api/AlarmMessageControllerAPI.java

@@ -0,0 +1,7 @@
+package com.template.api;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/alarm-message")
+public interface AlarmMessageControllerAPI {
+}

+ 27 - 0
src/main/java/com/template/api/ApartmentSettingControllerAPI.java

@@ -0,0 +1,27 @@
+package com.template.api;
+
+import com.template.model.dto.ApartmentSettingDto;
+import com.template.model.pojo.ApartmentSetting;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/apartment-setting")
+public interface ApartmentSettingControllerAPI {
+
+    @PostMapping("/updateOrSave")
+    @ApiOperation(value = "添加或修改公寓设置", notes = "添加或修改公寓设置", httpMethod = "POST")
+    CommonResult updateOrSave(@RequestBody ApartmentSettingDto apartmentSettingDto);
+
+    @GetMapping("/list")
+    @ApiOperation(value = "查看公寓设置", notes = "查看公寓设置", httpMethod = "GET")
+    CommonResult list(String permissionSettingId);
+
+    @GetMapping("/appletList")
+    @ApiOperation(value = "小程序——查看公寓设置", notes = "小程序——查看公寓设置", httpMethod = "GET")
+    CommonResult appletList();
+}

+ 25 - 0
src/main/java/com/template/api/AppletLoginControllerAPI.java

@@ -0,0 +1,25 @@
+package com.template.api;
+
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.io.UnsupportedEncodingException;
+
+@RequestMapping("/auto/appletLogin")
+@Api(tags = {"AppletLoginController"}, value = "移动端登录")
+public interface AppletLoginControllerAPI {
+
+    @GetMapping("/login")
+    @ApiOperation(value = "移动端登录", notes = "移动端登录", httpMethod = "GET")
+    String weixiaoAuth(String wxcode, String state) throws UnsupportedEncodingException;
+
+    @GetMapping(value = "/getOpenid")
+    @ApiOperation(value = "通过code获取openid", notes = "通过code获取openid", httpMethod = "GET")
+    CommonResult getOpenid(@RequestParam String code) throws Exception;
+
+
+}

+ 43 - 0
src/main/java/com/template/api/ApplicationProcedureControllerAPI.java

@@ -0,0 +1,43 @@
+package com.template.api;
+
+import com.template.model.dto.AppletApprovalProcessDto;
+import com.template.model.dto.ApplicationProcedureDto;
+import com.template.model.dto.ApprovalProcessDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("/auto/application-procedure")
+public interface ApplicationProcedureControllerAPI {
+
+    @PostMapping("/save")
+    @ApiOperation(value = "小程序流程管理申请", notes = "小程序流程管理申请", httpMethod = "POST")
+    CommonResult save(@RequestBody ApplicationProcedureDto applicationProcedureDto);
+
+    @GetMapping("/recordList")
+    @ApiOperation(value = "小程序流程管理记录", notes = "小程序流程管理记录", httpMethod = "GET")
+    CommonResult recordList(@RequestParam int usersId);
+
+    @GetMapping("/list")
+    @ApiOperation(value = "换课流程管理展示", notes = "换课流程管理展示", httpMethod = "GET")
+    CommonResult list(@RequestParam int adminMenuId,String submissionStartTime,String submissionEndTime,String examineAndApproveStartTime,String examineAndApproveEndTime,String type,String department,String key,int page,int size);
+
+    @PostMapping("/update")
+    @ApiOperation(value = "换课流程管理审批", notes = "换课流程管理审批", httpMethod = "POST")
+    CommonResult update(@RequestBody ApprovalProcessDto approvalProcessDto);
+
+    @PostMapping("/appletUpdate")
+    @ApiOperation(value = "小程序-换课流程管理审批", notes = "小程序-换课流程管理审批", httpMethod = "POST")
+    CommonResult appletUpdate(@RequestBody AppletApprovalProcessDto appletApprovalProcessDto);
+
+    @GetMapping("/appletList")
+    @ApiOperation(value = "小程序-换课流程管理展示", notes = "小程序-换课流程管理展示", httpMethod = "GET")
+    CommonResult appletList(int adminMenuId,String startTime,String endTime,String status,int page, int size);
+
+    @GetMapping("/statusDropDown")
+    @ApiOperation(value = "状态下拉框", notes = "状态下拉框", httpMethod = "GET")
+    CommonResult statusDropDown();
+
+
+
+}

+ 21 - 0
src/main/java/com/template/api/ApplicationProcedureSettingControllerApi.java

@@ -0,0 +1,21 @@
+package com.template.api;
+
+import com.template.model.dto.ApplicationProcedurSettingDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/application-procedure-setting")
+public interface ApplicationProcedureSettingControllerApi {
+
+    @PostMapping("/update")
+    @ApiOperation(value = "规则设置", notes = "规则设置", httpMethod = "POST")
+    CommonResult update(@RequestBody ApplicationProcedurSettingDto applicationProcedurSettingDto);
+
+
+
+
+
+}

+ 34 - 0
src/main/java/com/template/api/ApplicationProcedureTemporaryControllerAPI.java

@@ -0,0 +1,34 @@
+package com.template.api;
+
+import com.template.model.dto.AppletApprovalProcessDto;
+import com.template.model.dto.ApplicationProcedureDto;
+import com.template.model.dto.ApplicationProcedureTemporaryDto;
+import com.template.model.dto.ApprovalProcessDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("/auto/application-procedure-temporary")
+public interface ApplicationProcedureTemporaryControllerAPI {
+
+    @PostMapping("/save")
+    @ApiOperation(value = "小程序流程管理申请", notes = "小程序流程管理申请", httpMethod = "POST")
+    CommonResult save(@RequestBody ApplicationProcedureTemporaryDto applicationProcedureDto);
+
+    @GetMapping("/list")
+    @ApiOperation(value = "临时人员流程管理展示", notes = "临时人员流程管理展示", httpMethod = "GET")
+    CommonResult list(@RequestParam int adminMenuId, String submissionStartTime, String submissionEndTime, String examineAndApproveStartTime, String examineAndApproveEndTime, String type, String department, String key, int page, int size);
+
+    @PostMapping("/update")
+    @ApiOperation(value = "临时人员流程管理审批", notes = "临时人员流程管理审批", httpMethod = "POST")
+    CommonResult update(@RequestBody ApprovalProcessDto approvalProcessDto);
+
+    @PostMapping("/appletUpdate")
+    @ApiOperation(value = "小程序--临时人员流程管理审批", notes = "小程序--临时人员流程管理审批", httpMethod = "POST")
+    CommonResult appletUpdate(@RequestBody AppletApprovalProcessDto appletApprovalProcessDto);
+
+    @GetMapping("/appletList")
+    @ApiOperation(value = "小程序-临时人员流程管理展示", notes = "小程序-临时人员流程管理展示", httpMethod = "GET")
+    CommonResult appletList(int adminMenuId,String startTime,String endTime,String status,int page, int size);
+
+}

+ 23 - 0
src/main/java/com/template/api/CallSystemControllerAPI.java

@@ -0,0 +1,23 @@
+package com.template.api;
+
+import com.template.model.dto.CallSystemSaveOrUpdateDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/call-system")
+public interface CallSystemControllerAPI {
+
+    @GetMapping("/list")
+    @ApiOperation(value = "催缴设置查询", notes = "催缴设置查询", httpMethod = "GET")
+    CommonResult list(String permissionSettingId);
+
+    @PostMapping("/saveOrUpdate")
+    @ApiOperation(value = "催缴置修改和添加", notes = "催缴设置修改和添加", httpMethod = "POST")
+    CommonResult saveOrUpdate(@RequestBody CallSystemSaveOrUpdateDto callSystemSaveOrUpdateDto);
+
+
+}

+ 27 - 0
src/main/java/com/template/api/CheckOutSettingControllerAPI.java

@@ -0,0 +1,27 @@
+package com.template.api;
+
+import com.template.model.dto.CheckOutSettingSaveOrUpdateDto;
+import com.template.model.pojo.CheckOutSetting;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.List;
+
+@RequestMapping("/auto/check-out-setting")
+public interface CheckOutSettingControllerAPI {
+
+    @GetMapping("/list")
+    @ApiOperation(value = "退房设置查询", notes = "退房设置查询", httpMethod = "GET")
+    CommonResult list(String permissionSettingId);
+
+
+    @PostMapping("/saveOrUpdate")
+    @ApiOperation(value = "退房设置修改和添加", notes = "退房设置修改和添加", httpMethod = "POST")
+    CommonResult saveOrUpdate(@RequestBody CheckOutSettingSaveOrUpdateDto checkOutSettingSaveOrUpdateDto);
+
+
+}

+ 9 - 0
src/main/java/com/template/api/ElectricEquipmentControllerAPI.java

@@ -0,0 +1,9 @@
+package com.template.api;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/electric-equipment")
+public interface ElectricEquipmentControllerAPI {
+
+
+}

+ 38 - 0
src/main/java/com/template/api/FacilityServicesControllerAPI.java

@@ -0,0 +1,38 @@
+package com.template.api;
+
+import com.template.model.dto.FacilityServicesSaveDto;
+import com.template.model.dto.FacilityServicesUpdateDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.validation.constraints.NotNull;
+
+@RequestMapping("/auto/facility-services")
+public interface FacilityServicesControllerAPI {
+
+    @PostMapping("/save")
+    @ApiOperation(value = "添加设施服务设置", notes = "添加设施服务设置", httpMethod = "POST")
+    CommonResult save(@RequestBody FacilityServicesSaveDto facilityServicesSaveDto);
+
+    @GetMapping("/list")
+    @ApiOperation(value = "查看设施服务设置", notes = "查看设施服务设置", httpMethod = "GET")
+    CommonResult list(String permissionSettingId);
+
+    @PostMapping("/update")
+    @ApiOperation(value = "修改设施服务设置", notes = "修改设施服务设置", httpMethod = "POST")
+    CommonResult update(@RequestBody FacilityServicesUpdateDto facilityServicesUpdateDto);
+
+    @GetMapping("/delete")
+    @ApiOperation(value = "删除设施服务设置", notes = "删除设施服务设置", httpMethod = "GET")
+    CommonResult delete(String permissionSettingId,int id);
+
+
+    @GetMapping("/appletList")
+    @ApiOperation(value = "小程序——查看设施服务设置", notes = "小程序——查看设施服务设置", httpMethod = "GET")
+    CommonResult appletList();
+
+}

+ 19 - 5
src/main/java/com/template/api/HouseAPI.java

@@ -3,10 +3,7 @@ package com.template.api;
 import com.template.model.dto.HouseDto;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("/auto/house")
 public interface HouseAPI {
@@ -32,6 +29,23 @@ public interface HouseAPI {
 
     @GetMapping("/delete")
     @ApiOperation(value = "房型删除", notes = "房型删除", httpMethod = "GET")
-    CommonResult delete(String houseId,int adminId);
+    CommonResult delete(@RequestParam String houseId,@RequestParam int adminId);
+
+    /**
+     * 门锁管理的房型的接口
+     * @return
+     */
+    @GetMapping("/roomNameType")
+    @ApiOperation(value = "房型类型", notes = "房型类型", httpMethod = "GET")
+    CommonResult roomNameType();
+
+
+    @GetMapping("/appletList")
+    @ApiOperation(value = "小程序——房型管理", notes = "小程序——房型管理", httpMethod = "GET")
+    CommonResult getAppletPage(int page, int size, int type,String startTime,String endTime);
+
+    @GetMapping("/appletParticulars")
+    @ApiOperation(value = "小程序——房型详情", notes = "小程序——房型详情", httpMethod = "GET")
+    CommonResult getappletParticulars(@RequestParam Integer houseId);
 
 }

+ 44 - 0
src/main/java/com/template/api/HouseLockControllerAPI.java

@@ -0,0 +1,44 @@
+package com.template.api;
+
+import com.template.model.dto.BingingDto;
+import com.template.model.dto.KeyFingerprintDto;
+import com.template.model.dto.RemoteUnlocking;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/house-lock")
+public interface HouseLockControllerAPI {
+
+    @GetMapping("/list")
+    @ApiOperation(value = "门锁管理页面展示", notes = "门锁管理页面展示", httpMethod = "GET")
+    CommonResult list(String permissionSettingId,String roomNumber,String roomName,int page, int size);
+
+    @GetMapping("/particular")
+    @ApiOperation(value = "门锁详情展示", notes = "门锁详情展示", httpMethod = "GET")
+    CommonResult particular(String permissionSettingId,String equipmentType);
+
+    @GetMapping("/key")
+    @ApiOperation(value = "钥匙管理", notes = "钥匙管理", httpMethod = "GET")
+    CommonResult key(String permissionSettingId,String houseNumberId);
+
+
+    @PostMapping("/remoteUnlocking")
+    @ApiOperation(value = "远程开锁", notes = "远程开锁", httpMethod = "PSOT")
+    CommonResult remoteUnlocking(@RequestBody RemoteUnlocking remoteUnlockingDto);
+
+
+    @GetMapping("/unbind")
+    @ApiOperation(value = "解绑", notes = "解绑", httpMethod = "GET")
+    CommonResult unbind(String permissionSettingId,String houseNumberId,String adminId);
+
+
+    @PostMapping("/binding")
+    @ApiOperation(value = "绑定", notes = "绑定", httpMethod = "POST")
+    CommonResult binding(@RequestBody BingingDto bingingDto);
+
+
+}

+ 36 - 0
src/main/java/com/template/api/HouseNumberControllerAPI.java

@@ -0,0 +1,36 @@
+package com.template.api;
+
+import com.template.model.dto.HouseNumberBindingDto;
+import com.template.model.dto.HouseNumberDeleteBindingDto;
+import com.template.model.pojo.HouseNumber;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/house-number")
+public interface HouseNumberControllerAPI {
+
+    @GetMapping("/pullDownList")
+    @ApiOperation(value = "房间下拉展示", notes = "房间下拉展示", httpMethod = "GET")
+    CommonResult pullDownList(String permissionSettingId,int page, int size,String keyWord);
+
+    @PostMapping("/binding")
+    @ApiOperation(value = "水电表绑定", notes = "水电表绑定", httpMethod = "POST")
+    CommonResult binding(@RequestBody HouseNumberBindingDto houseNumberBindingDto);
+
+    @GetMapping("/list")
+    @ApiOperation(value = "房间页面展示", notes = "房间页面展示", httpMethod = "GET")
+    CommonResult list(String permissionSettingId,int page, int size,String keyWord,String startTime,String endTime);
+
+    @PostMapping("/update")
+    @ApiOperation(value = "水电表编辑", notes = "水电表编辑", httpMethod = "POST")
+    CommonResult update(@RequestBody HouseNumberBindingDto houseNumberBindingDto);
+
+    @PostMapping("/delete")
+    @ApiOperation(value = "水电表删除绑定", notes = "水电表删除绑定", httpMethod = "POST")
+    CommonResult delete(@RequestBody HouseNumberDeleteBindingDto houseNumberDeleteBindingDto);
+
+}

+ 46 - 6
src/main/java/com/template/api/HouseOrderAPI.java

@@ -3,11 +3,11 @@ package com.template.api;
 import com.template.model.dto.*;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 @RequestMapping("/auto/house-order")
@@ -20,13 +20,13 @@ public interface HouseOrderAPI {
 
 
     @PostMapping("/establishOrder")
-    @ApiOperation(value = "创建订单", notes = "创建订单", httpMethod = "POST")
+    @ApiOperation(value = "小程序——创建订单", notes = "小程序——创建订单", httpMethod = "POST")
     CommonResult establishOrder(@RequestBody EstablishOrderDto establishOrderDto);
 
 
     @GetMapping("/pay")
     @ApiOperation(value = "订单支付", notes = "订单支付", httpMethod = "GET")
-    CommonResult payOrder(String houseOrderId);
+    CommonResult payOrder(String houseOrderId,String openId);
 
     @GetMapping("/checkIn")
     @ApiOperation(value = "移动端入住", notes = "移动端入住", httpMethod = "GET")
@@ -64,4 +64,44 @@ public interface HouseOrderAPI {
     @ApiOperation(value = "订单管理-订单导出", notes = "订单管理-订单导出", httpMethod = "GET")
     CommonResult queryExport(HttpServletResponse response, int adminId, String keyWord, String houseType, String orderStatus, String payPriceStartTime, String payPriceEndTime, String refundStartTime, String refundEndTime, String cancelStartTime, String cancelEndTime, String liveStartTime, String liveEndTime, String leaveStartTime, String leaveEndTime);
 
+    @GetMapping("/reportStatistics")
+    @ApiOperation(value = "统计报表", notes = "统计报表", httpMethod = "GET")
+    CommonResult reportStatistics(String permissionSettingId, String state, String keyWord, String startTime, String endTime, int page, int size);
+
+    @GetMapping("/orderPage")
+    @ApiOperation(value = "小程序——订单页面展示", notes = "小程序——订单页面展示", httpMethod = "GET")
+    CommonResult orderPage(String userId, int page, int size, String status);
+
+    @GetMapping("/getHouseOrder")
+    @ApiOperation(value = "小程序——订单详情", notes = "小程序——订单详情", httpMethod = "GET")
+    CommonResult getHouseOrder(@RequestParam String houseOrderId);
+
+
+    //小程序H5支付
+    @PostMapping(value = "/pay")
+    @ApiOperation(value = "H5——微信支付", notes = "小程序——微信支付", httpMethod = "POST")
+    CommonResult pay(@Validated @RequestBody WxPayDto wpd, BindingResult bindingResult,HttpServletRequest request) throws Exception;
+
+
+    @PostMapping(value = "/returnPay")
+    @ApiOperation(value = "H5——微信支付回调", notes = "小程序——微信支付回调", httpMethod = "POST")
+    void returnPay(HttpServletRequest request, HttpServletResponse response) throws Exception;
+
+
+    //    小程序退房
+    @PostMapping("/checkOutApplet")
+    @ApiOperation(value = "小程序-退房", notes = "小程序-退房", httpMethod = "POST")
+    CommonResult checkOutApplet(@RequestBody CheckOutAppletDto checkOutAppletDto);
+
+    // 取消
+    @PostMapping("/cancelApplet")
+    @ApiOperation(value = "订单管理-订单取消", notes = "订单管理-订单取消", httpMethod = "POST")
+    CommonResult cancelApplet(@RequestBody CancelAppletDto cancelAppletDto);
+
+
+    @PostMapping(value = "/returnRefund")
+    @ApiOperation(value = "H5——微信退款回调", notes = "小程序——微信退款回调", httpMethod = "POST")
+    void returnRefund(HttpServletRequest request, HttpServletResponse response) throws Exception;
+
 }
+

+ 4 - 0
src/main/java/com/template/api/LoginControllerAPI.java

@@ -22,4 +22,8 @@ public interface LoginControllerAPI {
     @PostMapping(value = "/ChangePassword")
     @ApiOperation(value = "修改密码", notes = "修改密码", httpMethod = "POST")
     CommonResult ChangePassword(@Validated @RequestBody changePasswordRequest cpr,  BindingResult bindingResult);
+
+
+
+
 }

+ 17 - 0
src/main/java/com/template/api/OperatingRecordControllerAPI.java

@@ -0,0 +1,17 @@
+package com.template.api;
+
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/operating-record")
+public interface OperatingRecordControllerAPI {
+
+    @GetMapping("/pageList")
+    @ApiOperation(value = "操作记录表", notes = "操作记录表", httpMethod = "GET")
+    CommonResult pageList(String permissionSettingId, int page, int size, String roomNumber);
+
+
+
+}

+ 7 - 0
src/main/java/com/template/api/PayRecordControllerAPI.java

@@ -0,0 +1,7 @@
+package com.template.api;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/pay-record")
+public interface PayRecordControllerAPI {
+}

+ 2 - 0
src/main/java/com/template/api/PermissionSettingAPI.java

@@ -6,4 +6,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 public interface PermissionSettingAPI {
 
 
+
+
 }

+ 22 - 0
src/main/java/com/template/api/SubsidySetupControllerAPI.java

@@ -0,0 +1,22 @@
+package com.template.api;
+
+import com.template.model.dto.SubsidySetupSaveOrUpdateDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/subsidy-setup")
+public interface SubsidySetupControllerAPI {
+
+    @GetMapping("/list")
+    @ApiOperation(value = "补助设置查询", notes = "补助设置查询", httpMethod = "GET")
+    CommonResult list(String permissionSettingId);
+
+    @PostMapping("/saveOrUpdate")
+    @ApiOperation(value = "补助设置修改和添加", notes = "补助设置修改和添加", httpMethod = "POST")
+    CommonResult saveOrUpdate(@RequestBody SubsidySetupSaveOrUpdateDto subsidySetupSaveOrUpdateDto);
+
+}

+ 36 - 0
src/main/java/com/template/api/UnlockingAdminControllerAPI.java

@@ -0,0 +1,36 @@
+package com.template.api;
+
+import com.template.model.dto.KeyCardDto;
+import com.template.model.dto.KeyFingerprintDto;
+import com.template.model.dto.KeyPassWordDto;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/unlocking-admin")
+public interface UnlockingAdminControllerAPI {
+
+    @GetMapping("/getPassWord")
+    @ApiOperation(value = "生成随机密码", notes = "生成随机密码", httpMethod = "GET")
+    CommonResult getPassWord();
+
+    @PostMapping("/savePassWord")
+    @ApiOperation(value = "密码管理", notes = "密码管理", httpMethod = "PSOT")
+    CommonResult savePassWord(@RequestBody KeyPassWordDto keyPassWordDto);
+
+    @PostMapping("/saveCard")
+    @ApiOperation(value = "卡片管理", notes = "卡片管理", httpMethod = "PSOT")
+    CommonResult saveCard(@RequestBody KeyCardDto keyCardDto);
+
+    @PostMapping("/saveFingerprint")
+    @ApiOperation(value = "指纹管理", notes = "指纹管理", httpMethod = "PSOT")
+    CommonResult saveFingerprint(@RequestBody KeyFingerprintDto keyFingerprintDto);
+
+
+
+
+
+}

+ 10 - 0
src/main/java/com/template/api/UnlockingControllerAPI.java

@@ -0,0 +1,10 @@
+package com.template.api;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/unlocking")
+public interface UnlockingControllerAPI {
+
+
+
+}

+ 16 - 0
src/main/java/com/template/api/UnlockingRecordControllerAPI.java

@@ -0,0 +1,16 @@
+package com.template.api;
+
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/auto/unlocking-record")
+public interface UnlockingRecordControllerAPI {
+
+    @GetMapping("/pageList")
+    @ApiOperation(value = "开锁记录表", notes = "开锁记录表", httpMethod = "GET")
+    CommonResult pageList(String permissionSettingId,int page, int size,String roomNumber);
+
+
+}

+ 17 - 4
src/main/java/com/template/api/UsersAPI.java

@@ -6,10 +6,7 @@ import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("/auto/users")
 public interface UsersAPI {
@@ -32,4 +29,20 @@ public interface UsersAPI {
     @ApiOperation(value = "用户删除", notes = "用户删除", httpMethod = "GET")
     CommonResult deleteUsers(int adminMenuId,int userId);
 
+
+    @GetMapping("/departmentList")
+    @ApiOperation(value = "部门下拉列表", notes = "部门下拉列表", httpMethod = "GET")
+    CommonResult departmentList();
+
+
+    @GetMapping("/userList")
+    @ApiOperation(value = "用户下拉列表", notes = "用户下拉列表", httpMethod = "GET")
+    CommonResult userList(String userMenuId);
+
+    @GetMapping("/getUser")
+    @ApiOperation(value = "通过用户id找到对应用户", notes = "通过用户id找到对应用户", httpMethod = "GET")
+    CommonResult getUser(@RequestParam String userId);
+
+
+
 }

+ 8 - 9
src/main/java/com/template/api/UsersMenuAPI.java

@@ -1,15 +1,9 @@
 package com.template.api;
 
-import com.template.model.dto.SaveParentDto;
-import com.template.model.dto.SaveParentUserDto;
-import com.template.model.dto.SaveSecondaryDto;
-import com.template.model.dto.SaveSecondaryUserDto;
+import com.template.model.dto.*;
 import com.template.model.result.CommonResult;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("/auto/users-menu")
 public interface UsersMenuAPI {
@@ -28,7 +22,12 @@ public interface UsersMenuAPI {
 
     @GetMapping("/userListPage")
     @ApiOperation(value = "用户角色分页列表", notes = "用户角色分页列表", httpMethod = "GET")
-    CommonResult userListPage(int adminMenuId,int page,int size,String keyWord,String startTime,String endTime);
+    CommonResult userListPage(@RequestParam int adminMenuId,@RequestParam int page,@RequestParam int size,String keyWord,String startTime,String endTime);
+
+    @GetMapping(value = "/deleteUsersMenu")
+    @ApiOperation(value = "用户角色删除", notes = "用户角色删除", httpMethod = "GET")
+    CommonResult deleteUsersMenu(@RequestParam int adminMenuId,@RequestParam int userMenuId);
+
 
 
 

+ 2 - 0
src/main/java/com/template/common/utils/AesUtils.java

@@ -240,5 +240,7 @@ public class AesUtils {
         //解密
         String decryptString = AesUtils.decrypt("D7F2608679E842626C98CF8B6A9B61C5","047863CA78E0");
         System.out.println("解密后字符串:"+decryptString);
+        String decrypt = AesUtils.decrypt("111");
+        System.out.println("decrypt = " + decrypt);
     }
 }

+ 114 - 0
src/main/java/com/template/common/utils/HttpUtils.java

@@ -0,0 +1,114 @@
+package com.template.common.utils;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/8/21 星期一 14:58
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+public class HttpUtils {
+    /**
+     * 发送http post请求
+     *
+     * @param
+     *
+     * @param
+     *
+     */
+    public static String post(String url, Map<String, String> params) throws IOException {
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        String re = "";
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom()
+                    .setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            List<NameValuePair> ps = new ArrayList<NameValuePair>();
+            for (String pKey : params.keySet()) {
+                ps.add(new BasicNameValuePair(pKey, params.get(pKey)));
+            }
+            httpPost.setEntity(new UrlEncodedFormEntity(ps));
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            re = EntityUtils.toString(httpEntity, "utf-8");
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (httpPost != null) {
+                    httpPost.releaseConnection();
+                }
+                if (httpClient != null) {
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return re;
+    }
+
+    /**
+     * 发送post请求Https,参数是字符串
+     *
+     * @param
+     * @return
+     */
+    public static String post(String url, String body) throws Exception {
+        String str = "";
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom()
+                    .setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            httpPost.setEntity(new StringEntity(body, "utf-8"));
+            httpPost.setHeader("Content-Type", "application/json");
+            httpPost.setHeader("Accept", "application/json");
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            str = EntityUtils.toString(httpEntity, "utf-8");
+
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (httpPost != null) {
+                    httpPost.releaseConnection();
+                }
+                if (httpClient != null) {
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return str;
+    }
+}

+ 535 - 0
src/main/java/com/template/common/utils/HttpsClient.java

@@ -0,0 +1,535 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HttpsClient类
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class HttpsClient {
+
+    /**
+     * GET请求方式
+     */
+    public static final String METHOD_GET = "GET";
+    /**
+     * POST请求方式
+     */
+    public static final String METHOD_POST = "POST";
+    /**
+     * 连接超时时间
+     */
+    private static Integer CONNECTION_TIMEOUT = 15000;
+    /**
+     * 请求超时时间
+     */
+    private static Integer READ_TIMEOUT = 15000;
+
+    private static Logger logger = LoggerFactory.getLogger( HttpsClient.class);
+
+    /**
+     * 发起https请求
+     * @param requestUrl 请求地址
+     * @param requestMethod 请求方式(Get或者post)
+     * @param postData 提交数据
+     * @return JSONObject
+     */
+    public static JSONObject httpsRequestReturnJSONObject(String requestUrl, String requestMethod, String postData) throws Exception{
+        JSONObject  jsonObject = JSONObject.parseObject(HttpsClient.httpsRequestReturnString(requestUrl,requestMethod,postData));
+        logger.info("jsonObjectDate:  " + jsonObject);
+        return jsonObject;
+    }
+
+
+    /**
+     * 发起https请求
+     * @param requestUrl 请求地址
+     * @param requestMethod 请求方式(Get或者post)
+     * @param postData 提交数据
+     * @return String
+     */
+    public static String httpsRequestReturnString(String requestUrl, String requestMethod, String postData) throws Exception{
+        String response;
+        HttpsURLConnection httpsUrlConnection = null;
+        try{
+            //创建https请求证书
+            TrustManager[] tm={new MyX509TrustManager()};
+            //创建SSLContext管理器对像,使用我们指定的信任管理器初始化
+            SSLContext sslContext=SSLContext.getInstance("SSL","SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            SSLSocketFactory ssf=sslContext.getSocketFactory();
+
+            // 创建URL对象
+            URL url= new URL(requestUrl);
+            // 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象
+            httpsUrlConnection=(HttpsURLConnection)url.openConnection();
+            //设置ssl证书
+            httpsUrlConnection.setSSLSocketFactory(ssf);
+
+            //设置header信息
+            httpsUrlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            //设置User-Agent信息
+            httpsUrlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36");
+            //设置可接受信息
+            httpsUrlConnection.setDoOutput(true);
+            //设置可输入信息
+            httpsUrlConnection.setDoInput(true);
+            //不使用缓存
+            httpsUrlConnection.setUseCaches(false);
+            //设置请求方式(GET/POST)
+            httpsUrlConnection.setRequestMethod(requestMethod);
+            //设置连接超时时间
+            if (CONNECTION_TIMEOUT > 0) {
+                httpsUrlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
+            } else {
+                //默认10秒超时
+                httpsUrlConnection.setConnectTimeout(10000);
+            }
+            //设置请求超时
+            if (READ_TIMEOUT > 0) {
+                httpsUrlConnection.setReadTimeout(READ_TIMEOUT);
+            } else {
+                //默认10秒超时
+                httpsUrlConnection.setReadTimeout(10000);
+            }
+            //设置编码
+            httpsUrlConnection.setRequestProperty("Charsert", WxConstants.DEFAULT_CHARSET);
+
+            //判断是否需要提交数据
+            if(StringUtils.equals(requestMethod,HttpsClient.METHOD_POST) && StringUtils.isNotBlank(postData)){
+                //讲参数转换为字节提交
+                byte[] bytes = postData.getBytes(WxConstants.DEFAULT_CHARSET);
+                //设置头信息
+                httpsUrlConnection.setRequestProperty("Content-Length", Integer.toString(bytes.length));
+                //开始连接
+                httpsUrlConnection.connect();
+                //防止中文乱码
+                OutputStream outputStream=httpsUrlConnection.getOutputStream();
+                outputStream.write(postData.getBytes(WxConstants.DEFAULT_CHARSET));
+                outputStream.flush();
+                outputStream.close();
+            }else{
+                //开始连接
+                httpsUrlConnection.connect();
+            }
+            response = WxUtil.getStreamString(httpsUrlConnection.getInputStream());
+        }catch (Exception e){
+            throw new Exception();
+        }finally {
+            if (httpsUrlConnection != null) {
+                // 关闭连接
+                httpsUrlConnection.disconnect();
+            }
+        }
+        return response;
+    }
+
+
+    public static String get(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpGet httpGet = null;
+        StringBuffer str = new StringBuffer("");
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            String ps = "";
+            for (String pKey : params.keySet()) {
+                if(!"".equals(ps)){
+                    ps = ps + "&";
+                }
+                ps = pKey+"="+params.get(pKey);
+            }
+            if(!"".equals(ps)){
+                url = url + "?" + ps;
+            }
+            httpGet = new HttpGet(url);
+            httpGet.setConfig(requestConfig);
+            CloseableHttpResponse response = httpClient.execute(httpGet);
+            HttpEntity httpEntity = response.getEntity();
+            str.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpGet!=null){
+                    httpGet.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return str.toString();
+    }
+
+    public static String get(String strURL) throws Exception{
+
+        URL url = new URL(strURL);
+        HttpURLConnection httpConn = (HttpURLConnection)
+                url.openConnection();
+        httpConn.setRequestMethod("GET");
+        httpConn.connect();
+        logger.info("bbb: "+httpConn.getResponseCode());
+        BufferedReader reader = new BufferedReader(new InputStreamReader(
+                httpConn.getInputStream(),"utf-8"));
+        String line;
+        StringBuffer buffer = new StringBuffer();
+        while ((line = reader.readLine()) != null) {
+            buffer.append(line);
+        }
+        reader.close();
+        httpConn.disconnect();
+
+        return buffer.toString();
+    }
+
+    /**
+     * 发送 post请求
+     * @param
+     * @param
+     */
+    public static String post(String url, Map<String, String> params){
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        StringBuilder sb = new StringBuilder("");
+        try {
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            List<NameValuePair> ps = new ArrayList<NameValuePair>();
+            for (String pKey : params.keySet()) {
+                ps.add(new BasicNameValuePair(pKey, params.get(pKey)));
+            }
+            httpPost.setEntity(new UrlEncodedFormEntity(ps));
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            sb.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpPost!=null){
+                    httpPost.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return sb.toString();
+    }
+
+    public static String postFile(String url, File file){
+
+        CloseableHttpClient httpClient = null;
+        HttpPost httpPost = null;
+        StringBuilder sb = new StringBuilder("");
+        try {
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+            builder.addBinaryBody("files", file, ContentType.DEFAULT_BINARY, file.getName());
+            httpClient = HttpClients.createDefault();
+            RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(20000).setConnectTimeout(20000).build();
+            httpPost = new HttpPost(url);
+            httpPost.setConfig(requestConfig);
+            httpPost.setEntity(builder.build());
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            HttpEntity httpEntity = response.getEntity();
+            sb.append(EntityUtils.toString(httpEntity,"utf-8"));
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally{
+            try {
+                if(httpPost!=null){
+                    httpPost.releaseConnection();
+                }
+                if(httpClient!=null){
+                    httpClient.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        JSONObject  jsonObject = JSONObject.parseObject(sb.toString());
+        return jsonObject.get("data").toString();
+    }
+
+    //url表示请求链接,param表示json格式的请求参数		//自定义菜单创建访问方式
+    public static String sendPost(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性 注意Authorization生成
+            // conn.setRequestProperty("Content-Type",
+            // "application/x-www-form-urlencoded");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(),"utf-8"));
+            // 发送请求参数
+            out.print("&"+param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(
+                    new InputStreamReader(conn.getInputStream(),"utf-8"));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            logger.info("发送 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+
+    //url表示请求链接,param表示json格式的请求参数		//自定义菜单创建访问方式
+    public static String sendPost2(String url, String param) {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        String result = "";
+        try {
+            HttpsURLConnection httpsUrlConnection = null;
+            //创建https请求证书
+            TrustManager[] tm={new MyX509TrustManager()};
+            //创建SSLContext管理器对像,使用我们指定的信任管理器初始化
+            SSLContext sslContext=SSLContext.getInstance("SSL","SunJSSE");
+            sslContext.init(null, tm, new java.security.SecureRandom());
+            SSLSocketFactory ssf=sslContext.getSocketFactory();
+            // 创建URL对象
+            URL realUrl= new URL(url);
+            // 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象,
+            // 打开和URL之间的连接
+            httpsUrlConnection=(HttpsURLConnection)realUrl.openConnection();
+            //设置ssl证书
+            httpsUrlConnection.setSSLSocketFactory(ssf);
+            // 设置通用的请求属性 注意Authorization生成
+            // conn.setRequestProperty("Content-Type",
+            // "application/x-www-form-urlencoded");
+            // 发送POST请求必须设置如下两行
+            httpsUrlConnection.setRequestMethod("POST");
+            httpsUrlConnection.setDoOutput(true);
+            httpsUrlConnection.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(new OutputStreamWriter(httpsUrlConnection.getOutputStream(),"utf-8"));
+            // 发送请求参数
+            out.print("&"+param);
+            // flush输出流的缓冲
+            out.flush();
+            if (httpsUrlConnection.getResponseCode()==200) {
+                // 定义BufferedReader输入流来读取URL的响应
+                in = new BufferedReader(
+                        new InputStreamReader(httpsUrlConnection.getInputStream(), "utf-8"));
+                String line;
+                while ((line = in.readLine()) != null) {
+                    result += line;
+                }
+            }else {
+                result = "获取输入流异常!";
+            }
+        } catch (Exception e) {
+            logger.info("发送 请求出现异常!" + e);
+            e.printStackTrace();
+        }
+        // 使用finally块来关闭输出流、输入流
+        finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (in != null) {
+                    in.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static String dateToStamp(String s) throws Exception {
+        String res = "";
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = simpleDateFormat.parse(s);
+        long time = date.getTime();
+        res = String.valueOf(time);
+        return res;
+    }
+
+    /*
+     * 将时间戳转换为时间
+     */
+    public static String stampToDate(String s){
+        String res;
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long lt = new Long(s);
+        Date date = new Date(lt);
+        res = simpleDateFormat.format(date);
+        return res;
+    }
+
+    public static String sendJson(String request_url, JSONObject json) {
+        OutputStreamWriter out = null;
+        InputStream is = null;
+        String result = "";
+        try {
+            URL url = new URL(request_url);// 创建连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setUseCaches(false);
+            connection.setInstanceFollowRedirects(true);
+            connection.setRequestMethod("POST"); // 设置请求方式
+            // 设置接收数据的格式
+            connection.setRequestProperty("Accept", "application/json");
+            // 设置发送数据的格式
+            connection.setRequestProperty("Content-Type", "application/json");
+            connection.connect();
+            out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+            out.append(json.toString());
+            out.flush();
+            out.close();
+            // 读取响应
+            is = connection.getInputStream();
+            int length = (int) connection.getContentLength();// 获取字节长度
+//            logger.info(length);
+            if (length != -1) {
+                byte[] data = new byte[length];
+                byte[] temp = new byte[512];
+                int readLen = 0;
+                int destPos = 0;
+                while ((readLen = is.read(temp)) > 0) {
+                    System.arraycopy(temp, 0, data, destPos, readLen);
+                    destPos += readLen;
+                }
+                result = new String(data, "UTF-8"); // utf-8编码
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                is.close();
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * post请求
+     * @param request_url
+     * @param json
+     * @return
+     */
+    public static String sendJson2(String request_url, JSONObject json) {
+        OutputStreamWriter out = null;
+        InputStream is = null;
+        String result = "";
+        try {
+            URL url = new URL(request_url);// 创建连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setUseCaches(false);
+            connection.setInstanceFollowRedirects(true);
+            connection.setRequestMethod("POST"); // 设置请求方式
+            // 设置接收数据的格式
+            connection.setRequestProperty("Accept", "application/json");
+            // 设置发送数据的格式
+            connection.setRequestProperty("Content-Type", "application/json");
+            connection.connect();
+            out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8");
+            out.append(json.toString());
+            out.flush();
+            out.close();
+            // 读取响应
+            is = connection.getInputStream();
+            BufferedReader in = new BufferedReader(new InputStreamReader(is));
+            result = in.readLine();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                is.close();
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    public static void main(String[] args) throws Exception {
+        JSONObject json = new JSONObject();
+        json.put("buildCode", "5栋");
+        json.put("currentAggr", "20");
+        json.put("energyType", "2");
+        json.put("updateTime", "2021-09-09 10:15:33");
+        String msg = sendJson2("https://chtech.ncjti.edu.cn/bigdata-api/api/energy/energyDataUpload", json);
+        logger.info(msg);
+    }
+}

+ 23 - 0
src/main/java/com/template/common/utils/JWTUtil.java

@@ -101,6 +101,29 @@ public class JWTUtil {
 //        return builder.sign(Algorithm.HMAC256(SIGNATURE)).toString();
     }
 
+    public static String getUsersToken(String cardNumber){
+
+        // 签发时间
+        Date iatDate = new Date();
+
+//        // 过期时间
+//        Calendar nowTime = Calendar.getInstance();
+//        nowTime.add(Calendar.DAY_OF_WEEK, 3);
+//        Date expiresDate = nowTime.getTime();
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("alg", "HMAC256");
+        map.put("typ", "JWT");
+        String token = JWT.create()
+                .withHeader(map) // header
+                .withClaim("cardNumber", cardNumber) // 卡号
+                .withExpiresAt(new Date(CommonUtil.getCurrentTimestamp() + EXPIRED)) // 设置过期时间。过期时间要大于签发时间
+                .withIssuedAt(iatDate) // 设置签发时间
+                .sign(Algorithm.HMAC256(SIGNATURE)); // 加密
+        return token;
+
+    }
+
 
     public static long getExpired() {
         return EXPIRED;

+ 85 - 0
src/main/java/com/template/common/utils/MessageDecryptUtil.java

@@ -0,0 +1,85 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Maps;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class MessageDecryptUtil {
+
+    public static JSONObject decryptMessage(String message, String secret, String appId){
+        PushMessage pushMessage = JSONObject.parseObject(message, PushMessage.class);
+        log.info("接收消息内容 : {}",JSONObject.toJSONString(pushMessage));
+
+        Map<String, Object> messageMap = new HashMap<>();
+        messageMap.put("protocol",pushMessage.getProtocol());
+        messageMap.put("pv",pushMessage.getPv());
+        messageMap.put("t",pushMessage.getT());
+        messageMap.put("data",pushMessage.getData());
+
+        Map<String, Object> messageMapSort = sortByKey(messageMap, false);
+
+        StringBuffer message_buffer = new StringBuffer();
+        messageMapSort.forEach((key, value) -> {
+            if(!"sign".equals(key) || !"".equals(key)){
+                message_buffer.append(key).append("=").append(value).append("||");
+            }
+        });
+        message_buffer.append(secret);
+        String sign = MD5.getMD5(message_buffer.toString());
+
+        if(sign.equals(pushMessage.getSign())){
+            log.info("校验签名成功");
+
+            String messageDate_str = AesUtils.decrypt(pushMessage.getData(),appId);
+            log.info("messageDate_str : {}" , messageDate_str);
+
+
+//            去掉头和尾的"和所有的\\和单个{多余的"和}多余的"
+            messageDate_str = messageDate_str.replaceAll("\t","").substring(1, messageDate_str.length() - 1).replaceAll("\\\\","").replace("\"{","{").replace("}\"","}");
+            System.out.println("messageDate_str = " + messageDate_str);
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("protocol",pushMessage.getProtocol());
+            jsonObject.put("pv",pushMessage.getPv());
+            jsonObject.put("t",pushMessage.getT());
+            jsonObject.put("data",messageDate_str);
+
+            return jsonObject;
+        }
+
+        return null;
+    }
+
+    /**
+     * 根据map的key排序
+     *
+     * @param map 待排序的map
+     * @param isDesc 是否降序,true:降序,false:升序
+     * @return 排序好的map
+     * @author zero 2019/04/08
+     */
+    public static <K extends Comparable<? super K>, V> Map<K, V> sortByKey(Map<K, V> map, boolean isDesc) {
+        Map<K, V> result = Maps.newLinkedHashMap();
+        if (isDesc) {
+            map.entrySet().stream().sorted(Map.Entry.<K, V>comparingByKey().reversed())
+                    .forEachOrdered(e -> result.put(e.getKey(), e.getValue()));
+        } else {
+            map.entrySet().stream().sorted(Map.Entry.<K, V>comparingByKey())
+                    .forEachOrdered(e -> result.put(e.getKey(), e.getValue()));
+        }
+        return result;
+    }
+
+
+    public static void main(String[] args) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String format = sdf.format(1710899067873L);
+        System.out.println("format = " + format);
+    }
+}

+ 23 - 0
src/main/java/com/template/common/utils/MyX509TrustManager.java

@@ -0,0 +1,23 @@
+package com.template.common.utils;
+
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * X509TrustManager用于实现SSL证书的安全校验
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class MyX509TrustManager implements X509TrustManager {
+    @Override
+    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
+
+    @Override
+    public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
+
+    @Override
+    public X509Certificate[] getAcceptedIssuers() {
+        return null;
+    }
+}

+ 111 - 0
src/main/java/com/template/common/utils/PasswordChecker.java

@@ -0,0 +1,111 @@
+package com.template.common.utils;
+
+import java.util.Random;
+import java.util.regex.Pattern;
+
+/**
+ * 判断密码是否能符合要求
+ */
+public class PasswordChecker {
+    public static boolean isValidPassword(String password) {
+        if (password == null || password.length() != 6 ) {
+            return false;
+        }
+
+        // 正向和反向连续数字的正则表达式
+//       String consecutiveNumbersPattern = "(\\d)\\1+";
+//        String consecutiveNumbersPattern = "(0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){2}\\d\n" +
+//                "\n" +
+//                "\\d((?<=0)1|(?<=1)2|(?<=2)3|(?<=3)4|(?<=4)5|(?<=5)6|(?<=6)7|(?<=7)8|(?<=8)9){2}";
+//        String consecutiveNumbersPattern ="\\b(\\d)\\1+\\b";
+
+        // 对密码的一半长度进行检查
+        int halfLength = password.length() / 2;
+        String firstHalf = password.substring(0, halfLength);
+        String firstHalf2 = password.substring(1, halfLength+1);
+        String firstHalf3 = password.substring(2, halfLength+2);
+        String secondHalf = password.substring(halfLength);
+
+        // 检查第一个部分是否有连续的升序或相同数字
+        if (sequence(firstHalf) || isAllSameChars(firstHalf)) {
+            return false;
+        }
+
+        // 检查第一个部分是否有连续的升序或相同数字
+        if (sequence(firstHalf2) || isAllSameChars(firstHalf2)) {
+            return false;
+        }
+
+        // 检查第一个部分是否有连续的升序或相同数字
+        if (sequence(firstHalf3) || isAllSameChars(firstHalf3)) {
+            return false;
+        }
+
+
+        // 检查第二个部分是否有连续的降序或相同数字
+        if (/*sequence(secondHalf)||*/ isAllSameChars(secondHalf)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    // 检查字符串是否全部由相同的字符组成
+    private static boolean isAllSameChars(String str) {
+        char[] chars = str.toCharArray();
+        int n1 = chars[0];
+        int n2 = chars[1];
+        int n3 = chars[2];
+        // 判断重复字符
+        if (n1 == n2 && n1 == n3) {
+            return true;
+        }
+        return false;
+    }
+
+    //检查字符串是否是升序或者降序
+    private static boolean sequence(String str){
+        char[] chars = str.toCharArray();
+        int n1 = chars[0];
+        int n2 = chars[1];
+        int n3 = chars[2];
+        // 判断连续字符: 正序 + 倒序
+        if ((n1 + 1 == n2 && n1 + 2 == n3) || (n1 - 1 == n2 && n1 - 2 == n3)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 生成一个符合要求的6位数密码
+     * @return
+     */
+    public static String getPassWord(){
+        while (true){
+            Random random = new Random();
+            String result="";
+            for (int i=0;i<6;i++)
+            {
+                result+=random.nextInt(10);
+            }
+            System.out.println("result = " + result);
+            if (isValidPassword(result)) {
+                return result;
+            }
+
+        }
+
+    }
+
+
+    public static void main(String[] args) {
+//        String[] passwords = {"111111", "122244", "123456", "654321", "135792"};
+//        for (String password : passwords) {
+//            System.out.println(password + ": " + isValidPassword(password));
+//        }
+//        String passWord = getPassWord();
+        String passWord="320323";
+        System.out.println(passWord + ": " +  isValidPassword(passWord));
+
+    }
+}

+ 49 - 0
src/main/java/com/template/common/utils/PushMessage.java

@@ -0,0 +1,49 @@
+package com.template.common.utils;
+
+public class PushMessage {
+    private int protocol;//业务协议号
+    private String pv; //通讯协议版本号
+    private long t;
+    private String data;
+    private String sign;
+
+    public int getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(int protocol) {
+        this.protocol = protocol;
+    }
+
+    public String getPv() {
+        return pv;
+    }
+
+    public void setPv(String pv) {
+        this.pv = pv;
+    }
+
+    public long getT() {
+        return t;
+    }
+
+    public void setT(long t) {
+        this.t = t;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+}

+ 165 - 0
src/main/java/com/template/common/utils/RSATest.java

@@ -0,0 +1,165 @@
+package com.template.common.utils;
+
+import java.security.KeyFactory;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.SecureRandom;
+import java.security.Signature;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 
+ * @author alphaDo
+ *
+ */
+public class RSATest {
+
+	private static final String KEY_ALGORITHM = "RSA";
+	private static final int KEY_SIZE = 2048;//设置长度
+	private static final String PUBLIC_KEY = "publicKey";
+	private static final String PRIVATE_KEY = "privateKey";
+	public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
+	public static final String ENCODE_ALGORITHM = "SHA-256";
+	
+	/**
+	 * 生成公、私钥
+	 * 根据需要返回String或byte[]类型
+	 * @return
+	 */
+	private static Map<String, String> createRSAKeys(){
+		Map<String, String> keyPairMap = new HashMap<String, String>();
+		try {
+			KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM);
+			keyPairGenerator.initialize(KEY_SIZE, new SecureRandom());
+			KeyPair keyPair = keyPairGenerator.generateKeyPair();
+			
+			PublicKey publicKey = keyPair.getPublic();
+            PrivateKey privateKey = keyPair.getPrivate();
+            /*Map<String, byte[]> byteMap = new HashMap<String, byte[]>();
+            byteMap.put(PUBLIC_KEY_NAME, publicKey.getEncoded());
+            byteMap.put(PRIVATE_KEY_NAME, privateKey.getEncoded());*/
+			
+			//获取公、私钥值
+			String publicKeyValue = Base64.getEncoder().encodeToString(publicKey.getEncoded());
+			String privateKeyValue = Base64.getEncoder().encodeToString(privateKey.getEncoded());
+			
+			//存入
+			keyPairMap.put(PUBLIC_KEY, publicKeyValue);
+			keyPairMap.put(PRIVATE_KEY, privateKeyValue);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return keyPairMap;
+	}
+	
+	/**
+	 * 解码PublicKey
+	 * @param key
+	 * @return
+	 */
+	public static PublicKey getPublicKey(String key) {
+	    try {
+	        byte[] byteKey = Base64.getDecoder().decode(key);
+	        X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(byteKey);
+	        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+	        return keyFactory.generatePublic(x509EncodedKeySpec);
+	    } catch (Exception e) {
+	        e.printStackTrace();
+	    }
+	    
+	    return null;
+	}
+	
+	/**
+	 * 解码PrivateKey
+	 * @param key
+	 * @return
+	 */
+	public static PrivateKey getPrivateKey(String key) {
+	    try {
+	        byte[] byteKey = Base64.getDecoder().decode(key);
+	        PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(byteKey);
+	        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+	        
+	        return keyFactory.generatePrivate(pkcs8EncodedKeySpec);
+	    } catch (Exception e) {
+	        e.printStackTrace();
+	    }
+	    
+	    return null;
+	}
+	
+	/**
+	 * 签名
+	 * @param key	私钥
+	 * @param requestData	请求参数
+	 * @return
+	 */
+	public static String sign(String key, String requestData){
+		String signature = null;
+		byte[] signed = null;
+		try {
+			PrivateKey privateKey = getPrivateKey(key);
+	        
+			Signature Sign = Signature.getInstance(SIGNATURE_ALGORITHM);
+			Sign.initSign(privateKey);
+			Sign.update(requestData.getBytes());
+			signed = Sign.sign();
+	        
+			signature = Base64.getEncoder().encodeToString(signed);
+			System.out.println("===签名结果:"+signature);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return signature;
+	}
+	
+	/**
+	 * 验签
+	 * @param key	公钥
+	 * @param requestData	请求参数
+	 * @param signature	签名
+	 * @return
+	 */
+	public static boolean verifySign(String key, String requestData, String signature){
+		boolean verifySignSuccess = false;
+		try {
+			PublicKey publicKey = getPublicKey(key);
+			
+			Signature verifySign = Signature.getInstance(SIGNATURE_ALGORITHM);
+			verifySign.initVerify(publicKey);
+			verifySign.update(requestData.getBytes());
+			
+			verifySignSuccess = verifySign.verify(Base64.getDecoder().decode(signature));
+			System.out.println("===验签结果:"+verifySignSuccess);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return verifySignSuccess;
+	}
+	
+	public static void main(String[] args) {
+		Map<String, String> keyPairMap = createRSAKeys();
+		System.out.println("生成公、私钥测试:"+keyPairMap);
+		
+		String publicKey = keyPairMap.get(PUBLIC_KEY);
+		String privateKey = keyPairMap.get(PRIVATE_KEY);
+		
+		System.out.println("===开始RSA公、私钥测试===");
+		String str = "alpha=001&beta=002&gamma=003";
+		String sign = sign(privateKey, str);
+		
+		verifySign(publicKey, str, sign);
+	}
+
+}
+

Разница между файлами не показана из-за своего большого размера
+ 14 - 3
src/main/java/com/template/common/utils/RSAUtils.java


+ 42 - 0
src/main/java/com/template/common/utils/SHA1.java

@@ -0,0 +1,42 @@
+package com.template.common.utils;
+import java.security.MessageDigest;
+
+/**
+ * 微信SHA1算法
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public final class SHA1 {
+
+    private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+    /**
+     *  将字节并格式化
+     * @param bytes 原始字节
+     * @return 格式化字节
+     */
+    private static String getFormattedText(byte[] bytes) {
+        int len = bytes.length;
+        StringBuilder buf = new StringBuilder(len * 2);
+        // 把密文转换成十六进制的字符串形式
+        for (int j = 0; j < len; j++) {
+            buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
+            buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
+        }
+        return buf.toString();
+    }
+
+    public static String encode(String str) {
+        if (str == null) {
+            return null;
+        }
+        try {
+            MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
+            messageDigest.update(str.getBytes());
+            return getFormattedText(messageDigest.digest());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

+ 105 - 0
src/main/java/com/template/common/utils/StrUtils.java

@@ -0,0 +1,105 @@
+package com.template.common.utils;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/25 星期二 14:20
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+public class StrUtils {
+
+    public static String getRandomName(String fileName){
+        int index=fileName.lastIndexOf(".");
+        String houzhui=fileName.substring(index);//获取后缀名
+        String uuidFileName=UUID.randomUUID().toString().replace("-","")+houzhui;
+        return uuidFileName;
+    }
+
+    /**
+     * 采用URL Base64字符,即把“+/”换成“-_”
+     */
+    static private char[] alphabet = "01234567899876543210012345678998765432100123456789987654321001234".toCharArray();//"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789xyz".toCharArray();
+    /**
+     * 获取指定位数的UUID
+     * @param bits 指定位数
+     * @return
+     */
+
+    public static String getUUIDBits(int bits) {
+        UUID uuid = UUID.randomUUID();
+        long msb = uuid.getMostSignificantBits();
+        long lsb = uuid.getLeastSignificantBits();
+        char[] out = new char[24];
+        int tmp = 0, idx = 0;
+
+        // 循环写法
+        int bit = 0, bt1 = 8, bt2 = 8;
+        int mask = 0x00, offsetm = 0, offsetl = 0;
+
+        for(; bit < 16; bit += 3, idx += 4) {
+            offsetm = 64 - (bit + 3) * 8;
+            offsetl = 0;
+            tmp = 0;
+
+            if(bt1 > 3) {
+                mask = (1 << 8 * 3) - 1;
+            } else if(bt1 >= 0) {
+                mask = (1 << 8 * bt1) - 1;
+                bt2 -= 3 - bt1;
+            } else {
+                mask = (1 << 8 * ((bt2 > 3) ? 3 : bt2)) - 1;
+                bt2 -= 3;
+            }
+            if(bt1 > 0) {
+                bt1 -= 3;
+                tmp = (int) ((offsetm < 0) ? msb : (msb >>> offsetm) & mask);
+                if(bt1 < 0) {
+                    tmp <<= Math.abs(offsetm);
+                    mask = (1 << 8 * Math.abs(bt1)) - 1;
+                }
+            }
+            if(offsetm < 0) {
+                offsetl = 64 + offsetm;
+                tmp |= ((offsetl < 0) ? lsb : (lsb >>> offsetl)) & mask;
+            }
+
+            if(bit == 15) {
+                out[idx + 3] = alphabet[64];
+                out[idx + 2] = alphabet[64];
+                tmp <<= 4;
+            } else {
+                out[idx + 3] = alphabet[tmp & 0x3f];
+                tmp >>= 6;
+                out[idx + 2] = alphabet[tmp & 0x3f];
+                tmp >>= 6;
+            }
+            out[idx + 1] = alphabet[tmp & 0x3f];
+            tmp >>= 6;
+            out[idx] = alphabet[tmp & 0x3f];
+        }
+
+        return new String(out, 0, bits);
+    }
+
+    public static void main(String[] args) throws ParseException
+    {
+        List<String> data = new ArrayList<>();
+        for (int i = 0;i<10000000;i++){
+            String sss = getUUIDBits(15);
+            data.add(sss);
+        }
+
+        long allCount = data.size();
+        long disCount = data.stream().distinct().count();
+
+        Collections.sort(data);
+        String sss ="";
+
+    }
+}

+ 261 - 0
src/main/java/com/template/common/utils/SubscribeSample.java

@@ -0,0 +1,261 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.model.mqtt.MqttConfiguration;
+import com.template.model.mqtt.MqttPushClient;
+import com.template.model.mqtt.SpringUtil;
+import com.template.model.pojo.*;
+import com.template.services.impl.AlarmMessageServiceImpl;
+import com.template.services.impl.HouseLockServiceImpl;
+import com.template.services.impl.HouseNumberServiceImpl;
+import com.template.services.impl.UnlockingRecordServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.eclipse.paho.client.mqttv3.*;
+import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+/**
+ * 订阅
+ *
+ * @author issuser
+ */
+
+@Component
+@Slf4j
+public class SubscribeSample{
+
+    private MqttPushClient client;
+    private MqttConfiguration mqttConfiguration;
+
+
+    public SubscribeSample(MqttPushClient client ,MqttConfiguration mqttConfiguration) {
+        this.client = client;
+        this.mqttConfiguration = mqttConfiguration;
+    }
+
+//    @Scheduled(cron = "0 10 * * * ? ")
+    public void mqtt() {
+        String HOST = "tcp://www.qspms.cn:1883";
+        String TOPIC = "smartLock/open/device/2d00b258183146c0a2b19f55250c4596";
+        int qos = 1;
+        String clientid = "open_cloud_smartLock_2d00b258183146c0a2b19f55250c4596";
+        String userName = "2d00b258183146c0a2b19f55250c4596";
+        String passWord = "9ac03de350720057";
+        try {
+            // host为主机名,test为clientid即连接MQTT的客户端ID,一般以客户端唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存
+            MqttClient client = new MqttClient(HOST, clientid, new MemoryPersistence());
+            // MQTT的连接设置
+            MqttConnectOptions options = new MqttConnectOptions();
+            // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接
+            options.setCleanSession(true);
+            // 设置连接的用户名
+            options.setUserName(userName);
+            // 设置连接的密码
+            options.setPassword(passWord.toCharArray());
+            // 设置超时时间 单位为秒
+            options.setConnectionTimeout(10);
+            // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制
+            options.setKeepAliveInterval(20);
+            // 设置回调函数
+            client.setCallback(new MqttCallback() {
+
+                @Override
+                public void connectionLost(Throwable cause) {
+                    log.info(cause.getMessage());
+                    try {
+                        log.info("==============》》》[MQTT] 连接断开,5S之后尝试重连...");
+                        Thread.sleep(5000);
+                        MqttPushClient mqttPushClient = new MqttPushClient();
+                        mqttPushClient.connect(mqttConfiguration);
+                        if(MqttPushClient.getClient().isConnected()){
+                            log.info("=============>>重连成功");
+                        }
+                    } catch (Exception e) {
+                        log.error("=============>>>[MQTT] 连接断开,重连失败!<<=============");
+                    }
+
+                }
+
+                @Override
+                public void messageArrived(String topic, MqttMessage message) {
+                    //实例化入库方法 这里就用到SpringUtil类 来手动的注入
+                    HouseLockServiceImpl houseLockService = SpringUtil.getBean(HouseLockServiceImpl.class);
+                    HouseNumberServiceImpl houseNumberService = SpringUtil.getBean(HouseNumberServiceImpl.class);
+                    UnlockingRecordServiceImpl unlockingRecordService = SpringUtil.getBean(UnlockingRecordServiceImpl.class);
+                    AlarmMessageServiceImpl alarmMessageService = SpringUtil.getBean(AlarmMessageServiceImpl.class);
+
+                    System.out.println("topic:" + topic);
+                    System.out.println("Qos:" + message.getQos());
+                    System.out.println("message content:" + new String(message.getPayload()));
+                    JSONObject s = MessageDecryptUtil.decryptMessage(message.toString(), "6edfcc178c0f415d8e6628238761976f", "2d00b258183146c0a2b19f55250c4596");
+                    String protocol = s.getString("protocol");
+
+//					设备消息上报
+                    if ("2".equals(protocol)) {
+                        UnlockingRecord unlockingRecord = new UnlockingRecord();
+                        String data = s.getString("data");
+                        System.out.println("data = " + data);
+                        JSONObject jsonObject = JSONObject.parseObject(data);
+                        System.out.println("jsonObject = " + jsonObject);
+//						结果
+                        String result = jsonObject.getString("result");
+//						时间
+                        String messageTime = jsonObject.getString("messageTime");
+//						房间luid
+                        String luid = jsonObject.getString("luid");
+//						找到房间号
+                        LambdaQueryWrapper<HouseLock> WrapperHL = new LambdaQueryWrapper<>();
+                        WrapperHL.eq(HouseLock::getEquipmentType, luid);
+                        List<HouseLock> list = houseLockService.list(WrapperHL);
+                        if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
+                            HouseLock houseLock = list.get(0);
+                            Integer houseNumberId = houseLock.getHouseNumberId();
+                            HouseNumber byId = houseNumberService.getById(houseNumberId);
+                            if (ObjectUtils.isNotEmpty(byId)) {
+                                String roomNumber = byId.getRoomNumber();
+                                unlockingRecord.setRoomNumber(roomNumber);
+                            }
+                        }
+
+//						消息类型
+                        String messageType = jsonObject.getString("messageType");
+
+                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        String format = sdf.format(Long.valueOf(messageTime));
+                        unlockingRecord.setDateTime(format);
+
+
+                        if ("1".equals(messageType)) {
+//密码开锁
+                            unlockingRecord.setUnlockType("密码开锁");
+
+                        } else if ("2".equals(messageType)) {
+//							远程开锁
+
+                            unlockingRecord.setUnlockType("远程开锁");
+
+                        } else if ("3".equals(messageType)) {
+//无网络密码开锁
+                            unlockingRecord.setUnlockType("无网络密码开锁");
+                        } else if ("5".equals(messageType)) {
+//人脸开锁
+                            unlockingRecord.setUnlockType("人脸开锁");
+                        } else if ("10".equals(messageType)) {
+//							电池电量更新
+                            unlockingRecord.setUnlockType("电池电量更新");
+                        }
+                        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        unlockingRecord.setCreateTime(LocalDateTime.now().format(dateTimeFormatter1));
+                        unlockingRecord.setUpdateTime(LocalDateTime.now().format(dateTimeFormatter1));
+                        unlockingRecord.setCreateUser("1");
+                        unlockingRecord.setUpdateUser("1");
+
+                        unlockingRecordService.getSave(unlockingRecord);
+
+                    } else if ("3".equals(protocol)) {
+                        AlarmMessage alarmMessage = new AlarmMessage();
+                        String data = s.getString("data");
+                        JSONObject jsonObject = JSONObject.parseObject(data);
+
+                        //						消息类型
+                        String messageType = jsonObject.getString("messageType");
+
+                        //						时间
+                        String messageTime = jsonObject.getString("messageTime");
+                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        String format = sdf.format(Long.valueOf(messageTime));
+                        alarmMessage.setMessageTime(format);
+
+//						房间luid
+                        String luid = jsonObject.getString("luid");
+//						找到房间号
+                        LambdaQueryWrapper<HouseLock> WrapperHL = new LambdaQueryWrapper<>();
+                        WrapperHL.eq(HouseLock::getEquipmentType, luid);
+                        List<HouseLock> list = houseLockService.list(WrapperHL);
+                        if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
+                            HouseLock houseLock = list.get(0);
+                            Integer houseNumberId = houseLock.getHouseNumberId();
+                            HouseNumber byId = houseNumberService.getById(houseNumberId);
+                            if (ObjectUtils.isNotEmpty(byId)) {
+                                String roomNumber = byId.getRoomNumber();
+                                alarmMessage.setRoomNumber(roomNumber);
+                            }
+                        }
+
+
+                        if ("5".equals(messageType)) {
+//							低电量
+                            alarmMessage.setMessageType("低电量");
+
+                        } else if ("1".equals(messageType)) {
+                            alarmMessage.setMessageType("密码错误(连续失败五次)");
+                        } else if ("4".equals(messageType)) {
+                            alarmMessage.setMessageType("防拆告警");
+                        }
+
+                        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                        alarmMessage.setCreateTime(LocalDateTime.now().format(dateTimeFormatter1));
+                        alarmMessage.setUpdateTime(LocalDateTime.now().format(dateTimeFormatter1));
+                        alarmMessage.setCreateUser("1");
+                        alarmMessage.setUpdateUser("1");
+
+                        alarmMessageService.getSave(alarmMessage);
+
+                    }
+
+
+                }
+
+                @Override
+                public void deliveryComplete(IMqttDeliveryToken token) {
+                    System.out.println("deliveryComplete---------" + token.isComplete());
+                }
+
+            });
+            client.connect(options);
+            // 订阅消息
+            client.subscribe(TOPIC, qos);
+            System.out.println("订阅完成");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 编辑连接信息
+     *
+     * @param userName
+     * @param password
+     * @param outTime
+     * @param KeepAlive
+     * @return
+     */
+    private MqttConnectOptions getOption(String userName, String password, int outTime, int KeepAlive) {
+        //MQTT连接设置
+        MqttConnectOptions option = new MqttConnectOptions();
+        //设置是否清空session,false表示服务器会保留客户端的连接记录,true表示每次连接到服务器都以新的身份连接
+        option.setCleanSession(false);
+        //设置连接的用户名
+        option.setUserName(userName);
+        //设置连接的密码
+        option.setPassword(password.toCharArray());
+        //设置超时时间 单位为秒
+        option.setConnectionTimeout(outTime);
+        //设置会话心跳时间 单位为秒 服务器会每隔(1.5*keepTime)秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制
+        option.setKeepAliveInterval(KeepAlive);
+        //setWill方法,如果项目中需要知道客户端是否掉线可以调用该方法。设置最终端口的通知消息
+        //option.setWill(topic, "close".getBytes(StandardCharsets.UTF_8), 2, true);
+        option.setMaxInflight(1000);
+        return option;
+    }
+
+
+}

+ 657 - 0
src/main/java/com/template/common/utils/TimeExchange.java

@@ -0,0 +1,657 @@
+package com.template.common.utils;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+
+/**
+ * 时间转化工具 date转为时间戳 时间戳转date 互相与String的转换
+ * 所有出现的String time 格式都必须为(yyyy-MM-dd HH:mm:ss),否则出错
+ *
+ */
+public class TimeExchange {
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss) 转 Date
+     *
+     * @param time
+     * @return
+     * @throws ParseException
+     */
+    // String date = "2010/05/04 12:34:23";
+    public static Date StringToDate(String time, String formatDate){
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatDate);
+        try {
+            date = dateFormat.parse(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * Date转为String(yyyy-MM-dd HH:mm:ss)
+     *
+     * @param time
+     * @return
+     */
+    public static String DateToString(Date time) {
+        String dateStr = "";
+        Date date = new Date();
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            dateStr = dateFormat.format(time);
+            System.out.println(dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    /**
+     * String(yyyy-MM-dd HH:mm:ss)转10位时间戳
+     *
+     * @param time
+     * @return
+     */
+    public static Integer StringToTimestamp(String time) {
+
+        int times = 0;
+        try {
+            times = (int) ((Timestamp.valueOf(time).getTime()) / 1000);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (times == 0) {
+            System.out.println("String转10位时间戳失败");
+        }
+        return times;
+
+    }
+
+    /**
+     * 10位int型的时间戳转换为String(yyyy-MM-dd HH:mm:ss)
+     *
+     * @param time
+     * @return
+     */
+    public static String timestampToString(Integer time) {
+        //int转long时,先进行转型再进行计算,否则会是计算结束后在转型
+        long temp = (long) time * 1000;
+        Timestamp ts = new Timestamp(temp);
+        String tsStr = "";
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            //方法一
+            tsStr = dateFormat.format(ts);
+            System.out.println(tsStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return tsStr;
+    }
+
+    /**
+     * 10位时间戳转Date
+     *
+     * @param time
+     * @return
+     */
+    public static Date TimestampToDate(Integer time) {
+        long temp = (long) time * 1000;
+        Timestamp ts = new Timestamp(temp);
+        Date date = new Date();
+        try {
+            date = ts;
+            //System.out.println(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return date;
+    }
+
+    /**
+     * Date类型转换为10位时间戳
+     *
+     * @param time
+     * @return
+     */
+    public static Integer DateToTimestamp(Date time) {
+        Timestamp ts = new Timestamp(time.getTime());
+
+        return (int) ((ts.getTime()) / 1000);
+    }
+
+    // 当前时间减1小时
+    public static String TimeDesH(Date time, int hour) {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(time);
+        nowTime2.add(Calendar.HOUR, -hour);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+
+    // 当前时间加5分钟
+    public static String TimeRangeI(String time) throws ParseException {
+        // 当前时间+5分钟
+        Date endTime = DateUtils.addMinutes(StringToDate(time, "yyyy-MM-dd HH:mm:ss"), 300);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(endTime);
+    }
+
+    // 当前时间加2分钟
+    public static String TimeRangeI10(String time, int m) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.SECOND, m);//10分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 当前时间减5分钟
+    public static String TimeRangeD(String time) throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.MINUTE, -300);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取当前日期
+    public static String getDate() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
+        return sp.format(new Date());
+    }
+
+    // 获取当前日期的年月
+    public static String getDateMonth() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-");
+        return sp.format(new Date());
+    }
+
+    // 获取前天
+    public static String getQianDay() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime(), "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.DATE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    // 获取当前时间
+    public static String getTime() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyMM() {
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm");
+        return sp.format(new Date());
+    }
+
+    public static String getOnlyDesMM() throws ParseException {
+        Calendar nowTime2 = Calendar.getInstance();
+        nowTime2.setTime(StringToDate(getTime(), "yyyy-MM-dd HH:mm:ss"));
+        nowTime2.add(Calendar.MINUTE, -5);//5分钟前的时间
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
+        return simpleDateFormat.format(nowTime2.getTime());
+    }
+
+    public static String getYear() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy");
+        return sp.format(new Date());
+    }
+
+    public static String getMonth() {
+        SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM");
+        return sp.format(new Date());
+    }
+
+    // 获取当前时间
+    public static String getOnlyTime() {
+        SimpleDateFormat sp = new SimpleDateFormat("HH:mm:ss");
+        return sp.format(new Date());
+    }
+
+    /**
+     * 计算两个日期的时间差
+     *
+     * @param time1
+     * @param time2
+     * @return
+     */
+    public static double getTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours = (double) ((t2 - t1) / 3600000);
+        double minutes = (double) (((t2 - t1) / 1000 - hours * 3600) / 60 / 60);
+        return hours + minutes;
+    }
+
+    public static double getOnlyTimeDifference(String time1, String time2) {
+        SimpleDateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
+        long t1 = 0L;
+        long t2 = 0L;
+        try {
+            t1 = timeformat.parse(time1).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        try {
+            t2 = timeformat.parse(time2).getTime();
+        } catch (ParseException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //因为t1-t2得到的是毫秒级,所以要初3600000得出小时.算天数或秒同理
+        double hours = (double) ((t2 - t1) / 3600000);
+        double minutes = (double) (((t2 - t1) / 1000 - hours * 3600) / 60 / 60);
+        return hours + minutes;
+    }
+
+    public static double getDiff(String str1, String str2) {
+        return str2.compareTo(str1);
+    }
+
+    /**
+     * 时间减去分钟数
+     *
+     * @param time      时间
+     * @param FormatStr 时间格式
+     * @param amount    要加减的时间(单位为分钟)
+     * @return
+     * @throws ParseException
+     */
+    public static String TimeRangeMinute(String time, int amount, String FormatStr) throws ParseException {
+        Date endTime = DateUtils.addMinutes(ShortStringToDate(time, FormatStr), amount);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FormatStr);
+        return simpleDateFormat.format(endTime);
+    }
+
+    /**
+     * 时间减去小时数
+     *
+     * @param time      时间
+     * @param FormatStr 时间格式
+     * @param amount    要加减的时间(单位为小时)
+     * @return
+     * @throws ParseException
+     */
+    public static String TimeRangeHour(Date time, int amount, String FormatStr) {
+        Date endTime = DateUtils.addHours(time, amount);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FormatStr);
+        return simpleDateFormat.format(endTime);
+    }
+
+    /**
+     * String 转 Date
+     *
+     * @param time      时间
+     * @param formatStr 自定义时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static Date ShortStringToDate(String time, String formatStr) throws ParseException {
+
+        Date date = new Date();
+        // 注意format的格式要与日期String的格式相匹配
+        DateFormat dateFormat = new SimpleDateFormat(formatStr);
+        try {
+            date = dateFormat.parse(time);
+            System.out.println(date.toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return date;
+    }
+
+    /**
+     * Date转为String
+     *
+     * @param time      时间
+     * @param FormatStr 自定义时间格式
+     * @return
+     */
+    public static String DateToString(Date time, String FormatStr) {
+        String dateStr = "";
+        DateFormat dateFormat = new SimpleDateFormat(FormatStr);
+        try {
+            dateStr = dateFormat.format(time);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return dateStr;
+    }
+
+    /**
+     * 日期路径 即年/月/日 如2018/08/08
+     */
+    public static final String datePath() {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyy/MM/dd");
+    }
+
+    /**
+     * 比较时间1是否小于时间2
+     * 如果时间1小于时间2,接口返回true
+     * 如果时间1大于时间2,接口返回false
+     *
+     * @param dateOne 时间1
+     * @param dateTwo 时间2
+     * @param Forma   时间格式
+     * @return
+     * @throws ParseException
+     */
+    public static boolean CompareDate(String dateOne, String dateTwo, String Forma) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat(Forma);
+        Date sd1 = df.parse(dateOne);
+        Date sd2 = df.parse(dateTwo);
+        return sd1.before(sd2);
+    }
+
+    public static LocalDateTime StringToLocalTime(String time, String formatStr){
+        //1.具有转换功能的对象
+        DateTimeFormatter df = DateTimeFormatter.ofPattern(formatStr);
+        //3.LocalDate发动,将字符串转换成  df格式的LocalDateTime对象,的功能
+        LocalDateTime LocalTime = LocalDateTime.parse(time,df);
+
+        return LocalTime;
+    }
+
+    /**
+     * 获取一周的开始时间和结束时间
+     * 获取本周星期一作为一周的第一天的起始时间和结束时间
+     *
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentWeekTimeFrame() {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        //start of the week
+        if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+            calendar.add(Calendar.DAY_OF_YEAR, -1);
+        }
+        calendar.add(Calendar.DAY_OF_WEEK, -(calendar.get(Calendar.DAY_OF_WEEK) - 2));
+        //给0的时候查不出数据
+//        calendar.set(Calendar.HOUR_OF_DAY, 0);
+//        calendar.set(Calendar.MINUTE, 0);
+//        calendar.set(Calendar.SECOND, 0);
+//        calendar.set(Calendar.MILLISECOND, 0);
+
+        String startTime = DateToString(calendar.getTime(), "yyyy-MM-dd");
+        //end of the week
+        calendar.add(Calendar.DAY_OF_WEEK, 6);
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        String endTime = DateToString(calendar.getTime(), "yyyy-MM-dd");
+        return new String[]{startTime, endTime};
+    }
+
+    /**
+     * 获取指定月份有多少天
+     *
+     * @param month
+     * @return
+     */
+    public static int getMonthDays(String date, int month) {
+        int year = Integer.valueOf(date.substring(0, 4));
+        int[] arr = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+        int day = arr[month - 1];//天数对应=数组-1
+        if (month == 2 && year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
+            day = 29;
+        }
+
+        return day;
+
+    }
+
+    /**
+     * 获取指定月份的第一天和最后一天
+     *
+     * @param DateStr 指定月份
+     * @return 返回的数据中第一个是开始时间 第二个是结束时间
+     */
+    public static String[] getCurrentMonthTimeFrame(String DateStr) {
+        Calendar c = Calendar.getInstance();//获取Calendar实例
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        int sss = Integer.parseInt(DateStr.substring(5, 7));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+
+        c.set(Calendar.DAY_OF_MONTH, 1);
+
+        String startDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
+
+        int lastDay = c.getActualMaximum(Calendar.DAY_OF_MONTH);
+        c.set(Calendar.DAY_OF_MONTH, lastDay);
+        String endDate = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime()) + " 23:59:59";
+
+        return new String[]{startDate, endDate};
+    }
+
+    //region 获取某一天的开始时间
+    public static String getStartOfDayStr(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 0, 0, 0);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+    //endregion
+
+    //region 获取某一天的结束时间
+    public static String getEndOfDayStr(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 23, 59, 59);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+    //endregion
+
+    //region 获取指定月份的最后一天
+    public static Date getToMonthEndDate(String DateStr) {
+        Calendar c = Calendar.getInstance();
+        c.clear();
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+        c.roll(Calendar.DAY_OF_MONTH, -1);
+        c.set(Calendar.HOUR_OF_DAY, 23);
+        c.set(Calendar.MINUTE, 59);
+        c.set(Calendar.SECOND, 59);
+        c.set(Calendar.MILLISECOND, 999);
+
+        return c.getTime();
+    }
+    //endregion
+
+    //region 获取指定月份的第一天
+    public static Date getToMonthBeginDate(String DateStr) {
+        Calendar c = Calendar.getInstance();
+        c.clear();
+        c.set(Calendar.YEAR, Integer.parseInt(DateStr.substring(0, 4)));
+        c.set(Calendar.MONTH, Integer.parseInt(DateStr.substring(5, 7).replace("-", "")) - 1);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 000);
+        return c.getTime();
+    }
+    //endregion
+
+    //region 获取某一天的开始时间
+    public static Date getStartOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.set(year, month, day, 0, 0, 0);
+        calendar.set(Calendar.MILLISECOND, 000);
+        return calendar.getTime();
+    }
+    //endregion
+
+    //region 获取某一天的结束时间
+    public static Date getEndOfDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day = calendar.get(Calendar.DATE);
+        calendar.setTimeInMillis(0);
+        calendar.set(year, month, day, 23, 59, 59);
+        return calendar.getTime();
+    }
+    //endregion
+
+//    public static List<UnitTimeHelpModel> MonthArrayTime(Date StartDate, Date EndDate) {
+//
+//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//格式化为年月
+//        Calendar StartTime = Calendar.getInstance();
+//        StartTime.setTime(StartDate);
+//        StartTime.set(StartTime.get(Calendar.YEAR), StartTime.get(Calendar.MONTH), StartTime.get(Calendar.DATE));
+//        Calendar EndTime = Calendar.getInstance();
+//        EndTime.setTime(EndDate);
+//        EndTime.set(EndTime.get(Calendar.YEAR), EndTime.get(Calendar.MONTH), EndTime.get(Calendar.DATE));
+//        int total = (EndTime.get(Calendar.YEAR) - StartTime.get(Calendar.YEAR)) * 12 + (EndTime.get(Calendar.MONTH) - StartTime.get(Calendar.MONTH));
+//        List<UnitTimeHelpModel> result = new ArrayList() {
+//        };
+//        for (int i = 0; i <= total; i++) {
+//            StartTime.add(Calendar.MONTH, i == 0 ? 0 : 1);
+//            Date MonthLastDay = getToMonthEndDate(sdf.format(StartTime.getTime()));
+//            UnitTimeHelpModel data = new UnitTimeHelpModel();
+//            data.setStartDate(i == 0 ? StartTime.getTime() : getStartOfDay(getToMonthBeginDate(sdf.format(StartTime.getTime()))));
+//            data.setEndDate(EndTime.getTime().before(MonthLastDay) ? getEndOfDay(EndTime.getTime()) : MonthLastDay);
+//            result.add(data);
+//        }
+//
+//        return result;
+//    }
+//
+//    public static List<ClassSettingDateVo> getDatesBetween(LocalDate startDate, LocalDate endDate) {
+//        List<ClassSettingDateVo> datas = new ArrayList<>();
+//        long numOfDaysBetween = ChronoUnit.DAYS.between(startDate, endDate);
+//        for (int i = 0; i <= numOfDaysBetween; i++) {
+//            ClassSettingDateVo data = new ClassSettingDateVo();
+//            LocalDate date = startDate.plusDays(i);
+//            // 获取当前日期对应的星期几
+//            DayOfWeek dow = date.getDayOfWeek();
+//            int dayOfWeek = dow.getValue(); // 获取星期几的数字表示,1表示周一,7表示周日
+//            data.setWeekStr(eWeekStatu.stringOf(dayOfWeek));
+//            data.setWeek(dayOfWeek);
+//            data.setDateStr(date.toString());
+//            datas.add(data);
+//        }
+//        return datas;
+//    }
+
+    /**
+     * 获取时间date1与date2相差的秒数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的秒数
+     */
+    public static int getOffsetSeconds(Date date1, Date date2) {
+        int seconds = (int) ((date2.getTime() - date1.getTime()) / 1000);
+        return seconds;
+    }
+
+    /**
+     * 获取时间date1与date2相差的分钟数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的分钟数
+     */
+    public static int getOffsetMinutes(Date date1, Date date2) {
+        return getOffsetSeconds(date1, date2) / 60;
+    }
+
+    /**
+     * 获取时间date1与date2相差的小时数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的小时数
+     */
+    public static int getOffsetHours(Date date1, Date date2) {
+        return getOffsetMinutes(date1, date2) / 60;
+    }
+
+    /**
+     * 获取时间date1与date2相差的天数数
+     *
+     * @param date1 起始时间
+     * @param date2 结束时间
+     * @return 返回相差的天数
+     */
+    public static int getOffsetDays(Date date1, Date date2) {
+        return getOffsetHours(date1, date2) / 24+1;
+    }
+
+    public static boolean overlapping(String start1,String end1,String start2,String end2) throws ParseException {
+        boolean one = CompareDate(start1,end2,"HH:mm");
+        boolean two = CompareDate(start2,end1,"HH:mm");
+        return (one && two);
+    }
+
+    public static String getWeek(String sdate) throws ParseException {
+        // 再转换为时间
+        Date date = StringToDate(sdate,"yyyy-MM-dd");
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        // int hour=c.get(Calendar.DAY_OF_WEEK);
+        // hour中存的就是星期几了,其范围 1~7
+        // 1=星期日 7=星期六,其他类推
+        return new SimpleDateFormat("EEEE").format(c.getTime());
+    }
+
+    public static void main(String[] args) throws ParseException {
+        BigDecimal ss = new BigDecimal(0.3).divide(new BigDecimal(3),2);//.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+        System.out.println("");
+    }
+}
+

+ 270 - 0
src/main/java/com/template/common/utils/WechatPayApiV3Util.java

@@ -0,0 +1,270 @@
+package com.template.common.utils;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.TypeReference;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.HttpUrl;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.core.io.ClassPathResource;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.GCMParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.security.cert.*;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.Map;
+import java.util.Random;
+import java.util.Scanner;
+
+/**
+ * @Author sanji
+ * @Date 2023/11/27 19:00
+ * @Version 1.0
+ * @description
+ */
+@Slf4j
+public class WechatPayApiV3Util {
+
+    /**
+     * 获取微信支付平台证书  注意不是商户api证书
+     */
+    private static final String WechatPaySerial = "https://api.mch.weixin.qq.com/v3/certificates";
+
+
+    /**
+     * 微信支付API v3 签名
+     *
+     * @param method       请求类型GET、POST
+     * @param url          请求地址
+     * @param body         请求数据 GET: 传"" POST: json串
+     * @param merchantId   商户号
+     * @param certSerialNo 商户证书(Api证书)序列号
+     * @param filename     商户证书(Api证书) 私钥
+     * @return
+     * @throws Exception
+     */
+    public static String getToken(String method, String url, String body, String merchantId, String certSerialNo, String filename) throws Exception {
+        String signStr = "";
+        HttpUrl httpurl = HttpUrl.parse(url);
+        // 随机字符串
+        String nonceStr = getRandomString(32);
+        // 时间戳
+        long timestamp = System.currentTimeMillis() / 1000;
+        if (StringUtils.isEmpty(body)) {
+            body = "";
+        }
+        String message = buildMessage(method, httpurl, timestamp, nonceStr, body);
+        String signature = sign(message.getBytes("utf-8"), filename);
+        signStr = "mchid=\"" + merchantId + "\","
+                + "nonce_str=\"" + nonceStr + "\","
+                + "timestamp=\"" + timestamp + "\","
+                + "serial_no=\"" + certSerialNo + "\","
+                + "signature=\"" + signature + "\"";
+        log.info("Authorization Token:" + signStr);
+        return signStr;
+    }
+
+    public static String buildMessage(String method, HttpUrl url, long timestamp, String nonceStr, String body) {
+        String canonicalUrl = url.encodedPath();
+        if (url.encodedQuery() != null) {
+            canonicalUrl += "?" + url.encodedQuery();
+        }
+        return method + "\n"
+                + canonicalUrl + "\n"
+                + timestamp + "\n"
+                + nonceStr + "\n"
+                + body + "\n";
+    }
+
+
+    public static String sign(byte[] message, String filename) throws Exception {
+        Signature sign = Signature.getInstance("SHA256withRSA");
+        sign.initSign(getPrivateKey(filename));
+        sign.update(message);
+        return Base64.encodeBase64String(sign.sign());
+    }
+
+    /**
+     * 获取私钥。
+     *
+     * @return 私钥对象
+     */
+    public static PrivateKey getPrivateKey(String filename) throws IOException {
+        // 编译后的相对路径
+        ClassPathResource classPathResource = new ClassPathResource(filename);
+        InputStream inputStream = classPathResource.getInputStream();
+        Scanner scanner = new Scanner(inputStream, "UTF-8");
+        String content = scanner.useDelimiter("\\A").next();
+        // 绝对路径
+//        String content = new String(Files.readAllBytes(Paths.get("F:\\key\\publicKey.pem")), "utf-8");
+        try {
+            String privateKey = content.replace("-----BEGIN PRIVATE KEY-----", "")
+                    .replace("-----END PRIVATE KEY-----", "")
+                    .replaceAll("\\s+", "");
+            KeyFactory kf = KeyFactory.getInstance("RSA");
+            return kf.generatePrivate(
+                    new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey)));
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException("当前Java环境不支持RSA", e);
+        } catch (InvalidKeySpecException e) {
+            log.info("异常:" + e);
+            throw new RuntimeException("无效的密钥格式");
+        }
+    }
+
+
+    /**
+     * 获取微信支付平台证书
+     *
+     * @param token
+     * @return
+     * @throws IOException
+     */
+    public static String getWechatPaySerial(String token) throws IOException {
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        HttpEntity entity = null;
+        try {
+            HttpGet httpGet = new HttpGet(WechatPaySerial);
+            // NOTE: 建议指定charset=utf-8。低于4.4.6版本的HttpCore,不能正确的设置字符集,可能导致签名错误
+            httpGet.addHeader("Content-Type", "application/json");
+            // 添加认证信息
+            httpGet.addHeader("Authorization", "WECHATPAY2-SHA256-RSA2048" + " " + token);
+            httpGet.addHeader("Accept", "application/json");
+            //httpGet.addHeader("User-Agent", " ");
+            response = httpclient.execute(httpGet);
+            entity = response.getEntity();//获取返回的数据
+            log.info("返回结果:{}", EntityUtils.toString(entity));
+            return EntityUtils.toString(entity);
+        } catch (Exception e) {
+            log.info("提现失败:{}", e.getMessage());
+        } finally {
+            // 关闭流
+            response.close();
+        }
+        return null;
+    }
+
+    /**
+     * 获取商户证书。
+     *
+     * @return X509证书
+     */
+    public static X509Certificate getCertificate() throws IOException {
+        String APICLIENT_CERT = "pem/apiclient_cert.pem";
+        InputStream fis = WechatPayApiV3Util.class.getClassLoader().getResourceAsStream(APICLIENT_CERT);
+        try (BufferedInputStream bis = new BufferedInputStream(fis)) {
+            CertificateFactory cf = CertificateFactory.getInstance("X509");
+            X509Certificate cert = (X509Certificate) cf.generateCertificate(bis);
+            cert.checkValidity();
+            return cert;
+        } catch (CertificateExpiredException e) {
+            throw new RuntimeException("证书已过期", e);
+        } catch (CertificateNotYetValidException e) {
+            throw new RuntimeException("证书尚未生效", e);
+        } catch (CertificateException e) {
+            throw new RuntimeException("无效的证书文件", e);
+        }
+    }
+
+    /**
+     * 获取商户证书序列号
+     *
+     * @return
+     * @throws IOException
+     */
+    public static String getSerialNo() throws IOException {
+        X509Certificate certificate = getCertificate();
+        return certificate.getSerialNumber().toString(16).toUpperCase();
+    }
+
+    /**
+     * 生成随机数
+     *
+     * @param length
+     * @return
+     */
+    public static String getRandomString(int length) {
+//      创建一个随机数生成器。
+        SecureRandom random = new SecureRandom();
+        StringBuffer sb = new StringBuffer();
+
+        for (int i = 0; i < length; ++i) {
+//          返回下一个伪随机数,它是此随机数生成器的序列中均匀分布的 int 值。
+            int number = random.nextInt(3);
+            long result = 0;
+//          Math 类包含用于执行基本数学运算的方法,如初等指数、对数、平方根和三角函数。
+//          Math.random()  返回带正号的 double 值,该值大于等于 0.0 且小于 1.0。
+//          Math.round(Math.random() * 25 + 97)  返回最接近参数的 long。
+            switch (number) {
+                case 0:
+                    result = Math.round(Math.random() * 25 + 65);
+                    sb.append(String.valueOf((char) result));
+                    break;
+                case 1:
+                    result = Math.round(Math.random() * 25 + 97);
+                    sb.append(String.valueOf((char) result));
+                    break;
+                case 2:
+                    sb.append(String.valueOf(new Random().nextInt(10)));
+                    break;
+            }
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 对称解密,异步通知的加密数据
+     *
+     * @param resource 加密数据
+     * @param apiV3Key apiV3密钥
+     * @param type     1-支付,2-退款
+     * @return
+     */
+    public static Map<String, Object> decryptFromResource(String resource, String apiV3Key, Integer type) {
+
+        String msg = type == 1 ? "支付成功" : "退款成功";
+        log.info(msg + ",回调通知,密文解密");
+        try {
+            //通知数据
+            Map<String, String> resourceMap = JSONObject.parseObject(resource, new TypeReference<Map<String, String>>() {
+            });
+            //数据密文
+            String ciphertext = resourceMap.get("ciphertext");
+            //随机串
+            String nonce = resourceMap.get("nonce");
+            //附加数据
+            String associatedData = resourceMap.get("associated_data");
+
+            log.info("密文: {}", ciphertext);
+//        AesUtil aesUtil = new AesUtil(apiV3Key.getBytes(StandardCharsets.UTF_8));
+//        String resourceStr = aesUtil.decryptToString(associatedData.getBytes(StandardCharsets.UTF_8),
+//                nonce.getBytes(StandardCharsets.UTF_8),
+//                ciphertext);
+
+
+            String resourceStr = AesUtils.decrypt(resource, apiV3Key);
+
+
+            log.info(msg + ",回调通知,解密结果 : {}", resourceStr);
+            return JSONObject.parseObject(resourceStr, new TypeReference<Map<String, Object>>() {
+            });
+        } catch (Exception e) {
+            throw new RuntimeException("回调参数,解密失败!");
+        }
+    }
+}

+ 53 - 0
src/main/java/com/template/common/utils/WxConstants.java

@@ -0,0 +1,53 @@
+package com.template.common.utils;
+
+/**
+ * 微信公众号常量类
+ * @author lujunjie
+ * @date   2018/06/28
+ */
+public class WxConstants {
+
+    /**
+     * 默认编码
+     */
+    public static final String DEFAULT_CHARSET = "UTF-8";
+
+    /**
+     * 统一下单-扫描支付
+     */
+    public static String PAY_UNIFIEDORDER = "https://app.dev.9kbs.com/shopOpenApi/services/deviceAntiScode/getStartCode";
+
+    public static String Test = "http://localhost:8088/HotWaters/userget_stu.action";
+
+    public static String Test2 = "http://localhost:8088/HotWaters/userstu_info.action";
+
+    /**
+     * 请求成功返回码
+     */
+    public final static String ERRCODE_OK_CODE = "0";
+    /**
+     * 错误的返回码的Key
+     */
+    public final static String ERRCODE = "errcode";
+
+    /**
+     * 返回状态码
+     */
+    public final static String RETURN_CODE= "return_code";
+
+    /**
+     * access_token 字符串
+     */
+    public final static String ACCESS_TOKEN = "access_token";
+
+    /**
+     * 签名类型 MD5
+     */
+    public final static String SING_MD5 = "MD5";
+
+    /**
+     * 签名类型 HMAC-SHA256
+     */
+    public final static String SING_HMACSHA256 = "HMAC-SHA256";
+
+}

+ 445 - 0
src/main/java/com/template/common/utils/WxUtil.java

@@ -0,0 +1,445 @@
+package com.template.common.utils;
+
+import com.template.common.utils.weixin.DictionaryCompare;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.*;
+import java.security.MessageDigest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.Map.Entry;
+
+/**
+ * 微信公众号接口工具类
+ * @author lujunjie
+ * @date   2018/03/01
+ */
+public class WxUtil {
+
+
+
+	/**
+	 * 加密/校验流程如下:
+	 * 1. 将token、timestamp、nonce三个参数进行字典序排序<br>
+	 * 2. 将三个参数字符串拼接成一个字符串进行sha1加密<br>
+	 * 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信<br>
+	 *
+	 * @param token Token验证密钥
+	 * @param signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数,nonce参数
+	 * @param timestamp 时间戳
+	 * @param nonce 随机数
+	 * @return 验证成功返回:true,失败返回:false
+	 */
+	public static boolean checkSignature(String token, String signature, String timestamp, String nonce) {
+		List<String> params = new ArrayList<String>();
+		params.add(token);
+		params.add(timestamp);
+		params.add(nonce);
+		//1. 将token、timestamp、nonce三个参数进行字典序排序
+		Collections.sort(params, new Comparator<String>() {
+			@Override
+			public int compare(String o1, String o2) {
+				return o1.compareTo(o2);
+			}
+		});
+		//2. 将三个参数字符串拼接成一个字符串进行sha1加密
+		String temp = SHA1.encode(params.get(0) + params.get(1) + params.get(2));
+		//3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信
+		return temp.equals(signature);
+	}
+
+	/**
+	 * 输入流转化为字符串
+	 * @param inputStream 流
+	 * @return String 字符串
+	 * @throws Exception
+	 */
+	public static String getStreamString(InputStream inputStream) throws Exception{
+		StringBuffer buffer=new StringBuffer();
+		InputStreamReader inputStreamReader = null;
+		BufferedReader bufferedReader = null;
+		try{
+			inputStreamReader=new InputStreamReader(inputStream, WxConstants.DEFAULT_CHARSET);
+			bufferedReader=new BufferedReader(inputStreamReader);
+			String line;
+			while((line=bufferedReader.readLine())!=null){
+				buffer.append(line);
+			}
+		}catch(Exception e){
+			throw new Exception();
+		}finally {
+			if(bufferedReader != null){
+				bufferedReader.close();
+			}
+			if(inputStreamReader != null){
+				inputStreamReader.close();
+			}
+			if(inputStream != null){
+				inputStream.close();
+			}
+		}
+		return buffer.toString();
+	}
+
+	/**
+	 * 获取随机字符串 Nonce Str
+	 * @return String 随机字符串
+	 */
+	public static String getNonceStr() {
+		return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32);
+	}
+
+	/**
+	 * 生成签名. 注意,若含有sign_type字段,必须和signType参数保持一致。
+	 * @param data 待签名数据
+	 * @param apikey API密钥
+	 * @return 签名
+	 */
+	public static String getSignature(final Map<String, String> data, String apikey,
+				String signType) throws Exception {
+		Set<String> keySet = data.keySet();
+		String[] keyArray = keySet.toArray(new String[keySet.size()]);
+		Arrays.sort(keyArray);
+		StringBuilder sb = new StringBuilder();
+		sb.append(apikey);
+		sb.append("amount10apicodeCS0001collect_code");
+		sb.append(data.get("collect_code").trim());
+		sb.append("order_no");
+		sb.append(data.get("order_no").trim());
+        sb.append("timestamp");
+        sb.append(data.get("timestamp").trim());
+        sb.append(apikey);
+		System.out.println(sb);
+		if (signType.equals(WxConstants.SING_MD5)) {
+			System.out.println(MD5(sb.toString()).toUpperCase());
+			return MD5(sb.toString()).toLowerCase();
+		}
+		else if (signType.equals(WxConstants.SING_HMACSHA256)) {
+			return HMACSHA256(sb.toString(), apikey);
+		}
+		else {
+			throw new Exception(String.format("Invalid sign_type: %s", signType));
+		}
+	}
+
+	/**
+	 * 生成 MD5
+	 * @param data 待处理数据
+	 * @return MD5结果
+	 */
+	public static String MD5(String data) throws Exception {
+		MessageDigest md = MessageDigest.getInstance("MD5");
+		byte[] array = md.digest(data.getBytes("UTF-8"));
+		StringBuilder sb = new StringBuilder();
+		for (byte item : array) {
+			sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
+		}
+		return sb.toString().toUpperCase();
+	}
+
+	/**
+	 * 生成 HMACSHA256
+	 * @param data 待处理数据
+	 * @param key 密钥
+	 * @return 加密结果
+	 * @throws Exception
+	 */
+	public static String HMACSHA256(String data, String key) throws Exception {
+		Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
+		SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
+		sha256_HMAC.init(secret_key);
+		byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
+		StringBuilder sb = new StringBuilder();
+		for (byte item : array) {
+			sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
+		}
+		return sb.toString().toUpperCase();
+	}
+
+	/**
+	 * @param data Map类型数据
+	 * @return XML格式的字符串
+	 * @throws Exception
+	 */
+	public static String mapToXml(Map<String, String> data) throws Exception {
+		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+		DocumentBuilder documentBuilder= documentBuilderFactory.newDocumentBuilder();
+		org.w3c.dom.Document document = documentBuilder.newDocument();
+		org.w3c.dom.Element root = document.createElement("xml");
+		document.appendChild(root);
+		for (String key: data.keySet()) {
+			String value = data.get(key);
+			if (value == null) {
+				value = "";
+			}
+			value = value.trim();
+			org.w3c.dom.Element filed = document.createElement(key);
+			filed.appendChild(document.createTextNode(value));
+			root.appendChild(filed);
+		}
+		TransformerFactory tf = TransformerFactory.newInstance();
+		Transformer transformer = tf.newTransformer();
+		DOMSource source = new DOMSource(document);
+		transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+		transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+		StringWriter writer = new StringWriter();
+		StreamResult result = new StreamResult(writer);
+		transformer.transform(source, result);
+		String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", "");
+		try {
+			writer.close();
+		}
+		catch (Exception ex) {
+		}
+		return output;
+	}
+
+	/**
+	 * 处理 HTTPS API返回数据,转换成Map对象。return_code为SUCCESS时,验证签名。
+	 * @param xmlStr API返回的XML格式数据
+	 * @return Map类型数据
+	 * @throws Exception
+	 */
+//	public static Map<String, String> processResponseXml(String xmlStr,String signType) throws Exception {
+//		String RETURN_CODE = WxConstants.RETURN_CODE;
+//		String return_code;
+//		Map<String, String> respData = xmlToMap(xmlStr);
+//		if (respData.containsKey(RETURN_CODE)) {
+//			return_code = respData.get(RETURN_CODE);
+//		}
+//		else {
+//			throw new Exception(String.format("No `return_code` in XML: %s", xmlStr));
+//		}
+//
+//		if (return_code.equals("FAIL")) {
+//			return respData;
+//		}
+//		else if (return_code.equals("SUCCESS")) {
+//			if (isResponseSignatureValid(respData,signType)) {
+//				return respData;
+//			}
+//			else {
+//				throw new Exception(String.format("Invalid sign value in XML: %s", xmlStr));
+//			}
+//		}
+//		else {
+//			throw new Exception(String.format("return_code value %s is invalid in XML: %s", return_code, xmlStr));
+//		}
+//	}
+
+
+	/**
+	 * XML格式字符串转换为Map
+	 * @param strXML XML字符串
+	 * @return XML数据转换后的Map
+	 * @throws Exception
+	 */
+	public static Map<String, String> xmlToMap(String strXML) throws Exception {
+		try {
+			Map<String, String> data = new HashMap<String, String>();
+			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+
+			String FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
+			documentBuilderFactory.setFeature(FEATURE, true);
+
+			FEATURE = "http://xml.org/sax/features/external-general-entities";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			FEATURE = "http://xml.org/sax/features/external-parameter-entities";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
+			documentBuilderFactory.setFeature(FEATURE, false);
+
+			documentBuilderFactory.setXIncludeAware(false);
+			documentBuilderFactory.setExpandEntityReferences(false);
+			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+			InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8"));
+			org.w3c.dom.Document doc = documentBuilder.parse(stream);
+			doc.getDocumentElement().normalize();
+			NodeList nodeList = doc.getDocumentElement().getChildNodes();
+			for (int idx = 0; idx < nodeList.getLength(); ++idx) {
+				Node node = nodeList.item(idx);
+				if (node.getNodeType() == Node.ELEMENT_NODE) {
+					org.w3c.dom.Element element = (org.w3c.dom.Element) node;
+					data.put(element.getNodeName(), element.getTextContent());
+				}
+			}
+			try {
+				stream.close();
+			} catch (Exception ex) {
+				// do nothing
+			}
+			return data;
+		} catch (Exception ex) {
+			throw ex;
+		}
+	}
+
+	/**
+	 * 判断xml数据的sign是否有效,必须包含sign字段,否则返回false。
+	 * @param reqData 向wxpay post的请求数据
+	 * @return 签名是否有效
+	 * @throws Exception
+	 */
+//	private static boolean isResponseSignatureValid(final Map<String, String> reqData,String signType) throws Exception {
+//		// 返回数据的签名方式和请求中给定的签名方式是一致的
+//		return isSignatureValid(reqData,wxOpenidConfig.getAppkey(),signType);
+//	}
+
+	/**
+	 * 判断签名是否正确,必须包含sign字段,否则返回false。
+	 * @param data Map类型数据
+	 * @param key API密钥
+	 * @param signType 签名方式
+	 * @return 签名是否正确
+	 * @throws Exception
+	 */
+	public static boolean isSignatureValid(Map<String, String> data, String key, String signType) throws Exception {
+		if (!data.containsKey("sign")) {
+			return false;
+		}
+		String sign = data.get("sign");
+		return getSignature(data, key, signType).equals(sign);
+	}
+
+//	/**
+//	 * 生成支付二维码
+//	 * @param response 响应
+//	 * @param contents url链接
+//	 * @throws Exception
+//	 */
+//	public static void writerPayImage(HttpServletResponse response, String contents) throws Exception{
+//		ServletOutputStream out = response.getOutputStream();
+//		try {
+//			Map<EncodeHintType,Object> hints = new HashMap<EncodeHintType,Object>();
+//			hints.put(EncodeHintType.CHARACTER_SET,"UTF-8");
+//			hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
+//			hints.put(EncodeHintType.MARGIN, 0);
+//			BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, BarcodeFormat.QR_CODE,300,300,hints);
+//			MatrixToImageWriter.writeToStream(bitMatrix,"jpg",out);
+//		}catch (Exception e){
+//			throw new Exception("生成二维码失败!");
+//		}finally {
+//			if(out != null){
+//				out.flush();
+//				out.close();
+//			}
+//		}
+//	}
+
+	/**
+	 * 生成商户订单号
+	 * @return String
+	 */
+	public static String mchOrderNo(){
+		SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
+		String date = sdf.format(new Date());
+
+		Random random = new Random();
+		String fourRandom = String.valueOf(random.nextInt(10000));
+		int randLength = fourRandom.length();
+		//不足4位继续补充
+		if(randLength<4){
+			for(int remain = 1; remain <= 4 - randLength; remain ++ ){
+				fourRandom += random.nextInt(10)  ;
+			}
+		}
+		return date+fourRandom;
+	}
+
+	/**
+	 * 返回信息给微信
+	 * @param response
+	 * @param content 内容
+	 * @throws Exception
+	 */
+	public static void responsePrint(HttpServletResponse response, String content) throws Exception{
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("text/xml");
+		response.getWriter().print(content);
+		response.getWriter().flush();
+		response.getWriter().close();
+	}
+
+	/**
+	 * 获得随机字符串
+	 *
+	 * @return
+	 */
+	public static String getWxNonceStr() {
+		Random random = new Random();
+		long val = random.nextLong();
+		String res = DigestUtils.md5Hex(val + "yzx").toUpperCase();
+		if (32 < res.length())
+			return res.substring(0, 32);
+		else
+			return res;
+	}
+
+	/**
+	 * 获得签名
+	 *
+	 * @param params
+	 *            待编码参数,参数值为空不传入
+	 * @param key
+	 *            key设置路径:微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置
+	 * @return
+	 */
+	public static String getSign(Map<String, String> params, String key)
+			throws Exception {
+		List<String> list = new ArrayList<String>(params.keySet());
+		Collections.sort(list, new DictionaryCompare());
+		StringBuffer sb = new StringBuffer();
+		for (String keyVal : list) {
+			if (params.get(keyVal) != null) {
+				sb.append(keyVal + "=" + params.get(keyVal) + "&");
+			}
+		}
+		sb.append("key=" + key);
+		return DigestUtils
+				.md5Hex(new String(sb.toString().getBytes(), "utf-8"))
+				.toUpperCase();
+	}
+
+	/**
+	 * 把map转换成xml格式
+	 * @param params
+	 * @return
+	 * @throws Exception
+	 */
+	public static String getRequestXml(Map<String, String> params) throws Exception{
+		StringBuffer sb = new StringBuffer();
+		sb.append("<xml>");
+		Set<Entry<String, String>> es = params.entrySet();
+		Iterator<Entry<String, String>> it = es.iterator();
+		while (it.hasNext()) {
+			Entry<String, String> entry = (Entry<String, String>) it
+					.next();
+			String k = (String) entry.getKey();
+			String v = (String) entry.getValue();
+			if ("attach".equalsIgnoreCase(k) || "body".equalsIgnoreCase(k)) {
+				sb.append("<" + k + ">" + "<![CDATA[" + v + "]]></" + k + ">");
+			} else {
+				sb.append("<" + k + ">" + v + "</" + k + ">");
+			}
+		}
+		sb.append("</xml>");
+
+//        return sb.toString();
+		return new String(sb.toString().toString().getBytes(), "utf-8");
+	}
+}

+ 1 - 1
src/main/java/com/template/common/utils/weixin/DictionaryCompare.java

@@ -5,7 +5,7 @@ import java.util.Comparator;
 /**
  * 按字典序排序
  */
-class DictionaryCompare implements Comparator<String> {
+public class DictionaryCompare implements Comparator<String> {
 	public int compare(String o1, String o2) {
 		return o1.compareTo(o2);
 	}

+ 237 - 0
src/main/java/com/template/common/utils/weixin/UnifiedOrderVO.java

@@ -0,0 +1,237 @@
+package com.template.common.utils.weixin;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * @Author: codingliang
+ * @Description: 统一下单VO
+ * @Date: 2021-06-02 14:54
+ * @Version: V1.0
+ **/
+@Data
+@Accessors(chain = true)
+public class UnifiedOrderVO {
+    /**
+     * 公众号ID
+     */
+    private String appid;
+    /**
+     * 服务商公众号ID
+     */
+    private String sp_appid;
+    /**
+     * 直连商户号
+     */
+    private String mchid;
+    /**
+     * 服务商户号
+     */
+    private String sp_mchid;
+    /**
+     * 子商户公众号ID
+     */
+    private String sub_appid;
+    /**
+     * 子商户号
+     */
+    private String sub_mchid;
+    /**
+     * 商品描述
+     */
+    private String description;
+    /**
+     * 商户订单号
+     */
+    private String out_trade_no;
+    /**
+     * 交易结束时间
+     */
+    private String time_expire;
+    /**
+     * 附加数据
+     */
+    private String attach;
+    /**
+     * 通知地址
+     */
+    private String notify_url;
+    /**
+     * 订单优惠标记
+     */
+    private String goods_tag;
+    /**
+     * 结算信息
+     */
+    private SettleInfo settle_info;
+    /**
+     * 订单金额
+     */
+    private Amount amount;
+    /**
+     * 支付者
+     */
+    private Payer payer;
+    /**
+     * 优惠功能
+     */
+    private Detail detail;
+    /**
+     * 场景信息
+     */
+    private SceneInfo scene_info;
+
+    @Data
+    @Accessors(chain = true)
+    public static class SettleInfo {
+        /**
+         * 是否指定分账
+         */
+        private boolean profit_sharing;
+        /**
+         * 补差金额
+         */
+        private int subsidy_amount;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class Amount {
+        /**
+         * 总金额
+         */
+        private int total;
+        /**
+         * 货币类型
+         */
+        private String currency;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class Payer {
+        /**
+         * 用户标识
+         */
+        private String openid;
+        /**
+         * 用户服务标识
+         */
+        private String sp_openid;
+        /**
+         * 用户子标识
+         */
+        private String sub_openid;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class Detail {
+        /**
+         * 订单原价
+         */
+        private int cost_price;
+        /**
+         * 商品小票ID
+         */
+        private String invoice_id;
+        /**
+         * 单品列表
+         */
+        private List<GoodsDetail> goods_detail;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class SceneInfo {
+        /**
+         * 用户终端IP
+         */
+        private String payer_client_ip;
+        /**
+         * 商户端设备号
+         */
+        private String device_id;
+        /**
+         * 商户门店信息
+         */
+        private StoreInfo store_info;
+        /**
+         * H5 场景信息
+         */
+        private H5Info h5_info;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class H5Info {
+        /**
+         * 场景类型
+         */
+        private String type;
+        /**
+         * 应用名称
+         */
+        private String app_name;
+        /**
+         * 网站URL
+         */
+        private String app_url;
+        /**
+         * iOS 平台 BundleID
+         */
+        private String bundle_id;
+        /**
+         * Android 平台 PackageName
+         */
+        private String package_name;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class StoreInfo {
+        /**
+         * 门店编号
+         */
+        private String id;
+        /**
+         * 门店名称
+         */
+        private String name;
+        /**
+         * 地区编码
+         */
+        private String area_code;
+        /**
+         * 详细地址
+         */
+        private String address;
+    }
+
+    @Data
+    @Accessors(chain = true)
+    public static class GoodsDetail {
+        /**
+         * 商户侧商品编码
+         */
+        private String merchant_goods_id;
+        /**
+         * 微信侧商品编码
+         */
+        private String wechatpay_goods_id;
+        /**
+         * 商品名称
+         */
+        private String goods_name;
+        /**
+         * 商品数量
+         */
+        private int quantity;
+        /**
+         * 商品单价
+         */
+        private int unit_price;
+    }
+}

+ 26 - 0
src/main/java/com/template/config/WxPayV3Config.java

@@ -0,0 +1,26 @@
+package com.template.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author: codingliang
+ * @Description: 微信支付V3配置
+ * @Date: 2021-06-02 14:17
+ * @Version: V1.0
+ **/
+@Component
+@ConfigurationProperties(prefix = "wechat.pay.v3")
+@Data
+public class WxPayV3Config {
+    private String appId;
+    private String keyPath;
+    private String certPath;
+    private String certP12Path;
+    private String platformCertPath;
+    private String mchId;
+    private String apiKey;
+    private String apiKey3;
+    private String domain;
+}

+ 229 - 7
src/main/java/com/template/controller/AdminController.java

@@ -1,17 +1,41 @@
 package com.template.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.api.AdminAPI;
+import com.template.common.utils.RSAUtils;
+import com.template.config.MySecurity;
+import com.template.model.dto.SaveAdminDto;
+import com.template.model.dto.UpdateAdminDto;
 import com.template.model.pojo.Admin;
+import com.template.model.pojo.AdminMenu;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.Users;
+import com.template.model.request.loginRequest;
 import com.template.model.result.CommonResult;
+import com.template.model.vo.AdminVo;
+import com.template.services.AdminMenuService;
+import com.template.services.AdminService;
+import com.template.services.PermissionSettingService;
+import com.template.services.UsersService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.security.PublicKey;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author ceshi
@@ -20,20 +44,218 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 public class AdminController implements AdminAPI {
 
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    AdminMenuService adminMenuService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    UsersService usersService;
+
+    @Autowired
+    MySecurity mySecurity;
+
+    @Override
+    public CommonResult getListPage(int permissionSettingId, int page, int size, String keyWord, String startTime, String endTime, String status) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String accountManagement = permissionSetting.getAccountManagement();
+        if (!"0".equals(accountManagement) && !accountManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+
+        LambdaQueryWrapper<Admin> wrapper = new LambdaQueryWrapper<>();
+        wrapper.between(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime), Admin::getCreateTime, startTime, endTime)
+                .eq(ObjectUtils.isNotEmpty(status), Admin::getStatus, status)
+                .like(ObjectUtils.isNotEmpty(keyWord), Admin::getName, keyWord)
+                .orderByDesc(Admin::getCreateTime);
+
+        IPage<Admin> page1 = adminService.page(new Page<>(page, size), wrapper);
+        Page<AdminVo> adminVoPage = new Page<>();
+        List<Admin> records = page1.getRecords();
+        ArrayList<AdminVo> adminVos = new ArrayList<>();
+        for (Admin record : records) {
+            AdminVo adminVo = new AdminVo();
+            BeanUtils.copyProperties(record,adminVo);
+            String adminMenuId = record.getAdminMenuId();
+            AdminMenu adminMenu = adminMenuService.getById(adminMenuId);
+            adminVo.setAdminMenu(adminMenu);
+            Users byId = usersService.getById(record.getUsersId());
+            adminVo.setCardNumber(byId.getCardNumber());
+//            解密
+            try {
+                String decrypt = RSAUtils.decrypt(record.getPassWord(), RSAUtils.getPrivateKey(mySecurity.privateKey));
+                adminVo.setPassWord(decrypt);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+            adminVos.add(adminVo);
+        }
+        BeanUtils.copyProperties(page1,adminVoPage);
+        adminVoPage.setRecords(adminVos);
+
+
+        return CommonResult.ok(adminVoPage);
+    }
+
+    @Override
+    public CommonResult save(SaveAdminDto saveAdminDto) {
+        String permissionSettingId = saveAdminDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String accountManagement = permissionSetting.getAccountManagement();
+        if (!"0".equals(accountManagement) && !accountManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+//        通过cardNumber找到对应的用户
+        String cardNumber = saveAdminDto.getCardNumber();
+        LambdaQueryWrapper<Users> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(Users::getCardNumber,cardNumber);
+        Users users = usersService.getOne(wrapper);
+        if (ObjectUtils.isEmpty(users)) {
+            return CommonResult.fail("暂无该用户");
+        }
+
+//  密码加密
+        String passWord = saveAdminDto.getPassWord();
+        try {
+            Admin admin = new Admin();
+            String encrypt = RSAUtils.encrypt(passWord, RSAUtils.getPublicKey(mySecurity.publicKey));
+            BeanUtils.copyProperties(saveAdminDto, admin);
+            admin.setPassWord(encrypt);
+            admin.setStatus("1");
+            admin.setUsersId(users.getId()+"");
+            adminService.save(admin);
+            return CommonResult.ok();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+
+    }
+
     @Override
-    public CommonResult getListPage(int page, int size, String keyWord) {
-        if (ObjectUtils.isEmpty(page)&& page<=0) {
-            page=1;
+    public CommonResult update(UpdateAdminDto updateAdminDto) {
+        String permissionSettingId = updateAdminDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String accountManagement = permissionSetting.getAccountManagement();
+        if (!"0".equals(accountManagement) && !accountManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+
+//        通过cardNumber找到对应的用户
+        String cardNumber = updateAdminDto.getCardNumber();
+        LambdaQueryWrapper<Users> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(Users::getCardNumber,cardNumber);
+        Users users = usersService.getOne(wrapper);
+        if (ObjectUtils.isEmpty(users)) {
+            return CommonResult.fail("暂无该用户");
         }
 
-        if (ObjectUtils.isEmpty(size)&& size<=0) {
-            size=10;
+        Admin admin = updateAdminDto.getAdmin();
+        try {
+            String passWord = admin.getPassWord();
+            String encrypt = RSAUtils.encrypt(passWord, RSAUtils.getPublicKey(mySecurity.publicKey));
+            admin.setPassWord(encrypt);
+            admin.setUsersId(users.getId()+"");
+            boolean update = adminService.updateById(admin);
+            if (update) {
+                return CommonResult.ok();
+            }
+            return CommonResult.fail();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
         }
 
 
+    }
+
+    @Override
+    public CommonResult delete(int permissionSettingId, int id) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String accountManagement = permissionSetting.getAccountManagement();
+        if (!"0".equals(accountManagement) && !accountManagement.contains("3")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        boolean b = adminService.removeById(id);
+
+        if (b) {
+            return CommonResult.ok();
+        }
 
+        return CommonResult.fail();
 
-        return null;
     }
+
+    @Override
+    public CommonResult getUsersPage(int permissionSettingId, int page, int size, String keyWord) {
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String accountManagement = permissionSetting.getAccountManagement();
+        if (!"0".equals(accountManagement) && !accountManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        LambdaQueryWrapper<Users> wrapperU = new LambdaQueryWrapper<>();
+        wrapperU.like(ObjectUtils.isNotEmpty(keyWord), Users::getCardNumber, keyWord)
+                .or()
+                .like(ObjectUtils.isNotEmpty(keyWord), Users::getUserName, keyWord);
+
+        IPage<Users> page1 = usersService.page(new Page<>(page, size), wrapperU);
+
+        return CommonResult.ok(page1);
+    }
+
+
 }
 

+ 114 - 1
src/main/java/com/template/controller/AdminMenuController.java

@@ -10,12 +10,16 @@ import com.template.api.AdminMenuAPI;
 import com.template.model.dto.SaveParentDto;
 import com.template.model.dto.SaveParentUserDto;
 import com.template.model.dto.SaveSecondaryDto;
+import com.template.model.dto.UpdateMenuPermissionSettingDto;
+import com.template.model.pojo.Admin;
 import com.template.model.pojo.AdminMenu;
 import com.template.model.pojo.PermissionSetting;
 import com.template.model.pojo.UsersMenu;
 import com.template.model.result.CommonResult;
 import com.template.model.vo.AdminMenuTreeVo;
+import com.template.model.vo.AdminMenuVo;
 import com.template.services.AdminMenuService;
+import com.template.services.AdminService;
 import com.template.services.PermissionSettingService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +50,9 @@ public class AdminMenuController implements AdminMenuAPI {
     @Autowired
     PermissionSettingService permissionSettingService;
 
+    @Autowired
+    AdminService adminService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public CommonResult saveParent(SaveParentDto saveParentDto, BindingResult bindingResult) {
@@ -179,10 +186,116 @@ public class AdminMenuController implements AdminMenuAPI {
 
         IPage<AdminMenu> page1 = adminMenuService.page(new Page<>(page, size), wrapperAM);
 
+        List<AdminMenu> records = page1.getRecords();
+        ArrayList<AdminMenuVo> adminMenuVos = new ArrayList<>();
+        for (AdminMenu record : records) {
+            AdminMenuVo adminMenuVo = new AdminMenuVo();
+            BeanUtils.copyProperties(record,adminMenuVo);
+            Integer parentId = record.getParentId();
+            if (parentId!=0) {
+                Integer id = record.getParentId();
+                AdminMenu byId = adminMenuService.getById(id);
+                adminMenuVo.setParentName(byId.getName());
+            }
+            adminMenuVos.add(adminMenuVo);
+        }
+
+        Page<AdminMenuVo> adminMenuVoPage = new Page<>();
+        BeanUtils.copyProperties(page1,adminMenuVoPage);
+        adminMenuVoPage.setRecords(adminMenuVos);
+        return CommonResult.ok(adminMenuVoPage);
+    }
+
+    @Override
+    public CommonResult getMenuPermissionSetting(String adminMenuId,String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String roleManagement = permissionSetting.getRoleManagement();
+        if (!"0".equals(roleManagement) && !roleManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(adminMenuId)) {
+            return CommonResult.fail("参数异常");
+        }
+        PermissionSetting p=permissionSettingService.getMenuPermissionSetting(adminMenuId);
+
+        return CommonResult.ok(p);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult updateMenuPermissionSetting(UpdateMenuPermissionSettingDto updateMenuPermissionSetting) {
+        String permissionSettingId = updateMenuPermissionSetting.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String roleManagement = permissionSetting.getRoleManagement();
+        if (!"0".equals(roleManagement) && !roleManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        PermissionSetting permissionSetting1 = new PermissionSetting();
+        BeanUtils.copyProperties(updateMenuPermissionSetting,permissionSetting1);
+
+        AdminMenu adminMenu = adminMenuService.getById(permissionSetting1.getAdminMenuId());
+        adminMenu.setName(updateMenuPermissionSetting.getName());
+
+        try {
+            boolean update = permissionSettingService.updateById(permissionSetting1);
+            boolean update1 = adminMenuService.updateById(adminMenu);
+            if (update && update1) {
+                return CommonResult.ok();
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult delete(Integer adminMenuId, String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String roleManagement = permissionSetting.getRoleManagement();
+        if (!"0".equals(roleManagement) && !roleManagement.contains("3")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        AdminMenu adminMenu = adminMenuService.getById(adminMenuId);
+
+        Integer parentId = adminMenu.getParentId();
 
-        return CommonResult.ok(page1);
+        Integer id = adminMenu.getId();
+        List<Admin> adminList = adminService.getByAdminMenuId(id);
+        if (adminList.size()>0) {
+            return CommonResult.fail("该角色下还有用户");
+        }
+
+        if (parentId!=0) {
+            adminMenuService.removeById(adminMenuId);
+        }
+        //通过角色id找到对应的下级
+        List<AdminMenu> list = adminMenuService.getList(adminMenu.getId());
+
+        if (list.size()>0) {
+            return CommonResult.fail("子级未全部被删除");
+        }
+
+        adminMenuService.removeById(adminMenuId);
+        return CommonResult.ok();
     }
 
+
     /**
      * 根据父类ID获取树形菜单数据
      * @param parentID 父级ID

+ 21 - 0
src/main/java/com/template/controller/AlarmMessageController.java

@@ -0,0 +1,21 @@
+package com.template.controller;
+
+
+import com.template.api.AlarmMessageControllerAPI;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-19
+ */
+@RestController
+public class AlarmMessageController implements AlarmMessageControllerAPI {
+
+}
+

+ 133 - 0
src/main/java/com/template/controller/ApartmentSettingController.java

@@ -0,0 +1,133 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.sun.org.apache.bcel.internal.generic.NEW;
+import com.template.api.ApartmentSettingControllerAPI;
+import com.template.model.dto.ApartmentSettingDto;
+import com.template.model.pojo.ApartmentSetting;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.result.CommonResult;
+import com.template.model.vo.ApartmentSettingVo;
+import com.template.model.vo.CoverPictureVo;
+import com.template.services.ApartmentSettingService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@RestController
+public class ApartmentSettingController implements ApartmentSettingControllerAPI {
+
+    @Autowired
+    ApartmentSettingService apartmentSettingService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Override
+    public CommonResult updateOrSave(ApartmentSettingDto apartmentSettingDto) {
+        String permissionSettingId = apartmentSettingDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        ApartmentSetting apartmentSetting = new ApartmentSetting();
+
+        BeanUtils.copyProperties(apartmentSettingDto, apartmentSetting);
+
+        boolean update = apartmentSettingService.saveOrUpdate(apartmentSetting);
+
+        if (update) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+
+    }
+
+    @Override
+    public CommonResult list(String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        List<ApartmentSetting> list = apartmentSettingService.list(new LambdaQueryWrapper<>());
+        if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
+            ApartmentSetting apartmentSetting = list.get(0);
+            String coverPicture = apartmentSetting.getCoverPicture();
+            ApartmentSettingVo apartmentSettingVo = new ApartmentSettingVo();
+            BeanUtils.copyProperties(apartmentSetting,apartmentSettingVo);
+            if (ObjectUtils.isNotEmpty(coverPicture)) {
+                String[] split = coverPicture.split(",");
+                ArrayList<CoverPictureVo> coverPictureVos = new ArrayList<>();
+                for (int i = 0; i < split.length; i++) {
+                    CoverPictureVo coverPictureVo = new CoverPictureVo();
+                    coverPictureVo.setCount(i);
+                    coverPictureVo.setUrl(split[i]);
+                    coverPictureVos.add(coverPictureVo);
+                }
+                apartmentSettingVo.setCoverPicture(coverPictureVos);
+            }
+            return CommonResult.ok(apartmentSettingVo);
+        }
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult appletList() {
+        List<ApartmentSetting> list = apartmentSettingService.list(new LambdaQueryWrapper<>());
+        if (ObjectUtils.isNotEmpty(list) && list.size() > 0) {
+            ApartmentSetting apartmentSetting = list.get(0);
+            String coverPicture = apartmentSetting.getCoverPicture();
+            ApartmentSettingVo apartmentSettingVo = new ApartmentSettingVo();
+            BeanUtils.copyProperties(apartmentSetting,apartmentSettingVo);
+            if (ObjectUtils.isNotEmpty(coverPicture)) {
+                String[] split = coverPicture.split(",");
+                ArrayList<CoverPictureVo> coverPictureVos = new ArrayList<>();
+                for (int i = 0; i < split.length; i++) {
+                    CoverPictureVo coverPictureVo = new CoverPictureVo();
+                    coverPictureVo.setCount(i);
+                    coverPictureVo.setUrl(split[i]);
+                    coverPictureVos.add(coverPictureVo);
+                }
+                apartmentSettingVo.setCoverPicture(coverPictureVos);
+            }
+            return CommonResult.ok(apartmentSettingVo);
+        }
+
+        return CommonResult.ok(list);
+    }
+
+
+}
+

+ 174 - 0
src/main/java/com/template/controller/AppletLoginController.java

@@ -0,0 +1,174 @@
+package com.template.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.template.annotation.PassToken;
+import com.template.api.AppletLoginControllerAPI;
+import com.template.common.utils.AesUtils;
+import com.template.common.utils.HttpsClient;
+import com.template.common.utils.JWTUtil;
+import com.template.model.pojo.Admin;
+import com.template.model.pojo.AdminMenu;
+import com.template.model.pojo.Users;
+import com.template.model.result.CommonResult;
+import com.template.services.AdminMenuService;
+import com.template.services.AdminService;
+import com.template.services.UsersService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.client.RestTemplate;
+
+import java.awt.image.Kernel;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Controller
+public class AppletLoginController implements AppletLoginControllerAPI {
+
+    @Autowired
+    UsersService usersService;
+
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    AdminMenuService adminMenuService;
+
+
+    @Override
+    @PassToken
+    public String weixiaoAuth(String wxcode, String state) throws UnsupportedEncodingException {
+        //        先获取wxcode
+        log.info("wxcode参数=======>>>>wxcode: "+wxcode);
+        log.info("state参数=======>>>>state: "+state);
+
+        String tokenUrl = "https://open.wecard.qq.com/connect/oauth2/token";
+        Map<String, String> tokenParams = new HashMap<>();
+        tokenParams.put("wxcode", wxcode);
+        tokenParams.put("app_key", "4FD5599032819781");
+        tokenParams.put("app_secret", "0174DFB98063A612526C6B69F941E14A");
+        tokenParams.put("grant_type", "authorization_code");
+        tokenParams.put("redirect_uri", state); // 该地址需要与发起授权地址保持一直
+
+        try {
+            // wecode换取token
+            RestTemplate client = new RestTemplate();
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_JSON);
+            HttpEntity<Map<String, String>> request = new HttpEntity<>(tokenParams, headers);
+            //ResponseEntity<String> tokenResponse = client.postForEntity(tokenUrl, tokenParams, String.class);
+
+            ResponseEntity<String> tokenResponse = client.postForEntity(tokenUrl, request, String.class);
+
+            ObjectMapper mapper = new ObjectMapper();
+            Map<String, Object> jsonMap = mapper.readValue(tokenResponse.getBody(), new TypeReference<Map<String, Object>>() {
+            });
+            String accessToken = (String) jsonMap.get("access_token");
+
+            // token换取用户信息
+            String userInfoUrl = "https://open.wecard.qq.com/connect/oauth/get-user-info";
+            Map<String, String> userInfoParam = new HashMap<>();
+            userInfoParam.put("access_token", accessToken);
+            ResponseEntity<String> userInfoResponse = client.postForEntity(userInfoUrl, userInfoParam, String.class);
+
+            Map<String, Object> userInfoMap = mapper.readValue(userInfoResponse.getBody(), new TypeReference<Map<String, Object>>() {
+            });
+//
+//            身份证
+            String idCard = userInfoMap.get("id_card").toString();
+//            用户姓名
+            String name = userInfoMap.get("name").toString();
+            System.out.println("name = " + name);
+            String encodeName = URLEncoder.encode(name,"utf-8");
+            System.out.println("encodeName = " + encodeName);
+//            身份职称
+            String identityTitle = userInfoMap.get("identity_type").toString();
+//            用户电子卡号/学工号
+            String cardNumber = userInfoMap.get("card_number").toString();
+//           手机号
+            String telephone = userInfoMap.get("telephone").toString();
+            String headImage = userInfoMap.get("head_image").toString();
+
+//            判断账号是否以添加,
+            LambdaQueryWrapper<Users> wrapperU=new LambdaQueryWrapper<>();
+            wrapperU.eq(Users::getCardNumber,cardNumber);
+            Users users = usersService.getOne(wrapperU);
+
+            String token = JWTUtil.getUsersToken(cardNumber);
+            String adminId="";
+            String adminMenuId="";
+            String adminMenuName="";
+            String usersId="";
+
+            if (ObjectUtils.isNotEmpty(users)) {
+                 usersId = String.valueOf(users.getId());
+//                通过用户id找到管理端用户id和角色id
+                LambdaQueryWrapper<Admin> wrapperA=new LambdaQueryWrapper<>();
+                wrapperA.eq(Admin::getUsersId,usersId);
+                Admin admin = adminService.getOne(wrapperA);
+                // 通过用户找到管理端用户和管理端角色,有则返回,没有则不返回
+                if (ObjectUtils.isNotEmpty(admin)) {
+                    adminId = String.valueOf(admin.getId());
+                    adminMenuId = admin.getAdminMenuId();
+
+                    AdminMenu adminMenu = adminMenuService.getById(adminMenuId);
+
+                    if (ObjectUtils.isNotEmpty(adminMenu)) {
+                         adminMenuName = adminMenu.getName();
+                    }
+                }
+
+            }else {
+                Users users1 = new Users();
+                users1.setDepartment(identityTitle);
+                users1.setUserName(name);
+                users1.setIdCard(idCard);
+                users1.setCardNumber(cardNumber);
+                users1.setPhone(telephone);
+                users1.setHeadImage(headImage);
+                usersService.save(users1);
+                usersId=String.valueOf(users1.getId());
+            }
+            String user_head = AesUtils.encrypt(adminId);
+          //  System.out.println("重定向路径=" + "redirect:"+ "https://chtech.ncjti.edu.cn/hotel/h5/#/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head);
+           return "redirect:"+ "https://chtech.ncjti.edu.cn/hotel/h5/#/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head+"&name="+name+"&telephone="+telephone;
+           // return "redirect:"+ "http://192.168.161.225:8000/hotel/h5/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head+"&name="+encodeName+"&telephone="+telephone;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "redirect:" + "https://chtech.ncjti.edu.cn/hotel/h5/#/error/?errorMsg=" + URLEncoder.encode("获取用户信息失败", "utf-8");
+           //return "redirect:" + "http://192.168.161.225:8000/hotel/h5/#/error/?errorMsg=" + URLEncoder.encode("获取用户信息失败", "utf-8");
+        }
+    }
+
+    @Override
+    public CommonResult getOpenid(String code) throws Exception {
+        String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + "wxd87cbe1db0437303" + "&secret=" + "18e17f97e674e1c03fc255f12d12ca4d" + "&code=" + code + "&grant_type=authorization_code";
+
+
+        String s = HttpsClient.httpsRequestReturnString(url, "GET", "");
+
+        JSONObject jsonObject = JSONObject.parseObject(s);
+        return CommonResult.ok(jsonObject);
+//        System.out.println("jsonObject = " + jsonObject);
+//        if (!jsonObject.containsKey("openid")) {
+//            return CommonResult.fail("code有误");
+//        }
+//        String openid = jsonObject.getString("openid");
+//        System.out.println("openid = " + openid);
+//        return CommonResult.ok(jsonObject);
+    }
+
+
+}

+ 424 - 0
src/main/java/com/template/controller/ApplicationProcedureController.java

@@ -0,0 +1,424 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.sun.org.apache.bcel.internal.generic.NEW;
+import com.template.api.ApplicationProcedureControllerAPI;
+import com.template.model.dto.AppletApprovalProcessDto;
+import com.template.model.dto.ApplicationProcedureDto;
+import com.template.model.dto.ApprovalProcessDto;
+import com.template.model.pojo.*;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.ApplicationProcedureVo;
+import com.template.model.vo.HouseVo;
+import com.template.services.*;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-02-27
+ */
+@RestController
+public class ApplicationProcedureController implements ApplicationProcedureControllerAPI {
+
+    @Autowired
+    ApplicationProcedureService applicationProcedureService;
+
+    @Autowired
+    ApplicationProcedureSettingService applicationProcedureSettingService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    UsersService usersService;
+
+    @Autowired
+    AdminMenuService adminMenuService;
+
+
+    @Override
+    public CommonResult save(ApplicationProcedureDto applicationProcedureDto) {
+        if (ObjectUtils.isEmpty(applicationProcedureDto)) {
+            return CommonResult.fail();
+        }
+
+        ApplicationProcedure applicationProcedure = new ApplicationProcedure();
+
+        BeanUtils.copyProperties(applicationProcedureDto, applicationProcedure);
+
+//        待审核
+        applicationProcedure.setStatus("1");
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+//        提交时间
+        applicationProcedure.setSubmissionTime(LocalDateTime.now().format(dateTimeFormatter1));
+
+
+        boolean save = applicationProcedureService.save(applicationProcedure);
+
+        if (save) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult recordList(int usersId) {
+        if (ObjectUtils.isEmpty(usersId)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        LambdaQueryWrapper<ApplicationProcedure> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ApplicationProcedure::getUsersId, usersId);
+
+        List<ApplicationProcedure> list = applicationProcedureService.list(wrapper);
+
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult list( int adminMenuId, String submissionStartTime, String submissionEndTime, String examineAndApproveStartTime, String examineAndApproveEndTime, String type, String department, String key, int page, int size) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) || page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) || size <= 0) {
+            size = 10;
+        }
+
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        Integer adminMenuId1 = permissionSetting.getAdminMenuId();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId1);
+        Integer parentId = byId.getParentId();
+
+        PageUtils<ApplicationProcedureVo> pageList=null;
+        //审批一次,角色等级不为0
+        if ("1".equals(approverType)) {
+            if (parentId!=0) {
+                return CommonResult.ok("无审批权限");
+            }else {
+                pageList=applicationProcedureService.pageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+                return CommonResult.ok(pageList);
+            }
+
+        }
+
+        if (parentId==0) {
+            //            全部则是没有待审批的全部
+            if (ObjectUtils.isEmpty(type)) {
+                type="0,2,3";
+            }
+
+            pageList=applicationProcedureService.parentPageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+
+            return CommonResult.ok(pageList);
+        }
+
+
+        pageList=applicationProcedureService.pageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+
+        return CommonResult.ok(pageList);
+    }
+
+    @Override
+    public CommonResult update(ApprovalProcessDto approvalProcessDto) {
+        int adminMenuId = approvalProcessDto.getAdminMenuId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("3")&& !processManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int id = approvalProcessDto.getId();
+        String status = approvalProcessDto.getStatus();
+        String adminId = approvalProcessDto.getAdminId();
+        String remark = approvalProcessDto.getRemark();
+
+        ApplicationProcedure applicationProcedure = applicationProcedureService.getById(id);
+
+        if (ObjectUtils.isEmpty(applicationProcedure)) {
+            return CommonResult.fail("参数异常");
+        }
+        String applicationProcedureStatus = applicationProcedure.getStatus();
+        if ("0".equals(applicationProcedureStatus)||"3".equals(applicationProcedureStatus)) {
+            return CommonResult.fail("已审批,无需再次审批");
+        }
+
+
+//        判断是什么审核模式
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        //        审核人
+        Integer adminMenuId1 = permissionSetting.getAdminMenuId();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId1);
+//        角色等级
+        Integer parentId = byId.getParentId();
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+//      当只需要审核一次
+        if ("1".equals(approverType)) {
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+//        当为最高审批人
+        if (parentId==0) {
+//            先判断是否已经被审批了
+            if (!"1".equals(applicationProcedureStatus)) {
+//                当不是处理中时则无法审批
+                return CommonResult.fail("当前无法审批");
+            }
+
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+        if ("1".equals(status)) {
+            status="2";
+        }
+        applicationProcedure.setStatus(status);
+        applicationProcedure.setApproverId(adminId);
+        //        审批时间
+        applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+        applicationProcedure.setExamineAndApproveRemark(remark);
+        applicationProcedureService.updateById(applicationProcedure);
+
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult appletUpdate(AppletApprovalProcessDto appletApprovalProcessDto) {
+
+        int id = appletApprovalProcessDto.getId();
+        String status = appletApprovalProcessDto.getStatus();
+        String adminMenuId = appletApprovalProcessDto.getAdminMenuId();
+        String remark = appletApprovalProcessDto.getRemark();
+        String adminId = appletApprovalProcessDto.getAdminId();
+
+        //        判断对应的管理端是否有权限
+        if (ObjectUtils.isEmpty(adminMenuId)&&ObjectUtils.isEmpty(adminId)) {
+            return CommonResult.fail("无审批权限");
+        }
+        PermissionSetting permissionSetting = permissionSettingService.getMenuPermissionSetting(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("无审批权限");
+        }
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("3")&& !processManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        ApplicationProcedure applicationProcedure = applicationProcedureService.getById(id);
+
+        if (ObjectUtils.isEmpty(applicationProcedure)) {
+            return CommonResult.fail("参数异常");
+        }
+        String applicationProcedureStatus = applicationProcedure.getStatus();
+        if ("0".equals(applicationProcedureStatus)||"3".equals(applicationProcedureStatus)) {
+            return CommonResult.fail("已审批,无需再次审批");
+        }
+
+//        判断是什么审核模式
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId);
+//        角色等级
+        Integer parentId = byId.getParentId();
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+//      当只需要审核一次
+        if ("1".equals(approverType)) {
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+//        当为最高审批人
+        if (parentId==0) {
+            //            先判断是否已经被审批了
+            if (!"1".equals(applicationProcedureStatus)) {
+//                当不是处理中时则无法审批
+                return CommonResult.fail("当前无法审批");
+            }
+
+
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+        if ("1".equals(status)) {
+            status="2";
+        }
+        applicationProcedure.setStatus(status);
+        applicationProcedure.setApproverId(adminId);
+        //        审批时间
+        applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+        applicationProcedure.setExamineAndApproveRemark(remark);
+        applicationProcedureService.updateById(applicationProcedure);
+
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult appletList(int adminMenuId, String startTime, String endTime, String status, int page, int size) {
+        if (ObjectUtils.isEmpty(page) || page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) || size <= 0) {
+            size = 10;
+        }
+
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId);
+        Integer parentId = byId.getParentId();
+
+        IPage<ApplicationProcedure> pageList=null;
+        //审批一次,角色等级不为0
+        if ("1".equals(approverType)) {
+            if (parentId!=0) {
+                return CommonResult.ok("无审批权限");
+            }else {
+                LambdaQueryWrapper<ApplicationProcedure> wrapper=new LambdaQueryWrapper<>();
+                wrapper.eq(ObjectUtils.isNotEmpty(status),ApplicationProcedure::getStatus,status)
+                        .between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedure::getSubmissionTime,startTime,endTime);
+                pageList=applicationProcedureService.page(new Page<>(page,size),wrapper);
+                return CommonResult.ok(pageList);
+            }
+
+        }
+
+        if (parentId==0) {
+
+            LambdaQueryWrapper<ApplicationProcedure> wrapper=new LambdaQueryWrapper<>();
+//            全部则是没有待审批的全部
+            if (ObjectUtils.isEmpty(status)) {
+                ArrayList<String> strings = new ArrayList<>();
+                strings.add("0");
+                strings.add("2");
+                strings.add("3");
+                wrapper.in(ApplicationProcedure::getStatus,strings);
+            }else {
+                wrapper.eq(ApplicationProcedure::getStatus,status);
+            }
+
+            wrapper.between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedure::getSubmissionTime,startTime,endTime);
+            pageList=applicationProcedureService.page(new Page<>(page,size),wrapper);
+            return CommonResult.ok(pageList);
+
+        }
+        LambdaQueryWrapper<ApplicationProcedure> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(ObjectUtils.isNotEmpty(status),ApplicationProcedure::getStatus,status)
+                .between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedure::getSubmissionTime,startTime,endTime);
+        pageList=applicationProcedureService.page(new Page<>(page,size),wrapper);
+        return CommonResult.ok(pageList);
+
+    }
+
+    @Override
+    public CommonResult statusDropDown() {
+        ArrayList<String> list = new ArrayList<>();
+        list.add("0");
+        list.add("1");
+        list.add("2");
+        list.add("3");
+        return CommonResult.ok(list);
+    }
+
+
+
+}
+

+ 65 - 0
src/main/java/com/template/controller/ApplicationProcedureSettingController.java

@@ -0,0 +1,65 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.ApplicationProcedureSettingControllerApi;
+import com.template.model.dto.ApplicationProcedurSettingDto;
+import com.template.model.pojo.ApplicationProcedureSetting;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.result.CommonResult;
+import com.template.services.ApplicationProcedureSettingService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-02-28
+ */
+@RestController
+public class ApplicationProcedureSettingController implements ApplicationProcedureSettingControllerApi {
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    ApplicationProcedureSettingService applicationProcedureSettingService;
+
+    @Override
+    public CommonResult update(ApplicationProcedurSettingDto applicationProcedurSettingDto) {
+
+        if (ObjectUtils.isEmpty(applicationProcedurSettingDto)) {
+            return CommonResult.fail();
+        }
+
+        int adminMenuId = applicationProcedurSettingDto.getAdminMenuId();
+        PermissionSetting permissionSetting1 = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting1)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String processManagement = permissionSetting1.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("6")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int id = applicationProcedurSettingDto.getId();
+
+        String approverType = applicationProcedurSettingDto.getApproverType();
+
+        ApplicationProcedureSetting byId = applicationProcedureSettingService.getById(id);
+
+        byId.setApproverType(approverType);
+
+        applicationProcedureSettingService.updateById(byId);
+
+        return CommonResult.ok();
+    }
+}
+

+ 405 - 0
src/main/java/com/template/controller/ApplicationProcedureTemporaryController.java

@@ -0,0 +1,405 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.api.ApplicationProcedureSettingControllerApi;
+import com.template.api.ApplicationProcedureTemporaryControllerAPI;
+import com.template.model.dto.AppletApprovalProcessDto;
+import com.template.model.dto.ApplicationProcedureDto;
+import com.template.model.dto.ApplicationProcedureTemporaryDto;
+import com.template.model.dto.ApprovalProcessDto;
+import com.template.model.pojo.*;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.ApplicationProcedureTemporaryVo;
+import com.template.model.vo.ApplicationProcedureVo;
+import com.template.services.AdminMenuService;
+import com.template.services.ApplicationProcedureSettingService;
+import com.template.services.ApplicationProcedureTemporaryService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-05
+ */
+@RestController
+public class ApplicationProcedureTemporaryController implements ApplicationProcedureTemporaryControllerAPI {
+
+    @Autowired
+    ApplicationProcedureTemporaryService applicationProcedureTemporaryService;
+
+    @Autowired
+    ApplicationProcedureSettingService applicationProcedureSettingService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    AdminMenuService adminMenuService;
+
+    @Override
+    public CommonResult save(ApplicationProcedureTemporaryDto applicationProcedureDto) {
+        if (ObjectUtils.isEmpty(applicationProcedureDto)) {
+            return CommonResult.fail();
+        }
+
+        ApplicationProcedureTemporary applicationProcedure = new ApplicationProcedureTemporary();
+
+        BeanUtils.copyProperties(applicationProcedureDto, applicationProcedure);
+
+//        待审核
+        applicationProcedure.setStatus("1");
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+//        提交时间
+        applicationProcedure.setSubmissionTime(LocalDateTime.now().format(dateTimeFormatter1));
+
+
+        boolean save = applicationProcedureTemporaryService.save(applicationProcedure);
+
+        if (save) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult list( int adminMenuId, String submissionStartTime, String submissionEndTime, String examineAndApproveStartTime, String examineAndApproveEndTime, String type, String department, String key, int page, int size) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+
+        if (ObjectUtils.isEmpty(page) || page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) || size <= 0) {
+            size = 10;
+        }
+
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        Integer adminMenuId1 = permissionSetting.getAdminMenuId();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId1);
+        Integer parentId = byId.getParentId();
+
+        PageUtils<ApplicationProcedureTemporaryVo> pageList=null;
+        //审批一次,角色等级不为0
+        if ("1".equals(approverType)) {
+            if (parentId!=0) {
+                return CommonResult.ok("无审批权限");
+            }else {
+                pageList=applicationProcedureTemporaryService.pageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+                return CommonResult.ok(pageList);
+            }
+
+        }
+
+        if (parentId==0) {
+            //            全部则是没有待审批的全部
+            if (ObjectUtils.isEmpty(type)) {
+                type="0,2,3";
+            }
+
+            pageList=applicationProcedureTemporaryService.parentPageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+
+            return CommonResult.ok(pageList);
+        }
+
+        pageList=applicationProcedureTemporaryService.pageList(submissionStartTime,submissionEndTime,examineAndApproveStartTime,examineAndApproveEndTime,type,department,key,page,size);
+
+
+        return CommonResult.ok(pageList);
+
+
+    }
+
+    @Override
+    public CommonResult update(ApprovalProcessDto approvalProcessDto) {
+        int adminMenuId = approvalProcessDto.getAdminMenuId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        //      判断该用户是否拥有权限
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("3")&& !processManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int id = approvalProcessDto.getId();
+        String status = approvalProcessDto.getStatus();
+        String adminId = approvalProcessDto.getAdminId();
+        String remark = approvalProcessDto.getRemark();
+
+        ApplicationProcedureTemporary applicationProcedure = applicationProcedureTemporaryService.getById(id);
+
+        if (ObjectUtils.isEmpty(applicationProcedure)) {
+            return CommonResult.fail("参数异常");
+        }
+        String applicationProcedureStatus = applicationProcedure.getStatus();
+        if ("0".equals(applicationProcedureStatus)||"3".equals(applicationProcedureStatus)) {
+            return CommonResult.fail("已审批,无需再次审批");
+        }
+
+
+//        判断是什么审核模式
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        //        审核人
+        Integer adminMenuId1 = permissionSetting.getAdminMenuId();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId1);
+//        角色等级
+        Integer parentId = byId.getParentId();
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+//      当只需要审核一次
+        if ("1".equals(approverType)) {
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureTemporaryService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+//        当为最高审批人
+        if (parentId==0) {
+            //            先判断是否已经被审批了
+            if (!"1".equals(applicationProcedureStatus)) {
+//                当不是处理中时则无法审批
+                return CommonResult.fail("当前无法审批");
+            }
+
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureTemporaryService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+        if ("1".equals(status)) {
+            status="2";
+        }
+        applicationProcedure.setStatus(status);
+        applicationProcedure.setApproverId(adminId);
+        //        审批时间
+        applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+        applicationProcedure.setExamineAndApproveRemark(remark);
+        applicationProcedureTemporaryService.updateById(applicationProcedure);
+
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult appletUpdate(AppletApprovalProcessDto appletApprovalProcessDto) {
+        int id = appletApprovalProcessDto.getId();
+        String status = appletApprovalProcessDto.getStatus();
+        String adminMenuId = appletApprovalProcessDto.getAdminMenuId();
+        String remark = appletApprovalProcessDto.getRemark();
+        String adminId = appletApprovalProcessDto.getAdminId();
+
+//        判断对应的管理端是否有权限
+        if (ObjectUtils.isEmpty(adminMenuId)&&ObjectUtils.isEmpty(adminId)) {
+            return CommonResult.fail("无审批权限");
+        }
+        PermissionSetting permissionSetting = permissionSettingService.getMenuPermissionSetting(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("无审批权限");
+        }
+        String processManagement = permissionSetting.getProcessManagement();
+        if (!"0".equals(processManagement) && !processManagement.contains("3")&& !processManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+
+        ApplicationProcedureTemporary applicationProcedure = applicationProcedureTemporaryService.getById(id);
+
+        if (ObjectUtils.isEmpty(applicationProcedure)) {
+            return CommonResult.fail("参数异常");
+        }
+
+
+        String applicationProcedureStatus = applicationProcedure.getStatus();
+        if ("0".equals(applicationProcedureStatus)||"3".equals(applicationProcedureStatus)) {
+            return CommonResult.fail("已审批,无需再次审批");
+        }
+
+
+//        判断是什么审核模式
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId);
+//        角色等级
+        Integer parentId = byId.getParentId();
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+//      当只需要审核一次
+        if ("1".equals(approverType)) {
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureTemporaryService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+//        当为最高审批人
+        if (parentId==0) {
+            //            先判断是否已经被审批了
+            if (!"1".equals(applicationProcedureStatus)) {
+//                当不是处理中时则无法审批
+                return CommonResult.fail("当前无法审批");
+            }
+
+            if ("1".equals(status)) {
+                status="3";
+            }
+            applicationProcedure.setStatus(status);
+            applicationProcedure.setApproverId(adminId);
+            //        审批时间
+            applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+            applicationProcedure.setExamineAndApproveRemark(remark);
+            applicationProcedureTemporaryService.updateById(applicationProcedure);
+            return CommonResult.ok();
+        }
+
+        if ("1".equals(status)) {
+            status="2";
+        }
+        applicationProcedure.setStatus(status);
+        applicationProcedure.setApproverId(adminId);
+        //        审批时间
+        applicationProcedure.setExamineAndApproveTime(LocalDateTime.now().format(dateTimeFormatter1));
+//            审批备注
+        applicationProcedure.setExamineAndApproveRemark(remark);
+        applicationProcedureTemporaryService.updateById(applicationProcedure);
+
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult appletList(int adminMenuId,String startTime, String endTime, String status,int page, int size) {
+        if (ObjectUtils.isEmpty(page) || page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) || size <= 0) {
+            size = 10;
+        }
+
+        List<ApplicationProcedureSetting> list = applicationProcedureSettingService.list(new LambdaQueryWrapper<>());
+        ApplicationProcedureSetting applicationProcedureSetting = list.get(0);
+        String approverType = applicationProcedureSetting.getApproverType();
+
+        AdminMenu byId = adminMenuService.getById(adminMenuId);
+        Integer parentId = byId.getParentId();
+
+        IPage<ApplicationProcedureTemporary> pageList=null;
+        //审批一次,角色等级不为0
+        if ("1".equals(approverType)) {
+            if (parentId!=0) {
+                return CommonResult.ok("无审批权限");
+            }else {
+                LambdaQueryWrapper<ApplicationProcedureTemporary> wrapper=new LambdaQueryWrapper<>();
+                wrapper.eq(ObjectUtils.isNotEmpty(status),ApplicationProcedureTemporary::getStatus,status)
+                        .between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedureTemporary::getSubmissionTime,startTime,endTime);
+                pageList=applicationProcedureTemporaryService.page(new Page<>(page,size),wrapper);
+                return CommonResult.ok(pageList);
+            }
+
+        }
+
+        if (parentId==0) {
+
+            LambdaQueryWrapper<ApplicationProcedureTemporary> wrapper=new LambdaQueryWrapper<>();
+//            全部则是没有待审批的全部
+            if (ObjectUtils.isEmpty(status)) {
+                ArrayList<String> strings = new ArrayList<>();
+                strings.add("0");
+                strings.add("2");
+                strings.add("3");
+                wrapper.in(ApplicationProcedureTemporary::getStatus,strings);
+            }else {
+                wrapper.eq(ApplicationProcedureTemporary::getStatus,status);
+            }
+
+            wrapper.between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedureTemporary::getSubmissionTime,startTime,endTime);
+            pageList=applicationProcedureTemporaryService.page(new Page<>(page,size),wrapper);
+            return CommonResult.ok(pageList);
+
+        }
+        LambdaQueryWrapper<ApplicationProcedureTemporary> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(ObjectUtils.isNotEmpty(status),ApplicationProcedureTemporary::getStatus,status)
+                .between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),ApplicationProcedureTemporary::getSubmissionTime,startTime,endTime);
+        pageList=applicationProcedureTemporaryService.page(new Page<>(page,size),wrapper);
+        return CommonResult.ok(pageList);
+
+
+    }
+
+
+}
+

+ 93 - 0
src/main/java/com/template/controller/CallSystemController.java

@@ -0,0 +1,93 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.CallSystemControllerAPI;
+import com.template.model.dto.CallSystemSaveOrUpdateDto;
+import com.template.model.pojo.CallSystem;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.SubsidySetup;
+import com.template.model.result.CommonResult;
+import com.template.services.CallSystemService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-28
+ */
+@RestController
+public class CallSystemController implements CallSystemControllerAPI {
+
+    @Autowired
+    CallSystemService callSystemService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Override
+    public CommonResult list(String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        List<CallSystem> list = callSystemService.list(new LambdaQueryWrapper<>());
+        if (ObjectUtils.isEmpty(list) && list.size() > 0) {
+            CallSystem callSystem = list.get(0);
+            return CommonResult.ok(callSystem);
+        }
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult saveOrUpdate(CallSystemSaveOrUpdateDto callSystemSaveOrUpdateDto) {
+        String permissionSettingId = callSystemSaveOrUpdateDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+        int id = callSystemSaveOrUpdateDto.getId();
+        CallSystem callSystem;
+        boolean update= false;
+        if (ObjectUtils.isNotEmpty(id)) {
+            callSystem = callSystemService.getById(id);
+            callSystem.setAskForPayment(callSystemSaveOrUpdateDto.getAskForPayment());
+            update = callSystemService.updateById(callSystem);
+        }else {
+            callSystem =new CallSystem();
+            callSystem.setAskForPayment(callSystemSaveOrUpdateDto.getAskForPayment());
+            update=callSystemService.save(callSystem);
+        }
+
+        if (update) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+
+    }
+}
+

+ 88 - 0
src/main/java/com/template/controller/CheckOutSettingController.java

@@ -0,0 +1,88 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.CheckOutSettingControllerAPI;
+import com.template.model.dto.CheckOutSettingSaveOrUpdateDto;
+import com.template.model.pojo.CheckOutSetting;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.result.CommonResult;
+import com.template.services.CheckOutSettingService;
+import com.template.services.PermissionSettingService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@RestController
+public class CheckOutSettingController implements CheckOutSettingControllerAPI {
+
+    @Autowired
+    CheckOutSettingService checkOutSettingService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+
+    @Override
+    public CommonResult list(String permissionSettingId) {
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        List<CheckOutSetting> list = checkOutSettingService.list(new LambdaQueryWrapper<>());
+        if (ObjectUtils.isEmpty(list) && list.size() > 0) {
+            CheckOutSetting checkOutSetting = list.get(0);
+            return CommonResult.ok(checkOutSetting);
+        }
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult saveOrUpdate(CheckOutSettingSaveOrUpdateDto checkOutSettingSaveOrUpdateDto) {
+        String permissionSettingId = checkOutSettingSaveOrUpdateDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        CheckOutSetting checkOutSetting = new CheckOutSetting();
+        BeanUtils.copyProperties(checkOutSettingSaveOrUpdateDto,checkOutSetting);
+
+        boolean update = checkOutSettingService.saveOrUpdate(checkOutSetting);
+
+        if (update) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+}
+

+ 21 - 0
src/main/java/com/template/controller/ElectricEquipmentController.java

@@ -0,0 +1,21 @@
+package com.template.controller;
+
+
+import com.template.api.ElectricEquipmentControllerAPI;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-01
+ */
+@RestController
+public class ElectricEquipmentController implements ElectricEquipmentControllerAPI {
+
+}
+

+ 145 - 0
src/main/java/com/template/controller/FacilityServicesController.java

@@ -0,0 +1,145 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.FacilityServicesControllerAPI;
+import com.template.model.dto.FacilityServicesSaveDto;
+import com.template.model.dto.FacilityServicesUpdateDto;
+import com.template.model.pojo.FacilityServices;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.result.CommonResult;
+import com.template.services.FacilityServicesService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@RestController
+public class FacilityServicesController implements FacilityServicesControllerAPI {
+
+    @Autowired
+    FacilityServicesService facilityServicesService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Override
+    public CommonResult save(FacilityServicesSaveDto facilityServicesSaveDto) {
+        String permissionSettingId = facilityServicesSaveDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        FacilityServices facilityServices = new FacilityServices();
+        facilityServices.setIconPath(facilityServicesSaveDto.getIconPath());
+        facilityServices.setHouseService(facilityServicesSaveDto.getHouseService());
+
+        boolean save = facilityServicesService.save(facilityServices);
+
+        if (save) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+
+
+    @Override
+    public CommonResult list(String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        List<FacilityServices> list = facilityServicesService.list(new LambdaQueryWrapper<>());
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult update(FacilityServicesUpdateDto facilityServicesUpdateDto) {
+        String permissionSettingId = facilityServicesUpdateDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        FacilityServices facilityServices = new FacilityServices();
+        facilityServices.setIconPath(facilityServicesUpdateDto.getIconPath());
+        facilityServices.setHouseService(facilityServicesUpdateDto.getHouseService());
+        facilityServices.setId(facilityServicesUpdateDto.getId());
+
+        boolean update = facilityServicesService.updateById(facilityServices);
+
+        if (update) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+
+    @Override
+    public CommonResult delete(String permissionSettingId, int id) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("5")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(id)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        boolean b = facilityServicesService.removeById(id);
+
+        if (b) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+
+    }
+
+    @Override
+    public CommonResult appletList() {
+        List<FacilityServices> list = facilityServicesService.list(new LambdaQueryWrapper<>());
+
+        return CommonResult.ok(list);
+    }
+
+
+}
+

+ 166 - 14
src/main/java/com/template/controller/HouseController.java

@@ -1,27 +1,31 @@
 package com.template.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.annotation.Encrypt;
 import com.template.api.HouseAPI;
+import com.template.common.utils.DateUtil;
+import com.template.mapper.HouseMapper;
 import com.template.model.dto.HouseDto;
-import com.template.model.pojo.House;
-import com.template.model.pojo.HouseNumber;
-import com.template.model.pojo.HouseNumberState;
-import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.*;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
-import com.template.model.vo.HouseVo;
-import com.template.model.vo.HousedetailsVo;
-import com.template.services.HouseNumberService;
-import com.template.services.HouseNumberStateService;
-import com.template.services.HouseService;
-import com.template.services.PermissionSettingService;
+import com.template.model.vo.*;
+import com.template.services.*;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -49,6 +53,10 @@ public class HouseController implements HouseAPI {
     @Autowired
     PermissionSettingService permissionSettingService;
 
+    @Autowired
+    HousePriceService housePriceService;
+
+
     @Override
     @Encrypt
     @Transactional(rollbackFor = Exception.class)
@@ -110,8 +118,6 @@ public class HouseController implements HouseAPI {
                 houseNumber.setHouseId(house.getId() + "");
 //                默认净房
                 houseNumber.setHouseStatus(1);
-////               默认空闲
-//                houseNumber.setStatus(1);
 //                默认关电
                 houseNumber.setElectricType("2");
 
@@ -294,17 +300,163 @@ public class HouseController implements HouseAPI {
             }
         }
         try {
-            houseNumberService.removeByIds(list);
-            houseService.removeById(houseId);
+            for (HouseNumber houseNumber : list) {
+                Integer id = houseNumber.getId();
+                houseNumberService.removeById(id);
+            }
+            houseService.removeById(Integer.valueOf(houseId));
 
             return CommonResult.ok();
         } catch (Exception e) {
+            e.printStackTrace();
             return CommonResult.fail();
         }
 
 
     }
 
+    @Override
+    public CommonResult roomNameType() {
+        List<String> roomNameList = houseService.group();
+
+
+        return CommonResult.ok(roomNameList);
+    }
+
+    public static void main(String[] args) {
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59);
+        System.out.println("start = " + start);
+        System.out.println("end = " + end);
+    }
+
+    @Override
+    public CommonResult getAppletPage(int page, int size, int type, String startTime, String endTime) {
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+        if (ObjectUtils.isEmpty(startTime) && ObjectUtils.isEmpty(endTime)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        LambdaQueryWrapper<House> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(House::getRoomType, type);
+        IPage<House> page1 = houseService.page(new Page<>(page, size), wrapper);
+
+        List<House> records = page1.getRecords();
+
+        String houseIds = "";
+        for (int i = 0; i < records.size(); i++) {
+            String id = String.valueOf(records.get(i).getId());
+            if (i == 0) {
+                houseIds = houseIds + id;
+            } else {
+                houseIds = houseIds + "," + id;
+            }
+        }
+
+//        获取今天的所有的改价记录
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59);
+
+        List<HousePrice> housePrices = housePriceService.housePrice(start, end, houseIds);
+
+        ArrayList<HouseAppletPageVo> houseAppletPageVos = new ArrayList<>();
+        for (House record : records) {
+            HouseAppletPageVo houseAppletPageVo = new HouseAppletPageVo();
+
+            BeanUtils.copyProperties(record, houseAppletPageVo);
+
+            String id = String.valueOf(record.getId());
+
+            //                判断这个时间内是否有
+            for (HousePrice housePrice : housePrices) {
+                if (housePrice.getHouseId().equals(id)) {
+                    String setDate = housePrice.getSetDate();
+                    String[] split = setDate.split(",");
+                    Date startDate = DateUtil.parseDateOnly(split[0]);
+                    Date endDate = DateUtil.parseDateOnly(split[1]);
+
+                    //      判断当前时间是否在[startTime, endTime]区间
+                    assert startDate != null;
+                    boolean effectiveDate = DateUtil.isEffectiveDate(new Date(), startDate, endDate);
+                    if (effectiveDate) {
+                        BigDecimal price = housePrice.getPrice();
+                        houseAppletPageVo.setRoomPrice(price);
+                    }
+                }
+            }
+
+//            判断该房型是否还有房间
+            LambdaQueryWrapper<HouseNumber> wrapperHN = new LambdaQueryWrapper<>();
+            wrapperHN.eq(HouseNumber::getHouseId, id);
+            List<HouseNumber> houseNumberList = houseNumberService.list(wrapperHN);
+
+            //      获取当前房型的所有id
+            String houseNumberIds = "";
+            for (int i = 0; i < houseNumberList.size(); i++) {
+                String houseNumber = houseNumberList.get(i).getId() + "";
+                if (i == 0) {
+                    houseNumberIds = houseNumberIds + houseNumber;
+                } else {
+                    houseNumberIds = houseNumberIds + "," + houseNumber;
+                }
+            }
+
+
+            LocalDateTime localDateTime = LocalDateTime.parse(startTime, dateTimeFormatter1);
+            LocalDateTime endLocalDateTime = LocalDateTime.parse(endTime, dateTimeFormatter1);
+            List<HouseNumberState> houseNumberStates = houseNumberStateService.houseNumberStateList(localDateTime, endLocalDateTime, houseNumberIds);
+
+            wrapperHN.eq(HouseNumber::getHouseStatus,2);
+            List<HouseNumber> list = houseNumberService.list(wrapperHN);
+
+            if (houseNumberList.size()-houseNumberStates.size()-list.size()>0) {
+                houseAppletPageVo.setHouseStatus("1");
+
+                houseAppletPageVo.setSurplusCount(houseNumberList.size()-houseNumberStates.size()-list.size());
+
+            }else {
+                houseAppletPageVo.setHouseStatus("2");
+                houseAppletPageVo.setSurplusCount(0);
+            }
+
+            houseAppletPageVos.add(houseAppletPageVo);
+        }
+
+        IPage<HouseAppletPageVo> houseAppletPageVoPage = new Page<>();
+
+        BeanUtils.copyProperties(page1, houseAppletPageVoPage);
+
+        houseAppletPageVoPage.setRecords(houseAppletPageVos);
+
+
+        return CommonResult.ok(houseAppletPageVoPage);
+    }
+
+    @Override
+    public CommonResult getappletParticulars(Integer houseId) {
+        if (ObjectUtils.isEmpty(houseId)) {
+            return CommonResult.fail("参数异常");
+        }
+        House house = houseService.getById(houseId);
+        if (ObjectUtils.isEmpty(house)) {
+            return CommonResult.fail("参数异常");
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("housePicture",house.getHousePicture());
+        jsonObject.put("introductory",house.getIntroductory());
+        return CommonResult.ok(jsonObject);
+    }
+
 
 }
 

+ 326 - 3
src/main/java/com/template/controller/HouseLockController.java

@@ -1,21 +1,344 @@
 package com.template.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.HouseLockControllerAPI;
+import com.template.model.dto.BingingDto;
+import com.template.model.dto.KeyFingerprintDto;
+import com.template.model.dto.RemoteUnlocking;
+import com.template.model.pojo.*;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.CalendarPageVo;
+import com.template.model.vo.UnlockingKeyVo;
+import com.template.model.vo.houseLockListVo;
+import com.template.services.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author ceshi
  * @since 2023-11-21
  */
 @RestController
-@RequestMapping("/auto/house-lock")
-public class HouseLockController {
+public class HouseLockController implements HouseLockControllerAPI {
+
+    @Autowired
+    HouseLockService houseLockService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    HouseService houseService;
+
+    @Autowired
+    HouseNumberService houseNumberService;
+
+    @Autowired
+    PasswordIssController passwordIssController;
+
+    @Autowired
+    UnlockingService unlockingService;
+
+    @Autowired
+    UnlockingAdminService unlockingAdminService;
+
+    @Autowired
+    UnlockingRecordService unlockingRecordService;
+
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    OperatingRecordService operatingRecordService;
+
+    @Override
+    public CommonResult list(String permissionSettingId, String roomNumber, String roomName, int page, int size) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+        LambdaQueryWrapper<House> hWrapper = new LambdaQueryWrapper<>();
+        hWrapper.eq(ObjectUtils.isNotEmpty(roomName), House::getRoomName, roomName);
+
+        List<House> list = houseService.list(hWrapper);
+        String houseIds = "";
+        for (int i = 0; i < list.size(); i++) {
+            House house = list.get(i);
+            Integer id = house.getId();
+            String s = String.valueOf(id);
+            if (i == 0) {
+                houseIds = s;
+            } else {
+                houseIds = houseIds + "," + s;
+            }
+        }
+
+
+        PageUtils<houseLockListVo> houseLockPage = houseNumberService.houseLockPage(roomNumber, houseIds, page, size);
+
+
+        return CommonResult.ok(houseLockPage);
+    }
+
+    @Override
+    public CommonResult particular(String permissionSettingId, String equipmentType) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(equipmentType)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        JSONObject particular = passwordIssController.particular(equipmentType);
+
+
+        return CommonResult.ok(particular);
+
+    }
+
+    @Override
+    public CommonResult key(String permissionSettingId, String houseNumberId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("11")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(houseNumberId)) {
+            return CommonResult.fail("参数异常");
+        }
+
+
+        List<UnlockingKeyVo> unlockingKeyDtos = unlockingService.key(houseNumberId);
+
+        List<UnlockingAdmin> unlockingAdmins = unlockingAdminService.key(houseNumberId);
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("order", unlockingKeyDtos);
+        map.put("system", unlockingAdmins);
+
+
+        return CommonResult.ok(map);
+    }
+
+    @Override
+    public CommonResult remoteUnlocking(RemoteUnlocking remoteUnlockingDto) {
+        String permissionSettingId = remoteUnlockingDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("13")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        String luid = remoteUnlockingDto.getLuid();
+
+        try {
+
+            passwordIssController.remoteUnlocking(luid);
+
+            UnlockingRecord unlockingRecord = new UnlockingRecord();
+            unlockingRecord.setRoomNumber(remoteUnlockingDto.getRoomNumber());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            unlockingRecord.setDateTime(LocalDateTime.now().format(dateTimeFormatter1));
+            unlockingRecord.setUnlockType("远程开锁");
+
+            unlockingRecordService.save(unlockingRecord);
+            return CommonResult.ok();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult unbind(String permissionSettingId, String houseNumberId, String adminId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("14")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(houseNumberId) || ObjectUtils.isEmpty(adminId)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+
+        Admin admin = adminService.getById(adminId);
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+
+
+        try {
+
+            LambdaQueryWrapper<HouseLock> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(HouseLock::getHouseNumberId, houseNumberId);
+
+            HouseLock houseLock = houseLockService.getOne(wrapper);
+            if (ObjectUtils.isEmpty(houseLock)) {
+                return CommonResult.fail("该门锁不存在");
+            }
+
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setType("解绑设备");
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("解绑设备:" + houseLock.getEquipmentType());
+
+            houseLockService.remove(wrapper);
+            operatingRecordService.save(operatingRecord);
+            return CommonResult.ok();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return CommonResult.fail();
+        }
+
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult binding(BingingDto bingingDto) {
+        String permissionSettingId = bingingDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("14")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        String houseNumberId = bingingDto.getHouseNumberId();
+        String adminId = bingingDto.getAdminId();
+        if (ObjectUtils.isEmpty(houseNumberId) || ObjectUtils.isEmpty(adminId) || ObjectUtils.isEmpty(bingingDto.getLuid())) {
+            return CommonResult.fail("参数异常");
+        }
+
+        HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+
+        Admin admin = adminService.getById(adminId);
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+
+        try {
+//            判断该房间是否已绑定
+            LambdaQueryWrapper<HouseLock> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(HouseLock::getHouseNumberId, houseNumberId);
+
+            HouseLock houseLockOld = houseLockService.getOne(wrapper);
+            if (ObjectUtils.isNotEmpty(houseLockOld)) {
+                return CommonResult.fail("该房间已绑定,请解绑后在绑定");
+            }
+
+
+//            绑定设备
+            HouseLock houseLock = new HouseLock();
+//            设备型号
+            houseLock.setEquipmentType(bingingDto.getLuid());
+            JSONObject jsonObject = passwordIssController.particular(bingingDto.getLuid());
+//            电量
+            String battery = jsonObject.getString("battery");
+            houseLock.setElectricQuantity(battery);
+//            绑定时间
+            houseLock.setBindingTime(new Date());
+            String state = jsonObject.getString("state");
+//            网络状态
+            houseLock.setNetworkState(state);
+//            设备状态
+            houseLock.setEquipmentState(state);
+//            房 间号
+            houseLock.setHouseNumberId(Integer.valueOf(houseNumberId));
+            houseLock.setNetworkType("WiFi");
+            houseLock.setWifiMac("WIFIMAC");
+
+//            操作记录
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setType("绑定设备");
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("绑定设备:" + bingingDto.getLuid());
+
+            houseLockService.save(houseLock);
+            operatingRecordService.save(operatingRecord);
+
+            return CommonResult.ok();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return CommonResult.fail();
+    }
+
 
 }
 

+ 269 - 2
src/main/java/com/template/controller/HouseNumberController.java

@@ -1,10 +1,29 @@
 package com.template.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.api.HouseNumberControllerAPI;
+import com.template.model.dto.HouseNumberBindingDto;
+import com.template.model.dto.HouseNumberDeleteBindingDto;
+import com.template.model.pojo.ElectricEquipment;
+import com.template.model.pojo.HouseNumber;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.WaterEquipment;
+import com.template.model.result.CommonResult;
+import com.template.services.ElectricEquipmentService;
+import com.template.services.HouseNumberService;
+import com.template.services.PermissionSettingService;
+import com.template.services.WaterEquipmentService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * <p>
  *  前端控制器
@@ -14,8 +33,256 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2023-11-09
  */
 @RestController
-@RequestMapping("/auto/house-number")
-public class HouseNumberController {
+public class HouseNumberController implements HouseNumberControllerAPI {
+
+    @Autowired
+    HouseNumberService houseNumberService;
+
+    @Autowired
+    ElectricEquipmentService electricEquipmentService;
+
+    @Autowired
+    WaterEquipmentService waterEquipmentService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Override
+    public CommonResult pullDownList(String permissionSettingId, int page, int size, String keyWord) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String hydropowerManagement = permissionSetting.getHydropowerManagement();
+        if (!"0".equals(hydropowerManagement) && !hydropowerManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+        LambdaQueryWrapper<HouseNumber> wrapper=new LambdaQueryWrapper<>();
+        wrapper.like(ObjectUtils.isNotEmpty(keyWord),HouseNumber::getRoomNumber,keyWord)
+                .orderByDesc(HouseNumber::getRoomNumber);
+        IPage<HouseNumber> page1 = houseNumberService.page(new Page<>(page, size), wrapper);
+
+        return CommonResult.ok(page1);
+    }
+
+    @Override
+    public CommonResult binding(HouseNumberBindingDto houseNumberBindingDto) {
+        String permissionSettingId = houseNumberBindingDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String hydropowerManagement = permissionSetting.getHydropowerManagement();
+        if (!"0".equals(hydropowerManagement) && !hydropowerManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int houseNumberId = houseNumberBindingDto.getHouseNumberId();
+
+        String meterNameElectric = houseNumberBindingDto.getMeterNameElectric();
+
+        HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+
+        LambdaQueryWrapper<ElectricEquipment> wrapperEE=new LambdaQueryWrapper<>();
+        wrapperEE.eq(ElectricEquipment::getMeterName,meterNameElectric);
+        ElectricEquipment electricEquipment = electricEquipmentService.getOne(wrapperEE);
+
+        if (ObjectUtils.isEmpty(electricEquipment)) {
+            return CommonResult.fail("该电表设备不存在");
+        }
+
+        String meterNameWater = houseNumberBindingDto.getMeterNameWater();
+        LambdaQueryWrapper<WaterEquipment> wrapperWE=new LambdaQueryWrapper<>();
+        wrapperWE.eq(WaterEquipment::getMeterName,meterNameWater);
+        WaterEquipment waterEquipment = waterEquipmentService.getOne(wrapperWE);
+        if (ObjectUtils.isEmpty(waterEquipment)) {
+            return CommonResult.fail("该水表设备不存在");
+        }
+
+
+//        判断电表设备id是否已经被绑定了
+        LambdaQueryWrapper<HouseNumber> wrarpperHN=new LambdaQueryWrapper<>();
+        Integer electricEquipmentId = electricEquipment.getId();
+        wrarpperHN.eq(HouseNumber::getElectricEquipmentId,electricEquipmentId);
+        List<HouseNumber> list = houseNumberService.list(wrarpperHN);
+        if (ObjectUtils.isNotEmpty(list)) {
+            return CommonResult.fail("该电表设备已经被绑定");
+        }
+
+//        绑定电表
+        houseNumber.setElectricEquipmentId(electricEquipmentId+"");
+        houseNumber.setElectricEquipmentMeterName(meterNameElectric);
+//        判断水表设备id是否已经被绑定了
+        LambdaQueryWrapper<HouseNumber> wrarpperHN2=new LambdaQueryWrapper<>();
+        Integer waterEquipmentId = waterEquipment.getId();
+        wrarpperHN2.eq(HouseNumber::getWaterEquipmentId,waterEquipmentId);
+        List<HouseNumber> list2 = houseNumberService.list(wrarpperHN2);
+        if (ObjectUtils.isNotEmpty(list2)) {
+            return CommonResult.fail("该水表设备已经被绑定");
+        }
+//        绑定水表
+        houseNumber.setWaterEquipmentId(electricEquipmentId+"");
+        houseNumber.setWaterEquipmentMeterName(meterNameWater);
+
+        houseNumberService.updateById(houseNumber);
+
+        return CommonResult.ok();
+
+    }
+
+    @Override
+    public CommonResult list(String permissionSettingId, int page, int size, String keyWord,String startTime,String endTime) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String hydropowerManagement = permissionSetting.getHydropowerManagement();
+        if (!"0".equals(hydropowerManagement) && !hydropowerManagement.contains("4")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+
+        LambdaQueryWrapper<HouseNumber> wrapper=new LambdaQueryWrapper<>();
+        wrapper.like(ObjectUtils.isNotEmpty(keyWord),HouseNumber::getRoomNumber,keyWord)
+                .or()
+                .like(ObjectUtils.isNotEmpty(keyWord),HouseNumber::getElectricEquipmentMeterName,keyWord)
+                .or()
+                .like(ObjectUtils.isNotEmpty(keyWord),HouseNumber::getWaterEquipmentMeterName,keyWord)
+        ;
+        wrapper.between(ObjectUtils.isNotEmpty(startTime)&&ObjectUtils.isNotEmpty(endTime),HouseNumber::getCreateTime,startTime,endTime);
+        wrapper.orderByDesc(HouseNumber::getRoomNumber);
+
+        IPage<HouseNumber> page1 = houseNumberService.page(new Page<>(page, size), wrapper);
+
+        return CommonResult.ok(page1);
+    }
+
+    @Override
+    public CommonResult update(HouseNumberBindingDto houseNumberBindingDto) {
+        String permissionSettingId = houseNumberBindingDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String hydropowerManagement = permissionSetting.getHydropowerManagement();
+        if (!"0".equals(hydropowerManagement) && !hydropowerManagement.contains("2")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int houseNumberId = houseNumberBindingDto.getHouseNumberId();
+
+        String meterNameElectric = houseNumberBindingDto.getMeterNameElectric();
+
+        HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+
+        LambdaQueryWrapper<ElectricEquipment> wrapperEE=new LambdaQueryWrapper<>();
+        wrapperEE.eq(ElectricEquipment::getMeterName,meterNameElectric);
+        ElectricEquipment electricEquipment = electricEquipmentService.getOne(wrapperEE);
+
+        if (ObjectUtils.isEmpty(electricEquipment)) {
+            return CommonResult.fail("该电表设备不存在");
+        }
+
+        String meterNameWater = houseNumberBindingDto.getMeterNameWater();
+        LambdaQueryWrapper<WaterEquipment> wrapperWE=new LambdaQueryWrapper<>();
+        wrapperWE.eq(WaterEquipment::getMeterName,meterNameWater);
+        WaterEquipment waterEquipment = waterEquipmentService.getOne(wrapperWE);
+        if (ObjectUtils.isEmpty(waterEquipment)) {
+            return CommonResult.fail("该水表设备不存在");
+        }
+
+
+//        判断电表设备id是否已经被绑定了
+        LambdaQueryWrapper<HouseNumber> wrarpperHN=new LambdaQueryWrapper<>();
+        Integer electricEquipmentId = electricEquipment.getId();
+        wrarpperHN.eq(HouseNumber::getElectricEquipmentId,electricEquipmentId);
+        List<HouseNumber> list = houseNumberService.list(wrarpperHN);
+        if (ObjectUtils.isNotEmpty(list)) {
+            return CommonResult.fail("该电表设备已经被绑定");
+        }
+
+//        绑定电表
+        houseNumber.setElectricEquipmentId(electricEquipmentId+"");
+        houseNumber.setElectricEquipmentMeterName(meterNameElectric);
+//        判断水表设备id是否已经被绑定了
+        LambdaQueryWrapper<HouseNumber> wrarpperHN2=new LambdaQueryWrapper<>();
+        Integer waterEquipmentId = waterEquipment.getId();
+        wrarpperHN2.eq(HouseNumber::getWaterEquipmentId,waterEquipmentId);
+        List<HouseNumber> list2 = houseNumberService.list(wrarpperHN2);
+        if (ObjectUtils.isNotEmpty(list2)) {
+            return CommonResult.fail("该水表设备已经被绑定");
+        }
+//        绑定水表
+        houseNumber.setWaterEquipmentId(electricEquipmentId+"");
+        houseNumber.setWaterEquipmentMeterName(meterNameWater);
+
+        houseNumberService.updateById(houseNumber);
+
+        return CommonResult.ok();
+    }
+
+    @Override
+    public CommonResult delete(HouseNumberDeleteBindingDto houseNumberDeleteBindingDto) {
+        String permissionSettingId = houseNumberDeleteBindingDto.getPermissionSettingId();
+
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String hydropowerManagement = permissionSetting.getHydropowerManagement();
+        if (!"0".equals(hydropowerManagement) && !hydropowerManagement.contains("3")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        int houseNumberId = houseNumberDeleteBindingDto.getHouseNumberId();
+
+        HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+
+//        删除电表
+        houseNumber.setElectricEquipmentId("");
+        houseNumber.setElectricEquipmentMeterName("");
+//       删除水表
+        houseNumber.setWaterEquipmentId("");
+        houseNumber.setWaterEquipmentMeterName("");
+
+
+        houseNumberService.updateById(houseNumber);
+
+        return CommonResult.ok();
 
+    }
 }
 

+ 168 - 16
src/main/java/com/template/controller/HouseNumberStateController.java

@@ -87,6 +87,18 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
     @Autowired
     UsersService usersService;
 
+    @Autowired
+    OperatingRecordService operatingRecordService;
+
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    WaterEquipmentService waterEquipmentService;
+
+    @Autowired
+    ElectricEquipmentService electricEquipmentService;
+
     @Override
     public CommonResult page(String keyWord, String houseType, int page, int size) {
 
@@ -612,8 +624,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
         if (ObjectUtils.isEmpty(checkIdCardDto)) {
             return CommonResult.fail();
         }
-        String adminId = checkIdCardDto.getAdminId();
-        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
+        String adminMenuId = checkIdCardDto.getAdminMenuId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
         if (ObjectUtils.isEmpty(permissionSetting)) {
             return CommonResult.fail("非法进入");
         }
@@ -748,7 +760,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             //      修改房间状态
             HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
 
-//        todo 开电
+//         开电
+            electricEquipmentService.openMeterControl(houseNumber.getElectricEquipmentId());
             houseNumber.setElectricType("1");
 
             String roomNumber = houseNumber.getRoomNumber();
@@ -756,6 +769,15 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             String end = String.valueOf(leaveDate.getTime());
 //        发放密码
             String lockStatus = checkIdCardDto.getLockStatus();
+//        添加锁的操作记录
+            Admin byId = adminService.getById(checkIdCardDto.getAdminId());
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setRoomNumber(roomNumber);
+            operatingRecord.setOperatorName(byId.getName());
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:"+liveName);
+
             if ("1".equals(lockStatus)) {
                 PasswordDto pr = new PasswordDto();
                 pr.setLuid(equipmentState);
@@ -764,8 +786,10 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 pr.setHouseNumberId(houseNumberId);
                 pr.setOrderNumber(houseOrder.getOrderNumber());
                 Unlocking unlocking = passwordIssController.addPassword(pr);
-                unlockingService.save(unlocking);
+//                添加锁的操作记录类型
+                operatingRecord.setType("添加密码钥匙");
 
+                unlockingService.save(unlocking);
                 String passWord = unlocking.getPassWord();
                 ArrayList<String> strings = new ArrayList<>();
                 strings.add(cardNumber);
@@ -781,6 +805,9 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 cid.setOrderNumber(houseOrder.getOrderNumber());
                 Unlocking unlocking = passwordIssController.addCardInfo(cid);
                 unlockingService.save(unlocking);
+
+                //                添加锁的操作记录类型
+                operatingRecord.setType("添加卡片钥匙");
             } else if ("3".equals(lockStatus)) {
                 FingerprintDataDto fd = new FingerprintDataDto();
                 fd.setLuid(equipmentState);
@@ -791,6 +818,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 fd.setFingerprintData(fingerprint);
                 Unlocking unlocking = passwordIssController.addFingerprintData(fd);
                 unlockingService.save(unlocking);
+                //                添加锁的操作记录类型
+                operatingRecord.setType("添加指纹钥匙");
             }
 
 
@@ -799,6 +828,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
 
             houseNumberService.updateById(houseNumber);
 
+            operatingRecordService.save(operatingRecord);
+
             return CommonResult.ok();
 
         } catch (Exception e) {
@@ -868,8 +899,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
         if (ObjectUtils.isEmpty(roomChangeDto)) {
             return CommonResult.fail();
         }
-        int adminId = roomChangeDto.getAdminId();
-        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
+        int adminMenuId = roomChangeDto.getAdminMenuId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
         if (ObjectUtils.isEmpty(permissionSetting)) {
             return CommonResult.fail("非法进入");
         }
@@ -906,8 +937,53 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
 
 //        修改订单
             houseOrder.setHouseNumberId(houseNumberId);
-//            todo 结算水电 如是免费订单额度则加入
-//            todo 获取新房间的水起码和电起码
+
+            //      获取水电消费金额和额度
+//            获取初始房间号的水电表设备id
+            HouseNumber initialHouseNumber = houseNumberService.getById(initialHouseNumberId);
+            String electricEquipmentId = initialHouseNumber.getElectricEquipmentId();
+            String waterEquipmentId = initialHouseNumber.getWaterEquipmentId();
+            ElectricEquipment electricEquipment = electricEquipmentService.getById(electricEquipmentId);
+            WaterEquipment waterEquipment = waterEquipmentService.getById(waterEquipmentId);
+            if (ObjectUtils.isNotEmpty(electricEquipment) && ObjectUtils.isNotEmpty(waterEquipment)) {
+                String electricEquipmentRoomId = electricEquipment.getRoomId();
+                String waterEquipmentRoomId = waterEquipment.getRoomId();
+
+                String live = sdf.format(liveTime);
+                String leave = sdf.format(new Date());
+//                获取电的消费金额和额度
+                JSONObject jsonObjectElectric = electricEquipmentService.roomCostRecord(electricEquipmentRoomId, live, leave);
+                BigDecimal costElectric = jsonObjectElectric.getBigDecimal("cost");
+                BigDecimal consumeElectric = jsonObjectElectric.getBigDecimal("consume");
+                BigDecimal electricCost = houseOrder.getElectricCost();
+                if (ObjectUtils.isNotEmpty(electricCost)) {
+                    costElectric = costElectric.add(electricCost);
+                }
+                BigDecimal electricConsume = houseOrder.getElectricConsume();
+                if (ObjectUtils.isNotEmpty(electricConsume)) {
+                    consumeElectric = consumeElectric.add(electricConsume);
+                }
+                houseOrder.setElectricCost(costElectric);
+                houseOrder.setElectricConsume(consumeElectric);
+//                获取水的消费金额和额度
+                JSONObject jsonObjectWater = waterEquipmentService.roomCostRecord(waterEquipmentRoomId, live, leave);
+                BigDecimal costWater = jsonObjectWater.getBigDecimal("cost");
+                BigDecimal consumeWater = jsonObjectWater.getBigDecimal("consume");
+                BigDecimal waterCost = houseOrder.getWaterCost();
+                if (ObjectUtils.isNotEmpty(waterCost)) {
+                    costWater = costWater.add(waterCost);
+                }
+                BigDecimal waterConsume = houseOrder.getWaterConsume();
+                if (ObjectUtils.isNotEmpty(waterConsume)) {
+                    consumeWater = consumeWater.add(waterConsume);
+                }
+
+                houseOrder.setWaterCost(costWater);
+                houseOrder.setWaterConsume(consumeWater);
+
+            }
+
+
             houseOrderService.updateById(houseOrder);
 
 
@@ -933,7 +1009,8 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
 //        房间置脏需退房后
 //            houseNumber.setHouseStatus(2);
-//        todo 开电
+//         开电
+            electricEquipmentService.openMeterControl(houseNumber.getElectricEquipmentId());
             houseNumber.setElectricType("1");
             houseNumberService.updateById(houseNumber);
 
@@ -943,7 +1020,9 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             houseNumber1.setHouseStatus(2);
             houseNumberService.updateById(houseNumber1);
 
-//            todo 旧房间密码删除,添加新房间密码
+//             旧房间密码删除,添加新房间密码
+            Admin byId = adminService.getById(roomChangeDto.getAdminId());
+
             LambdaQueryWrapper<Unlocking> wrapperU = new LambdaQueryWrapper<>();
             wrapperU.eq(Unlocking::getOrderNumber, orderNumber)
                     .eq(Unlocking::getHouseNumberId, initialHouseNumberId);
@@ -951,6 +1030,15 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             if (ObjectUtils.isNotEmpty(unlocking)) {
 //                删除房间密码
                 passwordIssController.deleteLockUser(unlocking.getLuid(), unlocking.getLockUserId());
+
+                OperatingRecord operatingRecord = new OperatingRecord();
+                operatingRecord.setRoomNumber(houseNumber1.getRoomNumber());
+                operatingRecord.setOperatorName(byId.getName());
+                DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+                operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+                operatingRecord.setContent("姓名:"+houseOrder.getLiveName());
+                operatingRecord.setType("删除锁钥匙");
+                operatingRecordService.save(operatingRecord);
             }
             LambdaQueryWrapper<HouseLock> wrapperHl = new LambdaQueryWrapper<>();
             wrapperHl.eq(HouseLock::getHouseNumberId, houseNumberId);
@@ -964,6 +1052,15 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
 
 //            判断是什么类型的开锁方式
             String lockStatus = unlocking.getLockStatus();
+//          添加锁的操作记录
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(byId.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:"+houseOrder.getLiveName());
+
             if ("1".equals(lockStatus)) {
                 PasswordDto pr = new PasswordDto();
                 pr.setLuid(houseLock.getEquipmentType());
@@ -971,7 +1068,6 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 pr.setStartTime(String.valueOf(liveTime.getTime()));
 //            结束时间
                 String reserveLeaveTime = houseOrder.getReserveLeaveTime();
-                DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                 Date leaveTime = Date.from(LocalDateTime.parse(reserveLeaveTime, dateTimeFormatter1).atZone(ZoneId.systemDefault()).toInstant());
                 pr.setEndTime(String.valueOf(leaveTime.getTime()));
                 pr.setHouseNumberId(houseNumberId);
@@ -984,7 +1080,7 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 ArrayList<String> strings = new ArrayList<>();
                 strings.add(users.getCardNumber());
                 weiXiaoComponent.sendNotice(strings, "公寓办理入住成功", "办理入住成功", "您的房间号为:" + houseNumber.getRoomNumber() + ",密码是:" + passWord + "离店时间为:" + liveTime + ",欢迎您入住张玉玲酒店,我们全体员工很荣幸能为您服务,如有任何需要请致电张玉玲,期待为你服务。祝你生活愉快!", null);
-
+                operatingRecord.setType("添加密码钥匙");
 
             } else if ("2".equals(lockStatus)) {
                 CardInfoDto cid = new CardInfoDto();
@@ -994,7 +1090,6 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 cid.setStartTime(String.valueOf(liveTime.getTime()));
                 //            结束时间
                 String reserveLeaveTime = houseOrder.getReserveLeaveTime();
-                DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                 Date leaveTime = Date.from(LocalDateTime.parse(reserveLeaveTime, dateTimeFormatter1).atZone(ZoneId.systemDefault()).toInstant());
 
                 cid.setEndTime(String.valueOf(leaveTime.getTime()));
@@ -1002,6 +1097,7 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 cid.setOrderNumber(houseOrder.getOrderNumber());
                 Unlocking unlocking1 = passwordIssController.addCardInfo(cid);
                 unlockingService.save(unlocking1);
+                operatingRecord.setType("添加卡片钥匙");
             } else if ("3".equals(lockStatus)) {
                 FingerprintDataDto fd = new FingerprintDataDto();
                 fd.setLuid(equipmentState);
@@ -1010,7 +1106,6 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 fd.setStartTime(String.valueOf(liveTime.getTime()));
                 //            结束时间
                 String reserveLeaveTime = houseOrder.getReserveLeaveTime();
-                DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                 Date leaveTime = Date.from(LocalDateTime.parse(reserveLeaveTime, dateTimeFormatter1).atZone(ZoneId.systemDefault()).toInstant());
 
                 fd.setEndTime(String.valueOf(leaveTime.getTime()));
@@ -1018,8 +1113,11 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 fd.setFingerprintData(users.getFingerprint());
                 Unlocking unlocking1 = passwordIssController.addFingerprintData(fd);
                 unlockingService.save(unlocking1);
+                operatingRecord.setType("添加指纹钥匙");
             }
 
+            operatingRecordService.save(operatingRecord);
+
             return CommonResult.ok();
 
         } catch (Exception e) {
@@ -1075,7 +1173,51 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
                 }
 //            }
 
-            //      todo 获取水电止码
+            //      获取水电消费金额和额度
+            HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+            String electricEquipmentId = houseNumber.getElectricEquipmentId();
+            String waterEquipmentId = houseNumber.getWaterEquipmentId();
+            ElectricEquipment electricEquipment = electricEquipmentService.getById(electricEquipmentId);
+            WaterEquipment waterEquipment = waterEquipmentService.getById(waterEquipmentId);
+            if (ObjectUtils.isNotEmpty(electricEquipment) && ObjectUtils.isNotEmpty(waterEquipment)) {
+                String electricEquipmentRoomId = electricEquipment.getRoomId();
+                String waterEquipmentRoomId = waterEquipment.getRoomId();
+
+                Date liveTime = houseOrder.getLiveTime();
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                String live = sdf.format(liveTime);
+                String leave = sdf.format(new Date());
+//                获取电的消费金额和额度
+                JSONObject jsonObjectElectric = electricEquipmentService.roomCostRecord(electricEquipmentRoomId, live, leave);
+                BigDecimal costElectric = jsonObjectElectric.getBigDecimal("cost");
+                BigDecimal consumeElectric = jsonObjectElectric.getBigDecimal("consume");
+                BigDecimal electricCost = houseOrder.getElectricCost();
+                if (ObjectUtils.isNotEmpty(electricCost)) {
+                    costElectric = costElectric.add(electricCost);
+                }
+                BigDecimal electricConsume = houseOrder.getElectricConsume();
+                if (ObjectUtils.isNotEmpty(electricConsume)) {
+                    consumeElectric = consumeElectric.add(electricConsume);
+                }
+                houseOrder.setElectricCost(costElectric);
+                houseOrder.setElectricConsume(consumeElectric);
+//                获取水的消费金额和额度
+                JSONObject jsonObjectWater = waterEquipmentService.roomCostRecord(waterEquipmentRoomId, live, leave);
+                BigDecimal costWater = jsonObjectWater.getBigDecimal("cost");
+                BigDecimal consumeWater = jsonObjectWater.getBigDecimal("consume");
+                BigDecimal waterCost = houseOrder.getWaterCost();
+                if (ObjectUtils.isNotEmpty(waterCost)) {
+                    costWater = costWater.add(waterCost);
+                }
+                BigDecimal waterConsume = houseOrder.getWaterConsume();
+                if (ObjectUtils.isNotEmpty(waterConsume)) {
+                    consumeWater = consumeWater.add(waterConsume);
+                }
+
+                houseOrder.setWaterCost(costWater);
+                houseOrder.setWaterConsume(consumeWater);
+
+            }
 
 
 //      修改订单
@@ -1097,9 +1239,18 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
             houseNumberState.setEndTime(LocalDateTime.now().format(dateTimeFormatter));
 
 //         修改房间状态(置脏)
-            HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
+//            HouseNumber houseNumber = houseNumberService.getById(houseNumberId);
             houseNumber.setHouseStatus(2);
 
+            //            判断该房间是否免费的房间,是则需要支付水电费,并改成带结账状态
+            BigDecimal payPrice = houseOrder.getPayPrice();
+            if (ObjectUtils.isNotEmpty(payPrice) && payPrice.doubleValue() <= 0) {
+                houseOrder.setOrderStatus("5");
+                BigDecimal electricCost = houseOrder.getElectricCost();
+                BigDecimal waterCost = houseOrder.getWaterCost();
+                BigDecimal total = electricCost.add(waterCost);
+                houseOrder.setPayPrice(total);
+            }
 
 
             houseOrderService.updateById(houseOrder);
@@ -1242,6 +1393,7 @@ public class HouseNumberStateController implements HouseNumberStateAPI {
 //        关电
         houseNumber.setElectricType("2");
 //        todo 关电
+        electricEquipmentService.closeMeterControl(houseNumber.getElectricEquipmentId());
 
         houseNumberService.updateById(houseNumber);
 

Разница между файлами не показана из-за своего большого размера
+ 1340 - 109
src/main/java/com/template/controller/HouseOrderController.java


+ 17 - 1
src/main/java/com/template/controller/LoginController.java

@@ -1,11 +1,15 @@
 package com.template.controller;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.template.annotation.PassToken;
 import com.template.api.LoginControllerAPI;
+import com.template.common.utils.AesUtils;
 import com.template.common.utils.RSAUtils;
 import com.template.config.MySecurity;
 import com.template.model.enumModel.eStatu;
 import com.template.model.pojo.Admin;
+import com.template.model.pojo.PermissionSetting;
 import com.template.model.request.changePasswordRequest;
 import com.template.model.request.loginRequest;
 import com.template.model.result.CommonResult;
@@ -13,6 +17,7 @@ import com.template.model.vo.LoginVO;
 import com.template.services.AdminService;
 import com.template.common.utils.paramUtils;
 import com.template.common.utils.JWTUtil;
+import com.template.services.PermissionSettingService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -35,6 +40,9 @@ public class LoginController implements LoginControllerAPI {
     @Autowired
     MySecurity mySecurity;
 
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
 
     /**
      * 登录接口
@@ -71,13 +79,21 @@ public class LoginController implements LoginControllerAPI {
                 return CommonResult.fail("密码错误");
             }
 
+            String adminMenuId = result.getAdminMenuId();
+//            通过adminMenuId获取权限表的id
+            LambdaQueryWrapper<PermissionSetting> wrapper=new LambdaQueryWrapper<>();
+            wrapper.eq(PermissionSetting::getAdminMenuId,adminMenuId);
+            PermissionSetting one = permissionSettingService.getOne(wrapper);
+
+
             String token = JWTUtil.getAdminToken(result);
             LoginVO login = new LoginVO();
             login.setToken(token);
             login.setTokenTtl(JWTUtil.getExpired());
             login.setUserName(result.getName());
             login.setId(result.getId());
-            login.setAdminMenuId(result.getAdminMenuId());
+            login.setPermissionSettingId(one.getId());
+            login.setUser_head(AesUtils.encrypt(result.getId()+""));
 
             return CommonResult.ok("登录成功",login);
 

+ 68 - 0
src/main/java/com/template/controller/OperatingRecordController.java

@@ -0,0 +1,68 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.api.OperatingRecordControllerAPI;
+import com.template.model.pojo.OperatingRecord;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.UnlockingRecord;
+import com.template.model.result.CommonResult;
+import com.template.services.OperatingRecordService;
+import com.template.services.PermissionSettingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-20
+ */
+@RestController
+public class OperatingRecordController implements OperatingRecordControllerAPI {
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    OperatingRecordService operatingRecordService;
+
+    @Override
+    public CommonResult pageList(String permissionSettingId, int page, int size, String roomNumber) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("12")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+        if (ObjectUtils.isEmpty(roomNumber)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        LambdaQueryWrapper<OperatingRecord> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(OperatingRecord::getRoomNumber,roomNumber)
+                .orderByDesc(OperatingRecord::getDataTime);
+        IPage<OperatingRecord> operatingRecordIPage = operatingRecordService.page(new Page<>(page, size), wrapper);
+
+
+        return CommonResult.ok(operatingRecordIPage);
+    }
+}
+

Разница между файлами не показана из-за своего большого размера
+ 240 - 26
src/main/java/com/template/controller/PasswordIssController.java


+ 21 - 0
src/main/java/com/template/controller/PayRecordController.java

@@ -0,0 +1,21 @@
+package com.template.controller;
+
+
+import com.template.api.PayRecordControllerAPI;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-16
+ */
+@RestController
+public class PayRecordController implements PayRecordControllerAPI {
+
+}
+

+ 21 - 0
src/main/java/com/template/controller/RefundRecordController.java

@@ -0,0 +1,21 @@
+package com.template.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-18
+ */
+@RestController
+@RequestMapping("/auto/refund-record")
+public class RefundRecordController {
+
+}
+

+ 85 - 0
src/main/java/com/template/controller/SubsidySetupController.java

@@ -0,0 +1,85 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.SubsidySetupControllerAPI;
+import com.template.model.dto.SubsidySetupSaveOrUpdateDto;
+import com.template.model.pojo.CheckOutSetting;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.SubsidySetup;
+import com.template.model.result.CommonResult;
+import com.template.services.PermissionSettingService;
+import com.template.services.SubsidySetupService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-28
+ */
+@RestController
+public class SubsidySetupController implements SubsidySetupControllerAPI {
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    SubsidySetupService subsidySetupService;
+
+    @Override
+    public CommonResult list(String permissionSettingId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        List<SubsidySetup> list = subsidySetupService.list(new LambdaQueryWrapper<>());
+        if (ObjectUtils.isEmpty(list) && list.size() > 0) {
+            SubsidySetup subsidySetup = list.get(0);
+            return CommonResult.ok(subsidySetup);
+        }
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult saveOrUpdate(SubsidySetupSaveOrUpdateDto subsidySetupSaveOrUpdateDto) {
+        String permissionSettingId = subsidySetupSaveOrUpdateDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String systemManagement = permissionSetting.getSystemManagement();
+        if (!"0".equals(systemManagement) && !systemManagement.contains("1")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        SubsidySetup subsidySetup = new SubsidySetup();
+        BeanUtils.copyProperties(subsidySetupSaveOrUpdateDto,subsidySetup);
+
+        boolean update = subsidySetupService.saveOrUpdate(subsidySetup);
+
+        if (update) {
+            return CommonResult.ok();
+        }
+
+        return CommonResult.fail();
+    }
+}
+

+ 260 - 0
src/main/java/com/template/controller/UnlockingAdminController.java

@@ -0,0 +1,260 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.template.api.UnlockingAdminControllerAPI;
+import com.template.common.utils.PasswordChecker;
+import com.template.model.dto.KeyCardDto;
+import com.template.model.dto.KeyFingerprintDto;
+import com.template.model.dto.KeyPassWordDto;
+import com.template.model.pojo.*;
+import com.template.model.result.CommonResult;
+import com.template.services.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-22
+ */
+@RestController
+public class UnlockingAdminController implements UnlockingAdminControllerAPI {
+    @Autowired
+    UnlockingAdminService unlockingAdminService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Autowired
+    UsersService usersService;
+
+    @Autowired
+    PasswordIssController passwordIssController;
+
+    @Autowired
+    AdminService adminService;
+
+    @Autowired
+    HouseNumberService houseNumberService;
+
+    @Autowired
+    OperatingRecordService operatingRecordService;
+
+    @Override
+    public CommonResult getPassWord() {
+        String passWord = PasswordChecker.getPassWord();
+        HashMap<String, String> map = new HashMap<>();
+        map.put("passWord",passWord);
+        return CommonResult.ok(map);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult savePassWord(KeyPassWordDto keyPassWordDto) {
+        String permissionSettingId = keyPassWordDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("11")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+//        监测密码是否符合要求
+        String passWord = keyPassWordDto.getPassWord();
+        if (!PasswordChecker.isValidPassword(passWord)) {
+            return CommonResult.fail("密码长度的一半不能是连续升序、倒序、一样的数字");
+        }
+
+        Admin admin = adminService.getById(keyPassWordDto.getAdminId());
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+        HouseNumber houseNumber = houseNumberService.getById(keyPassWordDto.getHouseNumberId());
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+        String usersId = keyPassWordDto.getUsersId();
+        Users byId = usersService.getById(usersId);
+        if (ObjectUtils.isEmpty(byId)) {
+            return CommonResult.fail("无该用户");
+        }
+        UnlockingAdmin unlockingAdmin = null;
+        /**
+         * 缺少人的名字和
+         */
+        try {
+
+
+            unlockingAdmin = passwordIssController.savePassWord(keyPassWordDto);
+            if (ObjectUtils.isEmpty(unlockingAdmin)) {
+                return CommonResult.fail("该密码已存在,请更换");
+            }
+
+            unlockingAdmin.setName(byId.getUserName());
+            unlockingAdmin.setPhone(byId.getPhone());
+
+//        添加操作记录
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:" + byId.getUserName());
+            operatingRecord.setType("添加密码钥匙");
+
+
+            unlockingAdminService.save(unlockingAdmin);
+            operatingRecordService.save(operatingRecord);
+            return CommonResult.ok();
+        }catch (Exception e){
+            e.printStackTrace();
+//            删除锁
+            passwordIssController.deleteLockUser(unlockingAdmin.getLuid(),unlockingAdmin.getLockUserId());
+            return CommonResult.fail();
+        }
+
+
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult saveCard(KeyCardDto keyCardDto) {
+        String permissionSettingId = keyCardDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("11")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        Admin admin = adminService.getById(keyCardDto.getAdminId());
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+        HouseNumber houseNumber = houseNumberService.getById(keyCardDto.getHouseNumberId());
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+        String usersId = keyCardDto.getUsersId();
+        Users byId = usersService.getById(usersId);
+        if (ObjectUtils.isEmpty(byId)) {
+            return CommonResult.fail("无该用户");
+        }
+
+        UnlockingAdmin unlockingAdmin = null;
+
+        try {
+          unlockingAdmin = passwordIssController.addCard(keyCardDto);
+
+            unlockingAdmin.setName(byId.getUserName());
+            unlockingAdmin.setPhone(byId.getPhone());
+
+//        添加操作记录
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:" + byId.getUserName());
+            operatingRecord.setType("添加卡片钥匙");
+
+
+            unlockingAdminService.save(unlockingAdmin);
+            operatingRecordService.save(operatingRecord);
+            return CommonResult.ok();
+
+        }catch (Exception e){
+            e.printStackTrace();
+//            删除锁
+            passwordIssController.deleteLockUser(unlockingAdmin.getLuid(),unlockingAdmin.getLockUserId());
+            return CommonResult.fail();
+        }
+
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult saveFingerprint(KeyFingerprintDto keyFingerprintDto) {
+        String permissionSettingId = keyFingerprintDto.getPermissionSettingId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("11")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        Admin admin = adminService.getById(keyFingerprintDto.getAdminId());
+        if (ObjectUtils.isEmpty(admin)) {
+            return CommonResult.fail("该管理员不存在");
+        }
+        HouseNumber houseNumber = houseNumberService.getById(keyFingerprintDto.getHouseNumberId());
+        if (ObjectUtils.isEmpty(houseNumber)) {
+            return CommonResult.fail("该房间不存在");
+        }
+        String usersId = keyFingerprintDto.getUsersId();
+        Users byId = usersService.getById(usersId);
+        if (ObjectUtils.isEmpty(byId)) {
+            return CommonResult.fail("无该用户");
+        }
+
+        UnlockingAdmin unlockingAdmin = null;
+
+        try {
+            unlockingAdmin = passwordIssController.addFingerprintDto(keyFingerprintDto);
+
+            unlockingAdmin.setName(byId.getUserName());
+            unlockingAdmin.setPhone(byId.getPhone());
+
+//        添加操作记录
+
+            OperatingRecord operatingRecord = new OperatingRecord();
+            operatingRecord.setRoomNumber(houseNumber.getRoomNumber());
+            operatingRecord.setOperatorName(admin.getName());
+            DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            operatingRecord.setDataTime(LocalDateTime.now().format(dateTimeFormatter1));
+            operatingRecord.setContent("姓名:" + byId.getUserName());
+            operatingRecord.setType("添加卡片钥匙");
+
+
+            unlockingAdminService.save(unlockingAdmin);
+            operatingRecordService.save(operatingRecord);
+            return CommonResult.ok();
+
+        }catch (Exception e){
+            e.printStackTrace();
+//            删除锁
+            passwordIssController.deleteLockUser(unlockingAdmin.getLuid(),unlockingAdmin.getLockUserId());
+            return CommonResult.fail();
+        }
+
+    }
+
+
+
+
+
+}
+

+ 2 - 2
src/main/java/com/template/controller/UnlockingController.java

@@ -1,6 +1,7 @@
 package com.template.controller;
 
 
+import com.template.api.UnlockingControllerAPI;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
@@ -14,8 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2023-12-01
  */
 @RestController
-@RequestMapping("/auto/unlocking")
-public class UnlockingController {
+public class UnlockingController implements UnlockingControllerAPI {
 
 }
 

+ 69 - 0
src/main/java/com/template/controller/UnlockingRecordController.java

@@ -0,0 +1,69 @@
+package com.template.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.api.UnlockingControllerAPI;
+import com.template.api.UnlockingRecordControllerAPI;
+import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.UnlockingRecord;
+import com.template.model.result.CommonResult;
+import com.template.services.PermissionSettingService;
+import com.template.services.UnlockingRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-19
+ */
+@RestController
+public class UnlockingRecordController implements UnlockingRecordControllerAPI {
+
+    @Autowired
+    UnlockingRecordService unlockingRecordService;
+
+    @Autowired
+    PermissionSettingService permissionSettingService;
+
+    @Override
+    public CommonResult pageList(String permissionSettingId, int page, int size,String roomNumber) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String houseTypeManagement = permissionSetting.getDoorLockManagement();
+        if (!"0".equals(houseTypeManagement) && !houseTypeManagement.contains("12")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+
+        if (ObjectUtils.isEmpty(page) && page <= 0) {
+            page = 1;
+        }
+        if (ObjectUtils.isEmpty(size) && size <= 0) {
+            size = 10;
+        }
+        if (ObjectUtils.isEmpty(roomNumber)) {
+            return CommonResult.fail("参数异常");
+        }
+
+        LambdaQueryWrapper<UnlockingRecord> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(UnlockingRecord::getRoomNumber,roomNumber)
+                .orderByDesc(UnlockingRecord::getDateTime);
+        IPage<UnlockingRecord> unlockingRecordIPage = unlockingRecordService.page(new Page<>(page, size), wrapper);
+
+
+        return CommonResult.ok(unlockingRecordIPage);
+    }
+}
+

+ 10 - 5
src/main/java/com/template/controller/UploadServlet.java

@@ -1,7 +1,9 @@
 package com.template.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.template.common.utils.FileUtil;
+import com.template.model.result.CommonResult;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -20,14 +22,14 @@ import java.nio.file.Files;
 public class UploadServlet {
 
     @PostMapping("/save")
-    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+    protected CommonResult doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         // 获取文件内容
         Part filePart = request.getPart("file");
         InputStream fileContent = filePart.getInputStream();
 
         String fileNameWithPath = FileUtil.getFileNameWithPath() + ".jpg";
-        FileUtil.makeDirs(fileNameWithPath, "E://image");
-        String imgFilePath = "E://image/" + fileNameWithPath;
+        FileUtil.makeDirs(fileNameWithPath, "E://image3");
+        String imgFilePath = "E://image3/" + fileNameWithPath;
 //        FileUtil.makeDirs(fileNameWithPath, "/home/nginx/html/image");
 //        String imgFilePath = "/home/nginx/html/image/" + fileNameWithPath;
 
@@ -43,7 +45,10 @@ public class UploadServlet {
 //            out.write(buffer, 0, bytesRead);
 //        }
 //        out.close();
-
-        response.getWriter().println(imgFilePath);
+        String url="192.168.161.224:12345/"+fileNameWithPath;
+//        response.getWriter().println(url);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("url",url);
+        return CommonResult.ok(jsonObject);
     }
 }

+ 51 - 4
src/main/java/com/template/controller/UsersController.java

@@ -12,8 +12,11 @@ import com.template.model.dto.UsersDetailsDto;
 import com.template.model.dto.UsersDto;
 import com.template.model.pojo.PermissionSetting;
 import com.template.model.pojo.Users;
+import com.template.model.pojo.UsersMenu;
 import com.template.model.result.CommonResult;
+import com.template.model.vo.UsersPageVo;
 import com.template.services.PermissionSettingService;
+import com.template.services.UsersMenuService;
 import com.template.services.UsersService;
 import io.swagger.annotations.ApiModelProperty;
 import org.springframework.beans.BeanUtils;
@@ -23,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
  * 前端控制器
@@ -40,13 +46,16 @@ public class UsersController implements UsersAPI {
     @Autowired
     PermissionSettingService permissionSettingService;
 
+    @Autowired
+    UsersMenuService usersMenuService;
+
     @Override
     public CommonResult saveUsers(UsersDto usersDto, BindingResult bindingResult) {
         if (ObjectUtils.isEmpty(usersDto)) {
             return CommonResult.fail();
         }
-        int adminId = usersDto.getAdminMenuId();
-        PermissionSetting permissionSetting = permissionSettingService.getById(adminId);
+        Integer permissionSettingId = usersDto.getAdminMenuId();
+        PermissionSetting permissionSetting = permissionSettingService.getById(permissionSettingId);
         if (ObjectUtils.isEmpty(permissionSetting)) {
             return CommonResult.fail("非法进入");
         }
@@ -67,7 +76,6 @@ public class UsersController implements UsersAPI {
 
         Users users = new Users();
         BeanUtils.copyProperties(usersDto, users);
-
         boolean save = usersService.save(users);
         if (!save) {
             return CommonResult.fail();
@@ -104,9 +112,23 @@ public class UsersController implements UsersAPI {
                 .between(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime), Users::getCreateTime, startTime, endTime);
 
         IPage<Users> page1 = usersService.page(new Page<>(page, size), wrapperU);
+        List<Users> records = page1.getRecords();
+
+        ArrayList<UsersPageVo> usersPageVos = new ArrayList<>();
+        for (Users record : records) {
+            UsersPageVo usersPageVo = new UsersPageVo();
+            BeanUtils.copyProperties(record,usersPageVo);
+            String userMenuId = record.getUserMenuId();
+            UsersMenu byId = usersMenuService.getById(userMenuId);
+            usersPageVo.setUserMenu(byId);
+            usersPageVos.add(usersPageVo);
+        }
 
+        Page<UsersPageVo> usersPageVoPage = new Page<>();
+        BeanUtils.copyProperties(page1,usersPageVoPage);
+        usersPageVoPage.setRecords(usersPageVos);
 
-        return CommonResult.ok(page1);
+        return CommonResult.ok(usersPageVoPage);
     }
 
     @Override
@@ -162,5 +184,30 @@ public class UsersController implements UsersAPI {
     }
 
 
+    @Override
+    public CommonResult departmentList() {
+        List<String> departmentList=usersService.departmentList();
+
+        return CommonResult.ok(departmentList);
+    }
+
+    @Override
+    public CommonResult userList(String userMenuId) {
+        if (ObjectUtils.isEmpty(userMenuId)) {
+            return CommonResult.fail();
+        }
+       LambdaQueryWrapper<Users> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(Users::getUserMenuId,userMenuId);
+        List<Users> list = usersService.list(wrapper);
+
+        return CommonResult.ok(list);
+    }
+
+    @Override
+    public CommonResult getUser(String userId) {
+        return CommonResult.ok(usersService.getById(userId));
+    }
+
+
 }
 

+ 41 - 0
src/main/java/com/template/controller/UsersMenuController.java

@@ -10,14 +10,18 @@ import com.template.api.UsersMenuAPI;
 import com.template.model.dto.SaveParentDto;
 import com.template.model.dto.SaveParentUserDto;
 import com.template.model.dto.SaveSecondaryUserDto;
+import com.template.model.dto.UpdateMenuPermissionSettingDto;
 import com.template.model.pojo.AdminMenu;
 import com.template.model.pojo.PermissionSetting;
+import com.template.model.pojo.Users;
 import com.template.model.pojo.UsersMenu;
 import com.template.model.result.CommonResult;
 import com.template.model.vo.AdminMenuTreeVo;
 import com.template.services.PermissionSettingService;
 import com.template.services.UsersMenuService;
+import com.template.services.UsersService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
@@ -43,6 +47,9 @@ public class UsersMenuController implements UsersMenuAPI {
     @Autowired
     PermissionSettingService permissionSettingService;
 
+    @Autowired
+    UsersService usersService;
+
     public static void main(String[] args) {
         String s = "1,2";
         boolean contains = s.contains("3");
@@ -154,6 +161,40 @@ public class UsersMenuController implements UsersMenuAPI {
         return CommonResult.ok(page1);
     }
 
+    @Override
+    public CommonResult deleteUsersMenu(int adminMenuId, int userMenuId) {
+        PermissionSetting permissionSetting = permissionSettingService.getById(adminMenuId);
+        if (ObjectUtils.isEmpty(permissionSetting)) {
+            return CommonResult.fail("非法进入");
+        }
+//      判断该用户是否拥有权限
+        String roleManagement = permissionSetting.getRoleManagement();
+        if (!"0".equals(roleManagement) && !roleManagement.contains("3")) {
+            return CommonResult.fail("此账号暂无该权限");
+        }
+//        判断是否有子用户角色
+        List<UsersMenu> usersMenuList=usersMenuService.listUserMenuId(userMenuId);
+
+        List<Users> users=usersService.listUserMenuId(userMenuId);
+
+        if (users.size()>0) {
+            return CommonResult.fail("该角色下还有用户");
+        }
+
+        if (ObjectUtils.isNotEmpty(usersMenuList)&&usersMenuList.size()>0) {
+            return CommonResult.fail("该角色下还有其他角色未删除");
+        }
+
+        boolean b = usersMenuService.removeById(userMenuId);
+        if (!b) {
+            return CommonResult.fail("删除失败");
+        }
+        return CommonResult.ok();
+
+    }
+
+
+
 
     /**
      * 根据父类ID获取树形菜单数据

+ 21 - 0
src/main/java/com/template/controller/WaterEquipmentController.java

@@ -0,0 +1,21 @@
+package com.template.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-03
+ */
+@RestController
+@RequestMapping("/auto/water-equipment")
+public class WaterEquipmentController {
+
+}
+

+ 1 - 1
src/main/java/com/template/core/JwtlnterceptorConfig.java

@@ -14,7 +14,7 @@ public class JwtlnterceptorConfig implements WebMvcConfigurer {
         //目前测试下来 使用 /**所有的话,response.sendError浏览器获取不到响应的信息
         //默认拦截所有路径
         registry.addInterceptor(authenticationInterceptor())
-                .addPathPatterns("/api/**");
+                .addPathPatterns("/auto0/**");
         //endregion
     }
 

+ 15 - 7
src/main/java/com/template/handler/MyMetaObjectHandler.java

@@ -11,6 +11,8 @@ import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 
 @Slf4j
@@ -22,11 +24,16 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
     @Override
     public void insertFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
-        String user_id = request.getHeader("user_head") == null ? "1" : AesUtils.decrypt(request.getHeader("user_head"));
+        String user_id="1";
+        if (ObjectUtils.isNotEmpty(request)) {
+             user_id = request.getHeader("user_head") == null ? "1" : AesUtils.decrypt(request.getHeader("user_head"));
+        }
         log.info("start insert fill.....");
+
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
-        this.setFieldValByName("createTime", new Date(), metaObject);
-        this.setFieldValByName("updateTime", new Date(), metaObject);
+        this.setFieldValByName("createTime", LocalDateTime.now().format(dateTimeFormatter1), metaObject);
+        this.setFieldValByName("updateTime", LocalDateTime.now().format(dateTimeFormatter1), metaObject);
         this.setFieldValByName("createUser", user_id , metaObject);
         this.setFieldValByName("updateUser", user_id , metaObject);
         this.setFieldValByName("deleted", 0 , metaObject);
@@ -36,13 +43,14 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
     @Override
     public void updateFill(MetaObject metaObject) {
         HttpServletRequest request = getHttpServletRequest();
-        String user_id="1";
+
+        String user_id="0";
         if (ObjectUtils.isNotEmpty(request)) {
-            user_id = request.getHeader("user_head") == null ? "1" : AesUtils.decrypt(request.getHeader("user_head"));
+            user_id = request.getHeader("user_head") == null || request.getHeader("user_head") == "" ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
         }
-
+        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         log.info("start update fill.....");
-        this.setFieldValByName("updateTime", new Date(), metaObject);
+        this.setFieldValByName("updateTime", LocalDateTime.now().format(dateTimeFormatter1), metaObject);
         this.setFieldValByName("updateUser", user_id, metaObject);
     }
 

+ 20 - 0
src/main/java/com/template/mapper/AlarmMessageMapper.java

@@ -0,0 +1,20 @@
+package com.template.mapper;
+
+import com.template.model.pojo.AlarmMessage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-19
+ */
+@Mapper
+public interface AlarmMessageMapper extends BaseMapper<AlarmMessage> {
+
+    void getSave(@Param("roomNumber") String roomNumber,@Param("messageType") String messageType,@Param("messageTime") String messageTime, @Param("createTime") String createTime,@Param("updateTime") String updateTime,@Param("createUser") String createUser, @Param("updateUser")String updateUser);
+}

+ 18 - 0
src/main/java/com/template/mapper/ApartmentSettingMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.ApartmentSetting;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@Mapper
+public interface ApartmentSettingMapper extends BaseMapper<ApartmentSetting> {
+
+}

+ 27 - 0
src/main/java/com/template/mapper/ApplicationProcedureMapper.java

@@ -0,0 +1,27 @@
+package com.template.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.model.pojo.ApplicationProcedure;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.ApplicationProcedureVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-02-27
+ */
+@Mapper
+public interface ApplicationProcedureMapper extends BaseMapper<ApplicationProcedure> {
+
+    IPage<ApplicationProcedureVo> pageList(Page<ApplicationProcedureVo> pageVo, @Param("submissionStartTime") String submissionStartTime,@Param("submissionEndTime") String submissionEndTime,@Param("examineAndApproveStartTime") String examineAndApproveStartTime,@Param("examineAndApproveEndTime") String examineAndApproveEndTime,@Param("type") String type,@Param("department") String department,@Param("key") String key);
+
+
+    IPage<ApplicationProcedureVo> parentPageList(Page<ApplicationProcedureVo> pageVo, @Param("submissionStartTime") String submissionStartTime,@Param("submissionEndTime") String submissionEndTime,@Param("examineAndApproveStartTime") String examineAndApproveStartTime,@Param("examineAndApproveEndTime") String examineAndApproveEndTime,@Param("type") String type,@Param("department") String department,@Param("key") String key);
+
+}

+ 16 - 0
src/main/java/com/template/mapper/ApplicationProcedureSettingMapper.java

@@ -0,0 +1,16 @@
+package com.template.mapper;
+
+import com.template.model.pojo.ApplicationProcedureSetting;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-02-28
+ */
+public interface ApplicationProcedureSettingMapper extends BaseMapper<ApplicationProcedureSetting> {
+
+}

+ 28 - 0
src/main/java/com/template/mapper/ApplicationProcedureTemporaryMapper.java

@@ -0,0 +1,28 @@
+package com.template.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.model.pojo.ApplicationProcedureTemporary;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.ApplicationProcedureTemporaryVo;
+import com.template.model.vo.ApplicationProcedureVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-05
+ */
+@Mapper
+public interface ApplicationProcedureTemporaryMapper extends BaseMapper<ApplicationProcedureTemporary> {
+
+    IPage<ApplicationProcedureTemporaryVo> pageList(Page<ApplicationProcedureVo> pageVo, @Param("submissionStartTime") String submissionStartTime, @Param("submissionEndTime") String submissionEndTime, @Param("examineAndApproveStartTime") String examineAndApproveStartTime, @Param("examineAndApproveEndTime") String examineAndApproveEndTime, @Param("type") String type, @Param("department") String department, @Param("key") String key);
+
+    IPage<ApplicationProcedureTemporaryVo> parentPageList(Page<ApplicationProcedureVo> pageVo, @Param("submissionStartTime") String submissionStartTime, @Param("submissionEndTime") String submissionEndTime, @Param("examineAndApproveStartTime") String examineAndApproveStartTime, @Param("examineAndApproveEndTime") String examineAndApproveEndTime, @Param("type") String type, @Param("department") String department, @Param("key") String key);
+
+
+}

+ 18 - 0
src/main/java/com/template/mapper/CallSystemMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.CallSystem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-28
+ */
+@Mapper
+public interface CallSystemMapper extends BaseMapper<CallSystem> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/CheckOutSettingMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.CheckOutSetting;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@Mapper
+public interface CheckOutSettingMapper extends BaseMapper<CheckOutSetting> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/ElectricEquipmentMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.ElectricEquipment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-01
+ */
+@Mapper
+public interface ElectricEquipmentMapper extends BaseMapper<ElectricEquipment> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/FacilityServicesMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.FacilityServices;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-27
+ */
+@Mapper
+public interface FacilityServicesMapper extends BaseMapper<FacilityServices> {
+
+}

+ 3 - 0
src/main/java/com/template/mapper/HouseMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.House;
+import com.template.model.vo.HouseAppletPageVo;
 import com.template.model.vo.HouseVo;
 import com.template.model.vo.HousedetailsVo;
 import com.template.model.vo.RoomTypeVo;
@@ -30,4 +31,6 @@ public interface HouseMapper extends BaseMapper<House> {
     List<RoomTypeVo> roomType();
 
 
+    List<String> group();
+
 }

+ 5 - 0
src/main/java/com/template/mapper/HouseNumberMapper.java

@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.HouseNumber;
 import com.template.model.vo.CalendarPageVo;
 import com.template.model.vo.HouseStateVo;
+import com.template.model.vo.houseLockListVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -25,4 +27,7 @@ public interface HouseNumberMapper extends BaseMapper<HouseNumber> {
     IPage<HouseStateVo> houseStatePage(Page<HouseStateVo> pageVo, @Param("keyWord") String keyWord,@Param("houseType") String houseType,@Param("date") Date date);
 
     IPage<CalendarPageVo> houseStateCalendarPage(Page<CalendarPageVo> pageVo, @Param("keyWord") String keyWord, @Param("houseType") String houseType);
+
+
+    IPage<houseLockListVo> houseLockListDto(Page<houseLockListVo> pageVo,@Param("roomNumber") String roomNumber,@Param("houseIds") String houseIds);
 }

+ 18 - 0
src/main/java/com/template/mapper/OperatingRecordMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.OperatingRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-20
+ */
+@Mapper
+public interface OperatingRecordMapper extends BaseMapper<OperatingRecord> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/PayRecordMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.PayRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-16
+ */
+@Mapper
+public interface PayRecordMapper extends BaseMapper<PayRecord> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/RefundRecordMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.RefundRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-04-18
+ */
+@Mapper
+public interface RefundRecordMapper extends BaseMapper<RefundRecord> {
+
+}

+ 18 - 0
src/main/java/com/template/mapper/SubsidySetupMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SubsidySetup;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-28
+ */
+@Mapper
+public interface SubsidySetupMapper extends BaseMapper<SubsidySetup> {
+
+}

+ 0 - 0
src/main/java/com/template/mapper/UnlockingAdminMapper.java


Некоторые файлы не были показаны из-за большого количества измененных файлов