Browse Source

定时程序更新

夏文涛 2 years ago
parent
commit
bc1db3a480
100 changed files with 1437 additions and 11128 deletions
  1. 3 3
      .idea/compiler.xml
  2. 2 2
      .idea/encodings.xml
  3. 661 478
      .idea/workspace.xml
  4. 7 0
      pom.xml
  5. 0 39
      src/main/java/com/repair/api/LoginControllerAPI.java
  6. 0 45
      src/main/java/com/repair/api/RepairAdminControllerAPI.java
  7. 0 43
      src/main/java/com/repair/api/RepairAreaControllerAPI.java
  8. 0 43
      src/main/java/com/repair/api/RepairArticleTypeControllerAPI.java
  9. 0 58
      src/main/java/com/repair/api/RepairClassesSettingsControllerAPI.java
  10. 0 34
      src/main/java/com/repair/api/RepairCloseControllerAPI.java
  11. 0 30
      src/main/java/com/repair/api/RepairCollaborateRecordControllerAPI.java
  12. 0 55
      src/main/java/com/repair/api/RepairConsumablesControllerAPI.java
  13. 0 55
      src/main/java/com/repair/api/RepairConsumeControllerAPI.java
  14. 0 30
      src/main/java/com/repair/api/RepairDispatchRecordControllerAPI.java
  15. 0 33
      src/main/java/com/repair/api/RepairEvaluateControllerAPI.java
  16. 0 35
      src/main/java/com/repair/api/RepairLeaveMessageControllerAPI.java
  17. 0 40
      src/main/java/com/repair/api/RepairNoticeSettingControllerAPI.java
  18. 0 46
      src/main/java/com/repair/api/RepairPayRecordControllerAPI.java
  19. 0 30
      src/main/java/com/repair/api/RepairReceivingControllerAPI.java
  20. 0 176
      src/main/java/com/repair/api/RepairRecordControllerAPI.java
  21. 0 30
      src/main/java/com/repair/api/RepairRefundRecordControllerAPI.java
  22. 0 30
      src/main/java/com/repair/api/RepairSchoolControllerAPI.java
  23. 0 34
      src/main/java/com/repair/api/RepairShiftSettingsControllerAPI.java
  24. 0 30
      src/main/java/com/repair/api/RepairSystemMessagesControllerAPI.java
  25. 0 26
      src/main/java/com/repair/api/RepairSystemSettingControllerAPI.java
  26. 0 30
      src/main/java/com/repair/api/RepairTrackRecordControllerAPI.java
  27. 0 30
      src/main/java/com/repair/api/RepairTransferRecordControllerAPI.java
  28. 0 57
      src/main/java/com/repair/api/RepairUserControllerAPI.java
  29. 0 43
      src/main/java/com/repair/api/RepairWorkTypeControllerAPI.java
  30. 0 199
      src/main/java/com/repair/common/utils/AesUtils.java
  31. 0 30
      src/main/java/com/repair/common/utils/DateUtils.java
  32. 1 1
      src/main/java/com/repair/common/utils/DelayedUtils.java
  33. 15 0
      src/main/java/com/repair/common/utils/DictionaryCompare.java
  34. 0 41
      src/main/java/com/repair/common/utils/EncryptionUtil.java
  35. 0 253
      src/main/java/com/repair/common/utils/ExcelExportUtil.java
  36. 0 65
      src/main/java/com/repair/common/utils/ExcelUtils.java
  37. 112 0
      src/main/java/com/repair/common/utils/HttpUtils.java
  38. 0 479
      src/main/java/com/repair/common/utils/HttpsClient.java
  39. 0 61
      src/main/java/com/repair/common/utils/MimeTypeUtils.java
  40. 0 23
      src/main/java/com/repair/common/utils/MyX509TrustManager.java
  41. 0 195
      src/main/java/com/repair/common/utils/RSAUtils.java
  42. 0 178
      src/main/java/com/repair/common/utils/SendSms.java
  43. 0 84
      src/main/java/com/repair/common/utils/SeqUtils.java
  44. 0 103
      src/main/java/com/repair/common/utils/StrUtils.java
  45. 6 433
      src/main/java/com/repair/common/utils/TimeExchange.java
  46. 0 127
      src/main/java/com/repair/common/utils/WeiXiaoUtil.java
  47. 67 0
      src/main/java/com/repair/common/utils/WxUtil.java
  48. 74 0
      src/main/java/com/repair/common/utils/XmlUtil.java
  49. 0 27
      src/main/java/com/repair/common/utils/paramUtils.java
  50. 0 25
      src/main/java/com/repair/common/utils/smsUtil.java
  51. 19 0
      src/main/java/com/repair/config/ScheduledConfig.java
  52. 0 36
      src/main/java/com/repair/config/SmsConfig.java
  53. 12 0
      src/main/java/com/repair/config/WxOpenidConfig.java
  54. 0 358
      src/main/java/com/repair/controller/LoginController.java
  55. 0 37
      src/main/java/com/repair/controller/MaintenanceConsumeablesRequest.java
  56. 0 231
      src/main/java/com/repair/controller/RepairAdminController.java
  57. 0 156
      src/main/java/com/repair/controller/RepairAreaController.java
  58. 0 170
      src/main/java/com/repair/controller/RepairArticleTypeController.java
  59. 0 608
      src/main/java/com/repair/controller/RepairClassesSettingsController.java
  60. 0 80
      src/main/java/com/repair/controller/RepairCloseController.java
  61. 0 75
      src/main/java/com/repair/controller/RepairCollaborateRecordController.java
  62. 0 334
      src/main/java/com/repair/controller/RepairConsumablesController.java
  63. 0 456
      src/main/java/com/repair/controller/RepairConsumeController.java
  64. 0 75
      src/main/java/com/repair/controller/RepairDispatchRecordController.java
  65. 0 89
      src/main/java/com/repair/controller/RepairEvaluateController.java
  66. 0 133
      src/main/java/com/repair/controller/RepairLeaveMessageController.java
  67. 0 148
      src/main/java/com/repair/controller/RepairNoticeSettingController.java
  68. 0 410
      src/main/java/com/repair/controller/RepairPayRecordController.java
  69. 0 74
      src/main/java/com/repair/controller/RepairReceivingController.java
  70. 0 2221
      src/main/java/com/repair/controller/RepairRecordController.java
  71. 0 72
      src/main/java/com/repair/controller/RepairRefundRecordController.java
  72. 0 76
      src/main/java/com/repair/controller/RepairSchoolController.java
  73. 0 205
      src/main/java/com/repair/controller/RepairShiftSettingsController.java
  74. 0 72
      src/main/java/com/repair/controller/RepairSystemMessagesController.java
  75. 0 73
      src/main/java/com/repair/controller/RepairSystemSettingController.java
  76. 0 74
      src/main/java/com/repair/controller/RepairTrackRecordController.java
  77. 0 74
      src/main/java/com/repair/controller/RepairTransferRecordController.java
  78. 0 256
      src/main/java/com/repair/controller/RepairUserController.java
  79. 0 128
      src/main/java/com/repair/controller/RepairWorkTypeController.java
  80. 432 0
      src/main/java/com/repair/controller/ScheduleController.java
  81. 0 20
      src/main/java/com/repair/controller/WxAccessTokenController.java
  82. 0 27
      src/main/java/com/repair/core/CORSConfiguration.java
  83. 0 113
      src/main/java/com/repair/core/JwtAuthenticationInterceptor.java
  84. 0 25
      src/main/java/com/repair/core/JwtlnterceptorConfig.java
  85. 0 49
      src/main/java/com/repair/handler/MyMetaObjectHandler.java
  86. 0 17
      src/main/java/com/repair/mapper/RepairAdminMapper.java
  87. 0 21
      src/main/java/com/repair/mapper/RepairAreaMapper.java
  88. 22 0
      src/main/java/com/repair/mapper/RepairArticleBuildMapper.java
  89. 0 25
      src/main/java/com/repair/mapper/RepairArticleTypeMapper.java
  90. 0 32
      src/main/java/com/repair/mapper/RepairClassesSettingsMapper.java
  91. 0 18
      src/main/java/com/repair/mapper/RepairCloseMapper.java
  92. 0 25
      src/main/java/com/repair/mapper/RepairCollaborateRecordMapper.java
  93. 0 29
      src/main/java/com/repair/mapper/RepairConsumablesMapper.java
  94. 0 31
      src/main/java/com/repair/mapper/RepairConsumeMapper.java
  95. 1 2
      src/main/java/com/repair/mapper/RepairDispatchRecordMapper.java
  96. 3 6
      src/main/java/com/repair/mapper/RepairEvaluateMapper.java
  97. 0 18
      src/main/java/com/repair/mapper/RepairLeaveMessageMapper.java
  98. 0 21
      src/main/java/com/repair/mapper/RepairNoticeSettingMapper.java
  99. 0 19
      src/main/java/com/repair/mapper/RepairPayRecordMapper.java
  100. 0 0
      src/main/java/com/repair/mapper/RepairReceivingMapper.java

+ 3 - 3
.idea/compiler.xml

@@ -8,16 +8,16 @@
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
         <module name="repair_backend" />
+        <module name="repair_system" />
         <module name="template_code" />
         <module name="Back-endDevelopmentFramework" />
       </profile>
     </annotationProcessing>
   </component>
   <component name="JavacSettings">
+    <option name="ADDITIONAL_OPTIONS_STRING" value="-encoding utf-8" />
     <option name="ADDITIONAL_OPTIONS_OVERRIDE">
-      <module name="Back-endDevelopmentFramework" options="-parameters" />
-      <module name="repair_backend" options="-parameters" />
-      <module name="template_code" options="-parameters" />
+      <module name="repair_system" options="-parameters" />
     </option>
   </component>
 </project>

+ 2 - 2
.idea/encodings.xml

@@ -5,10 +5,10 @@
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/HttpsClient.java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/MyX509TrustManager.java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/SHA1.java" charset="UTF-8" />
-    <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/TimeExchange.java" charset="GBK" />
+    <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/TimeExchange.java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/WxConstants.java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/common/utils/WxUtil.java" charset="UTF-8" />
-    <file url="file://$PROJECT_DIR$/src/main/java/com/repair/model/request/AlterPriceRequest.java" charset="GBK" />
+    <file url="file://$PROJECT_DIR$/src/main/java/com/repair/model/request/AlterPriceRequest.java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/src/main/java/com/repair/model/result/Wx_user.java" charset="UTF-8" />
     <file url="PROJECT" charset="UTF-8" />
   </component>

File diff suppressed because it is too large
+ 661 - 478
.idea/workspace.xml


+ 7 - 0
pom.xml

@@ -204,6 +204,13 @@
             <artifactId>jsch</artifactId>
             <version>0.1.49</version>
         </dependency>
+
+        <dependency>
+            <!--            dom4j是一个可以解析XML文件的java组件,我们把他引入-->
+            <groupId>org.dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>2.1.3</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 0 - 39
src/main/java/com/repair/api/LoginControllerAPI.java

@@ -1,39 +0,0 @@
-package com.repair.api;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.request.changePasswordRequest;
-import com.repair.model.request.loginRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-
-@RequestMapping("/api/login")
-@Api(tags = {"LoginController"}, value = "登录")
-public interface LoginControllerAPI {
-
-    @GetMapping(value = "/queryReduce")
-    @ApiOperation(value = "查看系统版本", notes = "查看系统版本", httpMethod = "GET")
-    CommonResult queryReduce();
-
-    @PostMapping(value = "/Register")
-    @ApiOperation(value = "注册", notes = "注册", httpMethod = "POST")
-    CommonResult Register(@Validated @RequestBody RepairAdmin loginRequest, BindingResult bindingResult);
-
-    @PostMapping(value = "/Login")
-    @ApiOperation(value = "登录", notes = "登录", httpMethod = "POST")
-    CommonResult Login(@Validated @RequestBody loginRequest lr, BindingResult bindingResult);
-
-    @PostMapping(value = "/ChangePassword")
-    @ApiOperation(value = "修改密码", notes = "修改密码", httpMethod = "POST")
-    CommonResult ChangePassword(@Validated @RequestBody changePasswordRequest cpr, @RequestHeader("user_head") String userhead, BindingResult bindingResult);
-
-    @GetMapping(value = "/Openid")
-    @ApiOperation(value = "登录", notes = "登录", httpMethod = "POST")
-    CommonResult Openid(@RequestParam String wxcode) throws JsonProcessingException;
-
-}

+ 0 - 45
src/main/java/com/repair/api/RepairAdminControllerAPI.java

@@ -1,45 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.request.freezeRepairAdminRequest;
-import com.repair.model.request.queryAccountPageRequest;
-import com.repair.model.request.updateRepairAdminRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.InvocationTargetException;
-
-@RequestMapping("/api/repairAdmin")
-@Api(tags = {"RepairAdminController"}, value = "账号")
-public interface RepairAdminControllerAPI {
-
-    @PostMapping(value = "/insertRepairAdmin")
-    @ApiOperation(value = "添加账号", notes = "添加账号数据", httpMethod = "POST")
-    CommonResult InsertRepairAdmin(@Validated @RequestBody RepairAdmin repairAdmin, @RequestHeader("user_head") String userhead, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairAdmin")
-    @ApiOperation(value = "账号分页数据", notes = "账号分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairAdmins(@RequestParam int currentPage, @RequestParam int pageCount, String account, String startTime, String endTime);
-
-    @PostMapping(value = "/freezeRepairAdminById")
-    @ApiOperation(value = "根据ID冻结指定账号", notes = "根据ID冻结指定账户", httpMethod = "POST")
-    CommonResult freezeRepairAdminById(@Validated @RequestBody freezeRepairAdminRequest frar, BindingResult bindingResult);
-
-    @GetMapping(value = "/deleteRepairAdminById")
-    @ApiOperation(value = "根据ID删除指定账号", notes = "根据ID删除指定账号", httpMethod = "POST")
-    CommonResult deleteRepairAdminById(@RequestParam String id);
-
-    @PostMapping(value = "/updateRepairAdminById")
-    @ApiOperation(value = "编辑账号数据", notes = "编辑账号数据", httpMethod = "POST")
-    CommonResult updateRepairAdminById(@Validated @RequestBody updateRepairAdminRequest ra, @RequestHeader("user_head") String userhead, BindingResult bindingResult);
-
-    @GetMapping(value = "/downloadRepairAdminExcel")
-    @ApiOperation(value = "导出账号数据", notes = "导出账号数据", httpMethod = "GET")
-    void downloadRepairAdminExcel(String account, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException;
-}

+ 0 - 43
src/main/java/com/repair/api/RepairAreaControllerAPI.java

@@ -1,43 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairArea;
-import com.repair.model.request.updateRepairAreaRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairArea")
-@Api(tags = {"RepairAreaController"}, value = "区域")
-public interface RepairAreaControllerAPI {
-
-    @PostMapping(value = "/insertRepairArea")
-    @ApiOperation(value = "添加区域", notes = "添加区域数据", httpMethod = "POST")
-    CommonResult InsertRepairArea(@Validated @RequestBody RepairArea repairArea, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairAreaById")
-    @ApiOperation(value = "编辑区域数据", notes = "编辑区域数据", httpMethod = "POST")
-    CommonResult updateRepairAreaById(@Validated @RequestBody updateRepairAreaRequest ra, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairArea")
-    @ApiOperation(value = "区域分页数据", notes = "区域分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairAreas(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairAreaById")
-    @ApiOperation(value = "根据ID删除指定区域", notes = "根据ID删除指定区域", httpMethod = "GET")
-    CommonResult deleteRepairAreaById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairSchools")
-    @ApiOperation(value = "查询校区数据", notes = "查询校区数据", httpMethod = "GET")
-    CommonResult queryRepairSchools();
-
-    @GetMapping(value = "/queryRepairAreaTree")
-    @ApiOperation(value = "获取区域树形结构数据", notes = "获取区域树形结构数据", httpMethod = "GET")
-    CommonResult queryRepairAreaTree(@RequestParam int schoolId);
-
-    @GetMapping(value = "/queryRepairAreaSecond")
-    @ApiOperation(value = "获取区域二级树形结构", notes = "获取区域二级树形结构", httpMethod = "GET")
-    CommonResult queryRepairAreaSecond(int schoolId);
-}

+ 0 - 43
src/main/java/com/repair/api/RepairArticleTypeControllerAPI.java

@@ -1,43 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairArticleType;
-import com.repair.model.request.updateRepairArticleTypeRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairArticleType")
-@Api(tags = {"RepairArticleTypeController"}, value = "报修故障类型")
-public interface RepairArticleTypeControllerAPI {
-
-    @PostMapping(value = "/insertRepairArticleType")
-    @ApiOperation(value = "添加报修故障类型", notes = "添加报修故障类型数据", httpMethod = "POST")
-    CommonResult InsertRepairArticleType(@Validated @RequestBody RepairArticleType rwt, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairArticleTypeById")
-    @ApiOperation(value = "编辑报修故障类型数据", notes = "编辑报修故障类型数据", httpMethod = "POST")
-    CommonResult updateRepairArticleTypeById(@Validated @RequestBody updateRepairArticleTypeRequest uratr, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairArticleType")
-    @ApiOperation(value = "报修故障类型分页数据", notes = "报修故障类型分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairArticleTypes(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairArticleTypeById")
-    @ApiOperation(value = "根据ID删除指定报修故障类型", notes = "根据ID删除指定报修故障类型", httpMethod = "GET")
-    CommonResult deleteRepairArticleTypeById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairArticleTypeTree")
-    @ApiOperation(value = "获取故障类型树形结构数据", notes = "获取故障类型树形结构数据", httpMethod = "GET")
-    CommonResult queryRepairArticleTypeTree(@RequestParam int schoolId);
-
-    @GetMapping(value = "/queryRepairArticleType")
-    @ApiOperation(value = "物品类型关联", notes = "物品类型关联", httpMethod = "GET")
-    CommonResult queryRepairArticleType(@RequestParam int schoolId);
-
-    @GetMapping(value = "/queryConsumeMaterial")
-    @ApiOperation(value = "关联耗材", notes = "关联耗材", httpMethod = "GET")
-    CommonResult queryConsumeMaterial(@RequestParam int schoolId, String keyWord);
-}

+ 0 - 58
src/main/java/com/repair/api/RepairClassesSettingsControllerAPI.java

@@ -1,58 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.request.insertRepairClassesRequest;
-import com.repair.model.request.updateRepairClassesRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.vo.UserScheduleVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.text.ParseException;
-
-@RequestMapping("/api/repairClassesSettings")
-@Api(tags = {"RepairClassesSettingsController"}, value = "排班")
-public interface RepairClassesSettingsControllerAPI {
-
-    @PostMapping(value = "/insertRepairClassesSettings")
-    @ApiOperation(value = "添加排班", notes = "添加排班数据", httpMethod = "POST")
-    CommonResult InsertRepairClassesSettings(@Validated @RequestBody insertRepairClassesRequest ircr, BindingResult bindingResult) throws ParseException;
-
-    @PostMapping(value = "/updateRepairClassesSettingsById")
-    @ApiOperation(value = "编辑排班数据", notes = "编辑排班数据", httpMethod = "POST")
-    CommonResult updateRepairClassesSettingsById(@Validated @RequestBody updateRepairClassesRequest ra, BindingResult bindingResult) throws ParseException;
-
-    @GetMapping(value = "/queryPageRepairClassesSettings")
-    @ApiOperation(value = "排班分页数据", notes = "排班分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairClassesSettingss(@RequestParam int currentPage, @RequestParam int pageCount, String startTime, String endTime);
-
-    @GetMapping(value = "/downloadRepairClassesExcel")
-    @ApiOperation(value = "导出排班数据", notes = "导出排班数据", httpMethod = "GET")
-    void downloadRepairClassesExcel(String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException;
-
-    @GetMapping(value = "/deleteRepairClassesSettingsById")
-    @ApiOperation(value = "根据ID删除指定排班", notes = "根据ID删除指定排班", httpMethod = "GET")
-    CommonResult deleteRepairClassesSettingsById(@RequestParam int id);
-
-    @PostMapping(value = "/importRepairClassesSettingExcel")
-    @ApiOperation(value = "导入排班数据", notes = "导入排班数据", httpMethod = "POST")
-    CommonResult importRepairClassesSettingExcel(@RequestParam("file") MultipartFile file) throws IOException, ParseException;
-
-    @GetMapping(value = "/downloadRepairClassesSettingExcel")
-    @ApiOperation(value = "导出排班模板", notes = "导出排班模板", httpMethod = "GET")
-    void downloadRepairClassesSettingExcel(HttpServletResponse response);
-
-    @GetMapping(value = "/queryPageUserClasses")
-    @ApiOperation(value = "移动端首页当天排班分页数据", notes = "移动端首页当天排班分页数据", httpMethod = "GET")
-    CommonResult queryPageUserClasses(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int schoolId);
-
-    @PostMapping(value = "/updateUserClasses")
-    @ApiOperation(value = "移动端首页修改或新增当天排班数据", notes = "移动端首页修改或新增当天排班数据", httpMethod = "POST")
-    CommonResult updateUserClasses(@Validated @RequestBody UserScheduleVo usv, BindingResult bindingResult) throws ParseException;
-}

+ 0 - 34
src/main/java/com/repair/api/RepairCloseControllerAPI.java

@@ -1,34 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairClose;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairClose")
-@Api(tags = {"repairCloseController"}, value = "关单原因")
-public interface RepairCloseControllerAPI {
-
-    @PostMapping(value = "/insertRepairClose")
-    @ApiOperation(value = "添加关单原因", notes = "添加关单原因数据", httpMethod = "POST")
-    CommonResult InsertRepairClose(@Validated @RequestBody RepairClose rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairCloseById")
-    @ApiOperation(value = "编辑关单原因数据", notes = "编辑关单原因数据", httpMethod = "POST")
-    CommonResult updateRepairCloseById(@Validated @RequestBody RepairClose rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairClose")
-    @ApiOperation(value = "关单原因分页数据", notes = "关单原因分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairCloses(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairCloseById")
-    @ApiOperation(value = "根据ID删除指定关单原因", notes = "根据ID删除指定关单原因", httpMethod = "GET")
-    CommonResult deleteRepairCloseById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairCloses")
-    @ApiOperation(value = "关单原因数据", notes = "关单原因数据", httpMethod = "GET")
-    CommonResult queryRepairCloses();
-}

+ 0 - 30
src/main/java/com/repair/api/RepairCollaborateRecordControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairCollaborateRecord;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairCollaborateRecord")
-@Api(tags = {"repairCollaborateRecordController"}, value = "协作记录")
-public interface RepairCollaborateRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairCollaborateRecord")
-    @ApiOperation(value = "添加协作记录", notes = "添加协作记录数据", httpMethod = "POST")
-    CommonResult InsertrepairCollaborateRecord(@Validated @RequestBody RepairCollaborateRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairCollaborateRecordById")
-    @ApiOperation(value = "编辑协作记录数据", notes = "编辑协作记录数据", httpMethod = "POST")
-    CommonResult updaterepairCollaborateRecordById(@Validated @RequestBody RepairCollaborateRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairCollaborateRecord")
-    @ApiOperation(value = "协作记录分页数据", notes = "协作记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairCollaborateRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairCollaborateRecordById")
-    @ApiOperation(value = "根据ID删除指定协作记录", notes = "根据ID删除指定协作记录", httpMethod = "GET")
-    CommonResult deleterepairCollaborateRecordById(@RequestParam int id);
-}

+ 0 - 55
src/main/java/com/repair/api/RepairConsumablesControllerAPI.java

@@ -1,55 +0,0 @@
-package com.repair.api;
-
-import com.repair.controller.MaintenanceConsumeablesRequest;
-import com.repair.model.pojo.RepairConsumables;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.InvocationTargetException;
-
-@RequestMapping("/api/repairConsumables")
-@Api(tags = {"repairConsumablesController"}, value = "耗材记录")
-public interface RepairConsumablesControllerAPI {
-
-    @PostMapping(value = "/insertrepairConsumables")
-    @ApiOperation(value = "添加耗材记录", notes = "添加耗材记录数据", httpMethod = "POST")
-    CommonResult InsertrepairConsumables(@Validated @RequestBody RepairConsumables rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairConsumablesById")
-    @ApiOperation(value = "编辑耗材记录数据", notes = "编辑耗材记录数据", httpMethod = "POST")
-    CommonResult updaterepairConsumablesById(@Validated @RequestBody RepairConsumables rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairConsumables")
-    @ApiOperation(value = "耗材记录分页数据", notes = "耗材记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairConsumabless(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairConsumablesById")
-    @ApiOperation(value = "根据ID删除指定耗材记录", notes = "根据ID删除指定耗材记录", httpMethod = "GET")
-    CommonResult deleterepairConsumablesById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairConsumablePageList")
-    @ApiOperation(value = "耗材记录数据", notes = "耗材记录数据", httpMethod = "GET")
-    CommonResult queryRepairConsumablePageList(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord,String startTime,String endTime);
-
-    @GetMapping(value = "/downloadRepairConsumableExcel")
-    @ApiOperation(value = "导出耗材记录数据", notes = "导出耗材记录数据", httpMethod = "GET")
-    void downloadRepairConsumableExcel(String keyWord, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException;
-
-    @PostMapping(value = "/insertMaintenanceConsumables")
-    @ApiOperation(value = "维修师傅报价", notes = "维修师傅报价", httpMethod = "POST")
-    CommonResult InsertMaintenanceConsumables(@Validated @RequestBody MaintenanceConsumeablesRequest data, BindingResult bindingResult) throws Exception;
-
-    @GetMapping(value = "/queryChangePriceConsumables")
-    @ApiOperation(value = "获取改价耗材集合数据", notes = "获取改价耗材集合数据", httpMethod = "GET")
-    CommonResult queryChangePriceConsumables(@RequestParam Integer recordId);
-
-    @PostMapping(value = "/changeMaintenanceConsumables")
-    @ApiOperation(value = "后勤人员改价", notes = "后勤人员改价", httpMethod = "POST")
-    CommonResult changeMaintenanceConsumables(@Validated @RequestBody MaintenanceConsumeablesRequest data, BindingResult bindingResult) throws Exception;
-
-}

+ 0 - 55
src/main/java/com/repair/api/RepairConsumeControllerAPI.java

@@ -1,55 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.request.insertRepairAssociationRequest;
-import com.repair.model.request.insertRepairConsumeRequest;
-import com.repair.model.request.updateRepairConsumeRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.models.auth.In;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-@RequestMapping("/api/repairConsume")
-@Api(tags = {"RepairConsumeController"}, value = "耗材管理")
-public interface RepairConsumeControllerAPI {
-
-    @PostMapping(value = "/insertRepairAssociation")
-    @ApiOperation(value = "关联耗材中添加耗材", notes = "关联耗材中添加耗材", httpMethod = "POST")
-    CommonResult InsertRepairAssociation(@Validated @RequestBody insertRepairAssociationRequest irc, BindingResult bindingResult);
-
-    @PostMapping(value = "/insertRepairConsume")
-    @ApiOperation(value = "添加耗材管理", notes = "添加耗材管理数据", httpMethod = "POST")
-    CommonResult InsertRepairConsume(@Validated @RequestBody insertRepairConsumeRequest rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairConsumeById")
-    @ApiOperation(value = "编辑耗材管理数据", notes = "编辑耗材管理数据", httpMethod = "POST")
-    CommonResult updateRepairConsumeById(@Validated @RequestBody updateRepairConsumeRequest rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairConsume")
-    @ApiOperation(value = "耗材管理分页数据", notes = "耗材管理分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairConsumes(@RequestParam int currentPage, @RequestParam int pageCount, String name, String startTime, String endTime);
-
-    @GetMapping(value = "/deleteRepairConsumeById")
-    @ApiOperation(value = "根据ID删除指定耗材管理", notes = "根据ID删除指定耗材管理", httpMethod = "GET")
-    CommonResult deleteRepairConsumeById(@RequestParam int id);
-
-    @GetMapping(value = "/downloadRepairConsumeExcel")
-    @ApiOperation(value = "导出耗材数据", notes = "导出耗材数据", httpMethod = "GET")
-    void downloadRepairConsumeExcel(String name, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException;
-
-    @GetMapping(value = "/downloadRepairConsumeModelExcel")
-    @ApiOperation(value = "导出耗材模板", notes = "导出耗材模板", httpMethod = "GET")
-    void downloadRepairConsumeModelExcel(HttpServletResponse response);
-
-    @PostMapping(value = "/importRepairConsumeExcel")
-    @ApiOperation(value = "导入耗材数据", notes = "导入耗材数据", httpMethod = "POST")
-    CommonResult importRepairConsumeExcel(@RequestParam("file") MultipartFile file) throws IOException;
-
-}

+ 0 - 30
src/main/java/com/repair/api/RepairDispatchRecordControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairDispatchRecord;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairDispatchRecord")
-@Api(tags = {"repairDispatchRecordController"}, value = "派单记录")
-public interface RepairDispatchRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairDispatchRecord")
-    @ApiOperation(value = "添加派单记录", notes = "添加派单记录数据", httpMethod = "POST")
-    CommonResult InsertrepairDispatchRecord(@Validated @RequestBody RepairDispatchRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairDispatchRecordById")
-    @ApiOperation(value = "编辑派单记录数据", notes = "编辑派单记录数据", httpMethod = "POST")
-    CommonResult updaterepairDispatchRecordById(@Validated @RequestBody RepairDispatchRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairDispatchRecord")
-    @ApiOperation(value = "派单记录分页数据", notes = "派单记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairDispatchRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairDispatchRecordById")
-    @ApiOperation(value = "根据ID删除指定派单记录", notes = "根据ID删除指定派单记录", httpMethod = "GET")
-    CommonResult deleterepairDispatchRecordById(@RequestParam int id);
-}

+ 0 - 33
src/main/java/com/repair/api/RepairEvaluateControllerAPI.java

@@ -1,33 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairEvaluate;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.Date;
-
-@RequestMapping("/api/repairEvaluate")
-@Api(tags = {"RepairEvaluateController"}, value = "评价")
-public interface RepairEvaluateControllerAPI {
-
-    @PostMapping(value = "/insertRepairEvaluate")
-    @ApiOperation(value = "添加评价", notes = "添加评价数据", httpMethod = "POST")
-    CommonResult InsertRepairEvaluate(@Validated @RequestBody RepairEvaluate repairEvaluate, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairEvaluate")
-    @ApiOperation(value = "评价分页数据", notes = "评价分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairEvaluates(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord, String startTime, String endTime);
-
-    @GetMapping(value = "/deleteRepairEvaluateById")
-    @ApiOperation(value = "根据ID删除指定评价", notes = "根据ID删除指定评价", httpMethod = "GET")
-    CommonResult deleteRepairEvaluateById(@RequestParam int id);
-
-    @GetMapping(value = "/toRepairEvaluateExcel")
-    @ApiOperation(value = "导出评价表单", notes = "导出评价表单", httpMethod = "GET")
-    void toRepairEvaluateExcel(HttpServletResponse response, String keyWord, String startTime, String endTime);
-}

+ 0 - 35
src/main/java/com/repair/api/RepairLeaveMessageControllerAPI.java

@@ -1,35 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairLeaveMessage;
-import com.repair.model.request.repairLeaveMessageRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairLeaveMessage")
-@Api(tags = {"repairLeaveMessageController"}, value = "消息留言")
-public interface RepairLeaveMessageControllerAPI {
-
-    @PostMapping(value = "/insertrepairLeaveMessage")
-    @ApiOperation(value = "添加消息留言", notes = "添加消息留言数据", httpMethod = "POST")
-    CommonResult InsertrepairLeaveMessage(@Validated @RequestBody RepairLeaveMessage rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairLeaveMessageById")
-    @ApiOperation(value = "编辑消息留言数据", notes = "编辑消息留言数据", httpMethod = "POST")
-    CommonResult updaterepairLeaveMessageById(@Validated @RequestBody RepairLeaveMessage rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairLeaveMessage")
-    @ApiOperation(value = "消息留言分页数据", notes = "消息留言分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairLeaveMessages(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairLeaveMessageById")
-    @ApiOperation(value = "根据ID删除指定消息留言", notes = "根据ID删除指定消息留言", httpMethod = "GET")
-    CommonResult deleterepairLeaveMessageById(@RequestParam int id);
-
-    @PostMapping(value = "/transferToLogistics")
-    @ApiOperation(value = "转后勤", notes = "转后勤", httpMethod = "POST")
-    CommonResult transferToLogistics(@Validated @RequestBody repairLeaveMessageRequest rlmr, BindingResult bindingResult);
-}

+ 0 - 40
src/main/java/com/repair/api/RepairNoticeSettingControllerAPI.java

@@ -1,40 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairNoticeSetting;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.text.ParseException;
-
-@RequestMapping("/api/repairNoticeSetting")
-@Api(tags = {"RepairNoticeSettingController"}, value = "公告")
-public interface RepairNoticeSettingControllerAPI {
-
-    @PostMapping(value = "/insertRepairNoticeSetting")
-    @ApiOperation(value = "添加公告", notes = "添加公告数据", httpMethod = "POST")
-    CommonResult InsertRepairNoticeSetting(@Validated @RequestBody RepairNoticeSetting repairNoticeSetting, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairNoticeSettingById")
-    @ApiOperation(value = "编辑公告数据", notes = "编辑公告数据", httpMethod = "POST")
-    CommonResult updateRepairNoticeSettingById(@Validated @RequestBody RepairNoticeSetting ra, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairNoticeSetting")
-    @ApiOperation(value = "公告分页数据", notes = "公告分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairNoticeSettings(@RequestParam int currentPage, @RequestParam int pageCount, String createTime) throws ParseException;
-
-    @GetMapping(value = "/cancelOrTopNoticeById")
-    @ApiOperation(value = "取消/置顶公告", notes = "取消/置顶公告置顶", httpMethod = "GET")
-    CommonResult cancelOrTopNoticeById(@RequestParam int id, @RequestParam int is_top);
-
-    @GetMapping(value = "/deleteRepairNoticeSettingById")
-    @ApiOperation(value = "根据ID删除指定公告", notes = "根据ID删除指定公告", httpMethod = "GET")
-    CommonResult deleteRepairNoticeSettingById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairNoticeSettingByTop")
-    @ApiOperation(value = "公告置顶数据", notes = "公告置顶数据", httpMethod = "GET")
-    CommonResult queryRepairNoticeSettingByTop();
-}

+ 0 - 46
src/main/java/com/repair/api/RepairPayRecordControllerAPI.java

@@ -1,46 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairPayRecord;
-import com.repair.model.request.RefundableAmountRequest;
-import com.repair.model.request.repairPayRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairPayRecord")
-@Api(tags = {"repairPayRecordController"}, value = "支付记录")
-public interface RepairPayRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairPayRecord")
-    @ApiOperation(value = "添加支付记录", notes = "添加支付记录数据", httpMethod = "POST")
-    CommonResult InsertrepairPayRecord(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairPayRecordById")
-    @ApiOperation(value = "编辑支付记录数据", notes = "编辑支付记录数据", httpMethod = "POST")
-    CommonResult updaterepairPayRecordById(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairPayRecord")
-    @ApiOperation(value = "支付记录分页数据", notes = "支付记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairPayRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairPayRecordById")
-    @ApiOperation(value = "根据ID删除指定支付记录", notes = "根据ID删除指定支付记录", httpMethod = "GET")
-    CommonResult deleterepairPayRecordById(@RequestParam int id);
-
-    @PostMapping(value = "/repairPayment")
-    @ApiOperation(value = "支付接口", notes = "支付接口", httpMethod = "POST")
-    CommonResult repairPayment(@Validated @RequestBody repairPayRequest rpr, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryProsperityRepairPayRecords")
-    @ApiOperation(value = "支付成功记录分页数据", notes = "支付成功记录分页数据", httpMethod = "GET")
-    CommonResult queryProsperityRepairPayRecords(  @RequestParam int currentPage, @RequestParam int pageCount, String keyWord,String startTime,String endTime);
-
-    @PostMapping(value = "/refundableAmount")
-    @ApiOperation(value = "实退", notes = "实退", httpMethod = "POST")
-    CommonResult refundableAmount(@RequestBody RefundableAmountRequest rar, BindingResult bindingResult);
-
-
-}

+ 0 - 30
src/main/java/com/repair/api/RepairReceivingControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairReceiving;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairReceiving")
-@Api(tags = {"repairReceivingController"}, value = "接单记录")
-public interface RepairReceivingControllerAPI {
-
-    @PostMapping(value = "/insertrepairReceiving")
-    @ApiOperation(value = "添加接单记录", notes = "添加接单记录数据", httpMethod = "POST")
-    CommonResult InsertrepairReceiving(@Validated @RequestBody RepairReceiving rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairReceivingById")
-    @ApiOperation(value = "编辑接单记录数据", notes = "编辑接单记录数据", httpMethod = "POST")
-    CommonResult updaterepairReceivingById(@Validated @RequestBody RepairReceiving rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairReceiving")
-    @ApiOperation(value = "接单记录分页数据", notes = "接单记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairReceivings(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairReceivingById")
-    @ApiOperation(value = "根据ID删除指定接单记录", notes = "根据ID删除指定接单记录", httpMethod = "GET")
-    CommonResult deleterepairReceivingById(@RequestParam int id);
-}

+ 0 - 176
src/main/java/com/repair/api/RepairRecordControllerAPI.java

@@ -1,176 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairRecord;
-import com.repair.model.request.*;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.Date;
-
-
-@RequestMapping("/api/repairRecord")
-@Api(tags = {"RepairRecordController"}, value = "报修记录")
-public interface RepairRecordControllerAPI {
-
-    @PostMapping(value = "/insertRepairRecord")
-    @ApiOperation(value = "提交报修订单", notes = "提交报修订单", httpMethod = "POST")
-    CommonResult InsertRepairRecord(@Validated @RequestBody repairRecordRequest rrr, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/updateRepairRecordById")
-    @ApiOperation(value = "编辑报修记录数据", notes = "编辑报修记录数据", httpMethod = "POST")
-    CommonResult updateRepairRecordById(@Validated @RequestBody RepairRecord ra, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairRecord")
-    @ApiOperation(value = "报修记录分页数据", notes = "报修记录分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairRecordById")
-    @ApiOperation(value = "根据ID删除指定报修记录", notes = "根据ID删除指定报修记录", httpMethod = "GET")
-    CommonResult deleteRepairRecordById(@RequestParam int id);
-
-    @PostMapping(value = "/uploadFile")
-    @ApiOperation(value = "文件上传", notes = "文件上传", httpMethod = "POST")
-    CommonResult uploadFile(@RequestParam("file") MultipartFile file) throws Exception;
-
-    @GetMapping(value = "/revokeRepairRecordById")
-    @ApiOperation(value = "根据ID撤销指定报修记录", notes = "根据ID撤销指定报修记录", httpMethod = "GET")
-    CommonResult revokeRepairRecordById(@RequestParam int id);
-
-    @GetMapping(value = "/getRepairRecordsByUserId")
-    @ApiOperation(value = "根据用户ID获取报修记录", notes = "根据用户ID获取报修记录", httpMethod = "GET")
-    CommonResult getRepairRecordsByUserId(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int state);
-
-    @GetMapping(value = "/getRepairRecordCountByUserId")
-    @ApiOperation(value = "根据用户ID获取报修报修数量", notes = "根据用户ID获取报修报修数量", httpMethod = "GET")
-    CommonResult getRepairRecordCountByUserId(@RequestParam int userId);
-
-    @GetMapping(value = "/getTechnicianCountByUserId")
-    @ApiOperation(value = "根据用户ID获取维修师傅端工单报修数量", notes = "根据用户ID获取维修师傅端工单报修数量", httpMethod = "GET")
-    CommonResult getTechnicianCountByUserId(@RequestParam int userId);
-
-    @GetMapping(value = "/getTechniciansByUserId")
-    @ApiOperation(value = "根据用户ID获取维修师傅报修工单数据", notes = "根据用户ID获取维修师傅报修工单数据", httpMethod = "GET")
-    CommonResult getTechniciansByUserId(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId, @RequestParam int state);
-
-    @GetMapping(value = "/repairRecordReminder")
-    @ApiOperation(value = "催单接口", notes = "催单接口", httpMethod = "GET")
-    CommonResult repairRecordReminder(@RequestParam int recordId);
-
-    @GetMapping(value = "/queryManageCount")
-    @ApiOperation(value = "工单状态数量", notes = "工单状态数量", httpMethod = "GET")
-    CommonResult queryManageCount(Integer schoolId, @RequestHeader("user_head") String userhead);
-
-    @GetMapping(value = "/queryManagePage")
-    @ApiOperation(value = "工单管理工单数据", notes = "工单管理工单数据", httpMethod = "GET")
-    CommonResult queryManagePage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestHeader("user_head") String userhead, @RequestParam int state, String keyWord, String startTime, String endTime, Integer schoolId);
-
-    @GetMapping(value = "/queryPendingOrder")
-    @ApiOperation(value = "待处理池分页数据", notes = "待处理池分页数据", httpMethod = "GET")
-    CommonResult queryPendingOrder(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int userId);
-
-    @GetMapping(value = "/receiveOrders")
-    @ApiOperation(value = "待处理池接单", notes = "待处理池接单", httpMethod = "GET")
-    CommonResult receiveOrders(@RequestParam int recordId, @RequestParam int userId) throws Exception;
-
-    @GetMapping(value = "/receiveOwnOrders")
-    @ApiOperation(value = "维修师傅接单", notes = "维修师傅接单", httpMethod = "GET")
-    CommonResult receiveOwnOrders(@RequestParam int recordId, @RequestParam int userId) throws Exception;
-
-    @GetMapping(value = "/closeOrder")
-    @ApiOperation(value = "关单", notes = "关单", httpMethod = "GET")
-    CommonResult closeOrders(@RequestParam int recordId, @RequestParam String userId, @RequestParam String reason);
-
-    @PostMapping(value = "/finishOrder")
-    @ApiOperation(value = "维修完成", notes = "维修完成", httpMethod = "POST")
-    CommonResult finishOrder(@Validated @RequestBody finishOrderRequest data, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/transferApply")
-    @ApiOperation(value = "转单申请", notes = "转单申请", httpMethod = "POST")
-    CommonResult transferApply(@Validated @RequestBody transferApplyRequest data, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/collaborateApply")
-    @ApiOperation(value = "协作申请", notes = "协作申请", httpMethod = "POST")
-    CommonResult collaborateApply(@Validated @RequestBody collaborateApplyRequest data, BindingResult bindingResult) throws Exception;
-
-    @GetMapping(value = "/queryTeamWorkCount")
-    @ApiOperation(value = "根据校区ID获取团队工单报修数量", notes = "根据校区ID获取团队工单报修数量", httpMethod = "GET")
-    CommonResult queryTeamWorkCount(@RequestParam int schoolId);
-
-    @GetMapping(value = "/queryTeamWorkPage")
-    @ApiOperation(value = "根据校区ID获取团队工单报修分页数据", notes = "根据校区ID获取团队工单报修分页数据", httpMethod = "GET")
-    CommonResult queryTeamWorkPage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int state, @RequestParam int schoolId);
-
-    @PostMapping(value = "/receiveSendOrders")
-    @ApiOperation(value = "派单", notes = "派单", httpMethod = "POST")
-    CommonResult receiveSendOrders(@RequestBody ReceiveSendOrdersRequest rsor, BindingResult bindingResult) throws Exception;
-
-    @GetMapping(value = "/dropDown")
-    @ApiOperation(value = "下拉框", notes = "下拉框", httpMethod = "GET")
-    CommonResult dropDown() throws Exception;
-
-    @GetMapping(value = "/details")
-    @ApiOperation(value = "详情", notes = "详情", httpMethod = "GET")
-    CommonResult details(@RequestParam int recordId) throws Exception;
-
-    @PostMapping(value = "/cooperationOrders")
-    @ApiOperation(value = "协作审核", notes = "协作审核", httpMethod = "POST")
-    CommonResult cooperationOrders(@RequestBody cooperationOrdersRequest cor, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/transfer")
-    @ApiOperation(value = "转单审核", notes = "转单审核", httpMethod = "POST")
-    CommonResult transfer(@RequestBody transferRequest transferRequest,@RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;
-
-    @GetMapping(value = "/cooperationDetail")
-    @ApiOperation(value = "获取协作审核数据", notes = "获取协作审核数据", httpMethod = "GET")
-    CommonResult cooperationDetail(@RequestParam int recordId);
-
-    @GetMapping(value = "/transferDetail")
-    @ApiOperation(value = "获取转单审核数据", notes = "获取转单审核数据", httpMethod = "GET")
-    CommonResult transferDetail(@RequestParam int recordId);
-
-    @GetMapping(value = "/alterPriceShow")
-    @ApiOperation(value = "改价显示", notes = "改价显示", httpMethod = "GET")
-    CommonResult alterPriceShow(@RequestParam int recordId) throws Exception;
-
-    @GetMapping(value = "/alterPriceGoodsType")
-    @ApiOperation(value = "改价物品种类下拉框", notes = "改价物品种类下拉框", httpMethod = "GET")
-    CommonResult alterPriceGoodsType(@RequestParam int schoolId) throws Exception;
-
-    @GetMapping(value = "/alterPriceGoodsName")
-    @ApiOperation(value = "改价耗材名称下拉框", notes = "改价耗材名称下拉框", httpMethod = "GET")
-    CommonResult alterPriceGoodsName(@RequestParam int schoolId, @RequestParam int articleId) throws Exception;
-
-    @PostMapping(value = "/alterPrice")
-    @ApiOperation(value = "改价", notes = "改价", httpMethod = "POST")
-    CommonResult alterPrice(@RequestBody AlterPriceRequest apr, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/delayed")
-    @ApiOperation(value = "延时", notes = "延时", httpMethod = "POST")
-    CommonResult delayed(@RequestBody DelayedRequest dr, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/revert")
-    @ApiOperation(value = "回复", notes = "回复", httpMethod = "POST")
-    CommonResult revert(@RequestBody RevertRequest rr, @RequestHeader("user_head") String userhead, BindingResult bindingResult) throws Exception;
-
-    @PostMapping(value = "/mobileReply")
-    @ApiOperation(value = "移动端回复", notes = "移动端回复", httpMethod = "POST")
-    CommonResult mobileReply(@RequestBody MobileRevertRequest mrr, BindingResult bindingResult) throws Exception;
-
-    @GetMapping(value = "/reportExport")
-    @ApiOperation(value = "报表导出", notes = "报表导出", httpMethod = "GET")
-    void reportExport(HttpServletResponse response,String keyWord, String startTime, String endTime, Integer schoolId, @RequestParam Integer state, @RequestHeader("user_head") String userhead) throws Exception;
-
-    @GetMapping(value = "/queryMasterHomeCount")
-    @ApiOperation(value = "维修师傅首页头部数量", notes = "维修师傅首页头部数量", httpMethod = "GET")
-    CommonResult queryMasterHomeCount(@RequestParam int userId);
-
-    @GetMapping(value = "/queryLogisticHomeCount")
-    @ApiOperation(value = "郭师傅和后勤首页头部数量", notes = "郭师傅和后勤首页头部数量", httpMethod = "GET")
-    CommonResult queryLogisticHomeCount(@RequestParam int schoolId);
-}

+ 0 - 30
src/main/java/com/repair/api/RepairRefundRecordControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairRefundRecord;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairRefundRecord")
-@Api(tags = {"repairRefundRecordController"}, value = "退款记录")
-public interface RepairRefundRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairRefundRecord")
-    @ApiOperation(value = "添加退款记录", notes = "添加退款记录数据", httpMethod = "POST")
-    CommonResult InsertrepairRefundRecord(@Validated @RequestBody RepairRefundRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairRefundRecordById")
-    @ApiOperation(value = "编辑退款记录数据", notes = "编辑退款记录数据", httpMethod = "POST")
-    CommonResult updaterepairRefundRecordById(@Validated @RequestBody RepairRefundRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairRefundRecord")
-    @ApiOperation(value = "退款记录分页数据", notes = "退款记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairRefundRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairRefundRecordById")
-    @ApiOperation(value = "根据ID删除指定退款记录", notes = "根据ID删除指定退款记录", httpMethod = "GET")
-    CommonResult deleterepairRefundRecordById(@RequestParam int id);
-}

+ 0 - 30
src/main/java/com/repair/api/RepairSchoolControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairSchool;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairSchool")
-@Api(tags = {"RepairSchoolController"}, value = "校区")
-public interface RepairSchoolControllerAPI {
-
-    @PostMapping(value = "/insertRepairSchool")
-    @ApiOperation(value = "添加校区", notes = "添加校区数据", httpMethod = "POST")
-    CommonResult InsertRepairSchool(@Validated @RequestBody RepairSchool repairSchool, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairSchoolById")
-    @ApiOperation(value = "编辑校区数据", notes = "编辑校区数据", httpMethod = "POST")
-    CommonResult updateRepairSchoolById(@Validated @RequestBody RepairSchool ra, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairSchool")
-    @ApiOperation(value = "校区分页数据", notes = "校区分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairSchools(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairSchoolById")
-    @ApiOperation(value = "根据ID删除指定校区", notes = "根据ID删除指定校区", httpMethod = "GET")
-    CommonResult deleteRepairSchoolById(@RequestParam int id);
-}

+ 0 - 34
src/main/java/com/repair/api/RepairShiftSettingsControllerAPI.java

@@ -1,34 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairShiftSettings;
-import com.repair.model.request.insertRepairShiftSettingRequest;
-import com.repair.model.request.updateRepairShiftRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.text.ParseException;
-
-@RequestMapping("/api/repairShiftSettings")
-@Api(tags = {"RepairShiftSettingsController"}, value = "班次")
-public interface RepairShiftSettingsControllerAPI {
-
-    @PostMapping(value = "/insertRepairShiftSettings")
-    @ApiOperation(value = "添加班次", notes = "添加班次数据", httpMethod = "POST")
-    CommonResult InsertRepairShiftSettings(@Validated @RequestBody insertRepairShiftSettingRequest irssr, BindingResult bindingResult) throws ParseException;
-
-    @PostMapping(value = "/updateRepairShiftSettingsById")
-    @ApiOperation(value = "编辑班次数据", notes = "编辑班次数据", httpMethod = "POST")
-    CommonResult updateRepairShiftSettingsById(@Validated @RequestBody updateRepairShiftRequest ra, BindingResult bindingResult) throws ParseException;
-
-    @GetMapping(value = "/queryPageRepairShiftSettings")
-    @ApiOperation(value = "班次分页数据", notes = "班次分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairShiftSettingss(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairShiftSettingsById")
-    @ApiOperation(value = "根据ID删除指定班次", notes = "根据ID删除指定班次", httpMethod = "GET")
-    CommonResult deleteRepairShiftSettingsById(@RequestParam int id);
-}

+ 0 - 30
src/main/java/com/repair/api/RepairSystemMessagesControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairSystemMessages;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairSystemMessages")
-@Api(tags = {"repairSystemMessagesController"}, value = "系统信息")
-public interface RepairSystemMessagesControllerAPI {
-
-    @PostMapping(value = "/insertrepairSystemMessages")
-    @ApiOperation(value = "添加系统信息", notes = "添加系统信息数据", httpMethod = "POST")
-    CommonResult InsertrepairSystemMessages(@Validated @RequestBody RepairSystemMessages rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairSystemMessagesById")
-    @ApiOperation(value = "编辑系统信息数据", notes = "编辑系统信息数据", httpMethod = "POST")
-    CommonResult updaterepairSystemMessagesById(@Validated @RequestBody RepairSystemMessages rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairSystemMessages")
-    @ApiOperation(value = "系统信息分页数据", notes = "系统信息分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairSystemMessagess(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairSystemMessagesById")
-    @ApiOperation(value = "根据ID删除指定系统信息", notes = "根据ID删除指定系统信息", httpMethod = "GET")
-    CommonResult deleterepairSystemMessagesById(@RequestParam int id);
-}

+ 0 - 26
src/main/java/com/repair/api/RepairSystemSettingControllerAPI.java

@@ -1,26 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairSystemSetting;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairSystemSetting")
-@Api(tags = {"RepairSystemSettingController"}, value = "系统设置")
-public interface RepairSystemSettingControllerAPI {
-
-    @GetMapping(value = "/queryRepairSystemSetting")
-    @ApiOperation(value = "获取系统设置", notes = "获取系统设置数据", httpMethod = "GET")
-    CommonResult QueryRepairSystemSetting();
-
-    @PostMapping(value = "/insertRepairSystemSetting")
-    @ApiOperation(value = "添加系统设置", notes = "添加系统设置数据", httpMethod = "POST")
-    CommonResult InsertRepairSystemSetting(@Validated @RequestBody RepairSystemSetting repairSystemSetting, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairSystemSettingById")
-    @ApiOperation(value = "编辑系统设置数据", notes = "编辑系统设置数据", httpMethod = "POST")
-    CommonResult updateRepairSystemSettingById(@Validated @RequestBody RepairSystemSetting ra, BindingResult bindingResult);
-}

+ 0 - 30
src/main/java/com/repair/api/RepairTrackRecordControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairTrackRecord;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairTrackRecord")
-@Api(tags = {"repairTrackRecordController"}, value = "跟踪记录")
-public interface RepairTrackRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairTrackRecord")
-    @ApiOperation(value = "添加跟踪记录", notes = "添加跟踪记录数据", httpMethod = "POST")
-    CommonResult InsertrepairTrackRecord(@Validated @RequestBody RepairTrackRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairTrackRecordById")
-    @ApiOperation(value = "编辑跟踪记录数据", notes = "编辑跟踪记录数据", httpMethod = "POST")
-    CommonResult updaterepairTrackRecordById(@Validated @RequestBody RepairTrackRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairTrackRecord")
-    @ApiOperation(value = "跟踪记录分页数据", notes = "跟踪记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairTrackRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairTrackRecordById")
-    @ApiOperation(value = "根据ID删除指定跟踪记录", notes = "根据ID删除指定跟踪记录", httpMethod = "GET")
-    CommonResult deleterepairTrackRecordById(@RequestParam int id);
-}

+ 0 - 30
src/main/java/com/repair/api/RepairTransferRecordControllerAPI.java

@@ -1,30 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairTransferRecord;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairTransferRecord")
-@Api(tags = {"repairTransferRecordController"}, value = "转单记录")
-public interface RepairTransferRecordControllerAPI {
-
-    @PostMapping(value = "/insertrepairTransferRecord")
-    @ApiOperation(value = "添加转单记录", notes = "添加转单记录数据", httpMethod = "POST")
-    CommonResult InsertrepairTransferRecord(@Validated @RequestBody RepairTransferRecord rc, BindingResult bindingResult);
-
-    @PostMapping(value = "/updaterepairTransferRecordById")
-    @ApiOperation(value = "编辑转单记录数据", notes = "编辑转单记录数据", httpMethod = "POST")
-    CommonResult updaterepairTransferRecordById(@Validated @RequestBody RepairTransferRecord rc, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPagerepairTransferRecord")
-    @ApiOperation(value = "转单记录分页数据", notes = "转单记录分页数据", httpMethod = "GET")
-    CommonResult queryPagerepairTransferRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleterepairTransferRecordById")
-    @ApiOperation(value = "根据ID删除指定转单记录", notes = "根据ID删除指定转单记录", httpMethod = "GET")
-    CommonResult deleterepairTransferRecordById(@RequestParam int id);
-}

+ 0 - 57
src/main/java/com/repair/api/RepairUserControllerAPI.java

@@ -1,57 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.request.insertRepairUserRequest;
-import com.repair.model.request.updateAddressBookRequest;
-import com.repair.model.request.updateUserDataRequest;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairUser")
-@Api(tags = {"RepairUserController"}, value = "用户")
-public interface RepairUserControllerAPI {
-
-    @PostMapping(value = "/insertRepairUserSetting")
-    @ApiOperation(value = "添加用户", notes = "添加用户数据", httpMethod = "POST")
-    CommonResult InsertRepairUser(@Validated @RequestBody insertRepairUserRequest irur, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairUserSettingById")
-    @ApiOperation(value = "编辑用户数据", notes = "编辑用户数据", httpMethod = "POST")
-    CommonResult updateRepairUserById(@Validated @RequestBody updateUserDataRequest ra, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairUser")
-    @ApiOperation(value = "用户分页数据", notes = "用户分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairUser(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord, Integer teamId, Integer schoolId);
-
-    @GetMapping(value = "/deleteRepairUserSettingById")
-    @ApiOperation(value = "根据ID删除指定用户", notes = "根据ID删除指定用户", httpMethod = "GET")
-    CommonResult deleteRepairUserById(@RequestParam int id);
-
-    @GetMapping(value = "/queryRepairUserByCardNumber")
-    @ApiOperation(value = "根据卡号删除指定用户", notes = "根据卡号删除指定用户", httpMethod = "GET")
-    CommonResult queryRepairUserByCardNumber(@RequestParam String cardNumber);
-
-    @GetMapping(value = "/queryPageRepairUsers")
-    @ApiOperation(value = "获取派单的人员分页数据", notes = "获取派单的人员分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairUsers(@RequestParam int currentPage, @RequestParam int pageCount, Integer recordId, String keyWord);
-
-
-    @GetMapping(value = "/getAddressBook")
-    @ApiOperation(value = "获取通讯录列表数据", notes = "获取通讯录列表数据", httpMethod = "GET")
-    CommonResult getAddressBook(@RequestParam Integer schoolId,@RequestParam Integer userId, String keyWord);
-
-    @PostMapping(value = "/updateAddressBook")
-    @ApiOperation(value = "通讯录编辑数据", notes = "通讯录编辑数据", httpMethod = "POST")
-    CommonResult updateAddressBook(@Validated @RequestBody updateAddressBookRequest uabp, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageCollaborator")
-    @ApiOperation(value = "获取协作审核下拉人员分页数据", notes = "获取协作审核下拉人员分页数据", httpMethod = "GET")
-    CommonResult queryPageCollaborator(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam Integer schoolId,@RequestParam Integer userId);
-
-    @GetMapping(value = "/queryPositiveReviewPage")
-    @ApiOperation(value = "工单完成排行榜分页数据", notes = "工单完成排行榜分页数据", httpMethod = "GET")
-    CommonResult queryPositiveReviewPage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam Integer schoolId);
-}

+ 0 - 43
src/main/java/com/repair/api/RepairWorkTypeControllerAPI.java

@@ -1,43 +0,0 @@
-package com.repair.api;
-
-import com.repair.model.pojo.RepairWorkType;
-import com.repair.model.result.CommonResult;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-@RequestMapping("/api/repairWorkType")
-@Api(tags = {"RepairWorkTypeController"}, value = "工种")
-public interface RepairWorkTypeControllerAPI {
-
-    @PostMapping(value = "/insertRepairWorkType")
-    @ApiOperation(value = "添加工种", notes = "添加工种数据", httpMethod = "POST")
-    CommonResult InsertRepairWorkType(@Validated @RequestBody RepairWorkType rwt, BindingResult bindingResult);
-
-    @PostMapping(value = "/updateRepairWorkTypeById")
-    @ApiOperation(value = "编辑工种数据", notes = "编辑工种数据", httpMethod = "POST")
-    CommonResult updateRepairWorkTypeById(@Validated @RequestBody RepairWorkType rwt, BindingResult bindingResult);
-
-    @GetMapping(value = "/queryPageRepairWorkType")
-    @ApiOperation(value = "工种分页数据", notes = "工种分页数据", httpMethod = "GET")
-    CommonResult queryPageRepairWorkTypes(@RequestParam int currentPage, @RequestParam int pageCount, String name);
-
-    @GetMapping(value = "/deleteRepairWorkTypeById")
-    @ApiOperation(value = "根据ID删除指定工种", notes = "根据ID删除指定工种", httpMethod = "GET")
-    CommonResult deleteRepairWorkTypeById(@RequestParam int id);
-
-    @GetMapping(value = "/getRepairWorkTypes")
-    @ApiOperation(value = "查询工种列表", notes = "查询工种列表", httpMethod = "GET")
-    CommonResult getRepairWorkTypes();
-
-    @GetMapping(value = "/getReceivingState")
-    @ApiOperation(value = "接单状态数据列表", notes = "接单状态数据列表", httpMethod = "GET")
-    CommonResult getReceivingState();
-
-    @GetMapping(value = "/getRepaairIdentitys")
-    @ApiOperation(value = "查询身份列表", notes = "查询身份列表", httpMethod = "GET")
-    CommonResult getRepairIdentitys();
-
-}

+ 0 - 199
src/main/java/com/repair/common/utils/AesUtils.java

@@ -1,199 +0,0 @@
-package com.repair.common.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.bouncycastle.util.encoders.Base64;
-
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.spec.SecretKeySpec;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * @Author: liujun
- * @Description: Aes 加解密算法
- * @Date Create in 上午 9:38$ 2017/12/26 0026$
- * @Modify By:
- */
-@Slf4j
-public class AesUtils {
-    private static String password = "52D04DC20036DBD8";
-    /**
-     * @Author liujun
-     * @Description:
-     * @params: * @param content 需要加密的内容
-     * @param password  加密密码
-     * @Date 上午 9:41 2017/12/26 0026
-     */
-    public static String encrypt(String content) {
-
-        if(password.length()<16) {
-            password = password + "0000000000000000".substring(0, 16-password.length());
-        }
-        else if(password.length()>16) {
-            password = password.substring(0, 16);
-        }
-
-        return bytes2HexString(encryptAES(content.getBytes(), password.getBytes()));
-    }
-
-
-    /**
-     * @Author liujun
-     * @Description:
-     * @params: * @param content 待解密内容
-     * @param password 解密密钥
-     * @Date 上午 9:40 2017/12/26 0026
-     */
-    public static String decrypt(String content) {
-        if(password.length()<16) {
-            password = password + "0000000000000000".substring(0, 16-password.length());
-        }
-        else if(password.length()>16) {
-            password = password.substring(0, 16);
-        }
-
-        return new String(decryptAES(hexString2Bytes(content), password.getBytes()));
-    }
-
-    /**
-     * AES 加密
-     *
-     * @param data 明文
-     * @param key  16、24、32 字节秘钥
-     * @return 密文
-     */
-    public static byte[] encryptAES(final byte[] data, final byte[] key) {
-
-        try {
-            SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES");
-            Cipher cipher = Cipher.getInstance("AES");// 创建密码器
-            byte[] byteContent = data;
-            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);// 初始化
-            byte[] result = cipher.doFinal(byteContent);
-            return result; // 加密
-        } catch (NoSuchAlgorithmException e) {
-            log.error(e.getMessage(),e);
-        } catch (NoSuchPaddingException e) {
-            log.error(e.getMessage(),e);
-        } catch (InvalidKeyException e) {
-            log.error(e.getMessage(),e);
-        } catch (IllegalBlockSizeException e) {
-            log.error(e.getMessage(),e);
-        } catch (BadPaddingException e) {
-            log.error(e.getMessage(),e);
-        } catch (Exception e) {
-            log.error(e.getMessage(),e);
-        }
-        return null;
-    }
-
-    /**
-     * AES 解密
-     *
-     * @param data 密文
-     * @param key  16、24、32 字节秘钥
-     * @return 明文
-     */
-    public static byte[] decryptAES(final byte[] data, final byte[] key) {
-
-        try {
-            SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES");
-            Cipher cipher = Cipher.getInstance("AES");// 创建密码器
-            cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);// 初始化
-            byte[] result = cipher.doFinal(data);
-            return result; // 加密
-        } catch (NoSuchAlgorithmException e) {
-            log.error(e.getMessage(),e);
-        } catch (NoSuchPaddingException e) {
-            log.error(e.getMessage(),e);
-        } catch (InvalidKeyException e) {
-            log.error(e.getMessage(),e);
-        } catch (IllegalBlockSizeException e) {
-            log.error(e.getMessage(),e);
-        } catch (BadPaddingException e) {
-            log.error(e.getMessage(),e);
-        } catch (Exception e) {
-            log.error(e.getMessage(),e);
-        }
-        return null;
-    }
-
-    public static String bytes2HexString(final byte[] bytes) {
-        if (bytes == null) return null;
-        int len = bytes.length;
-        if (len <= 0) return null;
-        char[] ret = new char[len << 1];
-        for (int i = 0, j = 0; i < len; i++) {
-            ret[j++] = hexDigits[bytes[i] >>> 4 & 0x0f];
-            ret[j++] = hexDigits[bytes[i] & 0x0f];
-        }
-        return new String(ret);
-    }
-
-    private static final char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-
-    public static byte[] hexString2Bytes(String hexString) {
-        if (isSpace(hexString)) return null;
-        int len = hexString.length();
-        if (len % 2 != 0) {
-            hexString = "0" + hexString;
-            len = len + 1;
-        }
-        char[] hexBytes = hexString.toUpperCase().toCharArray();
-        byte[] ret = new byte[len >> 1];
-        for (int i = 0; i < len; i += 2) {
-            ret[i >> 1] = (byte) (hex2Dec(hexBytes[i]) << 4 | hex2Dec(hexBytes[i + 1]));
-        }
-        return ret;
-    }
-
-    private static int hex2Dec(final char hexChar) {
-        if (hexChar >= '0' && hexChar <= '9') {
-            return hexChar - '0';
-        } else if (hexChar >= 'A' && hexChar <= 'F') {
-            return hexChar - 'A' + 10;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    public static byte[] base64Encode(final byte[] input) {
-        return Base64.encode(input);
-    }
-
-    public static byte[] base64Decode(final byte[] input) {
-
-        return Base64.decode(input);
-    }
-
-    private static boolean isSpace(final String s) {
-        if (s == null) return true;
-        for (int i = 0, len = s.length(); i < len; ++i) {
-            if (!Character.isWhitespace(s.charAt(i))) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public static void main(String[] args) {
-        String s="{\n" +
-                "  \"categoryId\": \"72cf28a8789643bbbbb62d08ee91f17e\",\n" +
-                "     \"luid\": \"80A036D93CFB\",\n" +
-                "     \"type\":\"4\",\n" +
-                "     \"userName\":\"13097286670\",\n" +
-                "     \"startTime\":\"1682389484000\",\n" +
-                "     \"endTime\":\"1684981484000\",\n" +
-                "     \"password\":\"A08E87B5E777EBEE2C6EF3262F069D5A\"\n" +
-                "}";
-        //加密
-        String encryptString = AesUtils.encrypt("548903");
-        System.out.println("加密后字符串:"+encryptString);
-        //解密
-        String decryptString = AesUtils.decrypt(encryptString);
-        System.out.println("解密后字符串:"+decryptString);
-    }
-}

+ 0 - 30
src/main/java/com/repair/common/utils/DateUtils.java

@@ -1,30 +0,0 @@
-package com.repair.common.utils;
-
-import java.text.SimpleDateFormat;
-import java.time.Duration;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-
-public class DateUtils {
-
-//    计算时差
-   public static String difference(Date start,Date end){
-       SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-       String time1 = sdf.format(start);
-       String time2 = sdf.format(end);
-
-       DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-       LocalDateTime dateTime1 = LocalDateTime.parse(time1, formatter);
-       LocalDateTime dateTime2 = LocalDateTime.parse(time2, formatter);
-       Duration duration = Duration.between(dateTime1, dateTime2);
-
-       long days = duration.toDays();
-       long hours = duration.toHours() % 24;
-       long minutes = duration.toMinutes() % 60;
-       long seconds = duration.getSeconds() % 60;
-//       System.out.println("时间差为:" + days + "天 " + hours + "小时 " + minutes + "分钟 " + seconds + "秒");
-       return days + "天 " + hours + "小时 " + minutes + "分钟 " + seconds + "秒";
-   }
-
-}

+ 1 - 1
src/main/java/com/repair/common/utils/DelayedUtils.java

@@ -1,7 +1,7 @@
 package com.repair.common.utils;
 
 import com.repair.model.pojo.RepairShiftSettings;
-import com.repair.model.request.timeVo;
+import com.repair.model.vo.timeVo;
 import lombok.SneakyThrows;
 
 import java.text.ParseException;

+ 15 - 0
src/main/java/com/repair/common/utils/DictionaryCompare.java

@@ -0,0 +1,15 @@
+package com.repair.common.utils;
+
+import java.util.Comparator;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/8/21 星期一 14:51
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+public class DictionaryCompare implements Comparator<String> {
+    public int compare(String o1, String o2) {
+        return o1.compareTo(o2);
+    }
+}

+ 0 - 41
src/main/java/com/repair/common/utils/EncryptionUtil.java

@@ -1,41 +0,0 @@
-package com.repair.common.utils;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class EncryptionUtil {
-
-
-    private static final int MAX_JSON_STRING = 40;
-
-    /**
-     * 将需要加密的字段分批加密
-     *
-     * @param jsonString
-     * @param publicKey
-     * @return
-     * @throws Exception
-     */
-    public Map<Object, Object> encryption(String jsonString, String publicKey) throws Exception {
-        int length = jsonString.length();
-        int offset = 0;
-        int i = 0;
-        HashMap<Object, Object> map = new HashMap<>();
-//        判断字符串长度是否大于40,大于就截取前40位,分批加密
-        while (length - offset > 0) {
-            if (length - offset > MAX_JSON_STRING) {
-                String substring = jsonString.substring(offset, offset + MAX_JSON_STRING);
-                String encrypt = RSAUtils.encrypt(substring, RSAUtils.getPublicKey(publicKey));
-                map.put(i, encrypt);
-            } else {
-                String substring = jsonString.substring(offset,length);
-                String encrypt = RSAUtils.encrypt(substring, RSAUtils.getPublicKey(publicKey));
-                map.put(i, encrypt);
-            }
-            i++;
-            offset = i * MAX_JSON_STRING;
-        }
-        return map;
-    }
-}

+ 0 - 253
src/main/java/com/repair/common/utils/ExcelExportUtil.java

@@ -1,253 +0,0 @@
-package com.repair.common.utils;
-
-import org.apache.poi.hpsf.Decimal;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.xssf.usermodel.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.util.*;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/19 星期三 9:38
- * @Description: com.chuanghai.attendance.utils.excel
- * @Version: 1.0
- */
-public class ExcelExportUtil {
-
-    /**
-     * 将 List<Map<String,Object>> 类型的数据导出为 Excel
-     */
-    public static void  createExcel(List<Map<String, Object>> mapList, String filename, String title, HttpServletResponse response) {
-        //获取数据源的 key, 用于获取列数及设置标题
-        Map<String, Object> map = mapList.get(0);
-        Set<String> stringSet = map.keySet();
-        ArrayList<String> headList = new ArrayList<>(stringSet);
-
-        //定义一个新的工作簿
-        XSSFWorkbook wb = new XSSFWorkbook();
-        //创建一个Sheet页
-        XSSFSheet sheet = wb.createSheet(title);
-        //设置行高
-        sheet.setDefaultRowHeight((short) (2 * 256));
-        //为有数据的每列设置列宽
-        for (int i = 0; i < headList.size(); i++) {
-            sheet.setColumnWidth(i, 8000);
-        }
-        //设置单元格字体样式
-        XSSFFont font = wb.createFont();
-        font.setFontName("等线");
-        font.setFontHeightInPoints((short) 16);
-
-        //在sheet里创建第一行,并设置单元格内容为 title (标题)
-//        XSSFRow titleRow = sheet.createRow(0);
-//        XSSFCell titleCell = titleRow.createCell(0);
-//        titleCell.setCellValue(title);
-        //合并单元格CellRangeAddress构造参数依次表示起始行,截至行,起始列, 截至列
-//        sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1));
-//        // 创建单元格文字居中样式并设置标题单元格居中
-//        XSSFCellStyle cellStyle = wb.createCellStyle();
-//        cellStyle.setAlignment(HorizontalAlignment.CENTER);
-//        titleCell.setCellStyle(cellStyle);
-
-        //获得表格第二行
-        XSSFRow row = sheet.createRow(0);
-        //根据数据源信息给第二行每一列设置标题
-        for (int i = 0; i < headList.size(); i++) {
-            XSSFCell cell = row.createCell(i);
-            cell.setCellValue(headList.get(i));
-        }
-
-        XSSFRow rows;
-        XSSFCell cells;
-        //循环拿到的数据给所有行每一列设置对应的值
-        for (int i = 0; i < mapList.size(); i++) {
-            //在这个sheet页里创建一行
-            rows = sheet.createRow(i + 1);
-            //给该行数据赋值
-            for (int j = 0; j < headList.size(); j++) {
-                String value;
-                if (mapList.get(i).get(headList.get(j)) !=null){
-                    value = mapList.get(i).get(headList.get(j)).toString();
-                }else {
-                    value = "";
-                }
-                cells = rows.createCell(j);
-                cells.setCellValue(value);
-            }
-        }
-
-        try {
-            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");//application/vnd.ms-excel");
-            response.setHeader("Content-Disposition", "attachment;filename=".concat(filename));
-            OutputStream out = response.getOutputStream();
-
-            wb.write(out);
-            wb.close();
-            out.close();;
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @description 考虑到下载方式的不同 这里细化成只获取一个workBook 格式为默认 无格式
-     * @param list 需要存储为excel的对象集合
-     * @param map 键值对映射 属性 - 表头字段  类似于: name - 姓名
-     * @param type 生成workbook的类型
-     * @param tableName 生成Sheet的名称
-     * @param orderList 表头顺序对应的属性list
-     * @return org.apache.poi.ss.usermodel.Workbook
-     **/
-    public static <T> Workbook createWorkbook(
-            List<T> list , //数据库查询的返回List
-            Map<String , String> map , //表头映射
-            Integer type , //生成workbook的类型 0 - xls 其他-xlsx
-            String tableName , //表名
-            List<String> orderList //排序的List 为空 则使用默认的顺序
-    ) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
-        //工作簿
-        Workbook workbook = getWorkbookByType(type);
-        //单个表
-        Sheet sheet = workbook.createSheet(tableName);
-
-        //orderList 表头顺序,可以为空
-        if(orderList == null || orderList.size() == 0) {
-            orderList = new ArrayList<>();
-            //获取map映射的顺序
-            for (Map.Entry<String, String> mapEntry : map.entrySet()) {
-                orderList.add(mapEntry.getKey());
-            }
-        }
-        //每列对应的属性参数
-        List<Class> typeClassList = getParamsType(list.get(0).getClass(), orderList);
-
-        //设置表头的值
-        Row headRow = sheet.createRow(0);
-        for (int i = 0; i < orderList.size(); i++) {
-            Cell cell = headRow.createCell(i);
-            //设置单元格的属性
-            cell.setCellValue(map.get(orderList.get(i)));
-        }
-
-        int index = 1;
-        //单元行
-        Row dataRow = null;
-        //单元格
-        Cell dataCell = null;
-        //遍历List
-        for (T t : list) {
-            //获取一行
-            dataRow = sheet.createRow(index);
-            //遍历表头对应属性,给一行数据设置值
-            for (int j = 0; j < orderList.size(); j++) {
-                //获取一个单元格
-                dataCell = dataRow.createCell(j);
-                //根据对应列的属性 设置对应的值类型及值
-                setCellValueTypeAndValue(dataCell , typeClassList.get(j) ,
-                        t.getClass().getMethod(getGetterMethodName(orderList.get(j)) , new Class[]{})
-                                .invoke(t , new Class[]{}));
-            }
-            //行下标后移
-            index++;
-        }
-        //设置值
-        return workbook;
-    }
-
-    /**
-     * @description 根据所给的type获取对应的工作簿 0-HSSFWorkbook 其他-XSSFWorkbook
-     * @author 三文鱼先生
-     * @date 10:41 2022/8/26
-     * @param type 类型
-     * @return org.apache.poi.ss.usermodel.Workbook
-     **/
-    public static Workbook getWorkbookByType(Integer type) {
-        if(type == null || type == 0)
-            return new HSSFWorkbook();
-        else
-            return new XSSFWorkbook();
-    }
-
-    /**
-     * @description 根据属性的List获取对应的类型List
-     * @author 三文鱼先生
-     * @date 10:37 2022/8/26
-     * @param cs 对应的类
-     * @param paramsList 对应的属性list
-     * @return java.util.List<java.lang.Class>
-     **/
-    public static List<Class> getParamsType(Class cs , List<String> paramsList) {
-        List<Class> typeClass = new ArrayList<>();
-        //对象的所有属性
-        Field[] fields = cs.getDeclaredFields();
-        //临时的属性 - 类型映射
-        Map<String , Class> map = new HashMap();
-        //获取属性名称及类型
-        for (Field field : fields) {
-            map.put(field.getName(), field.getType());
-        }
-        //遍历属性List获取对应的类型List
-        for (String s : paramsList) {
-            typeClass.add(map.get(s));
-        }
-        return typeClass;
-    }
-
-    /**
-     * @description 根据对应的类型 给单元格设置类型和值
-     * @author 三文鱼先生
-     * @date 10:32 2022/8/26
-     * @param cell 单元格
-     * @param cs 属性的类型
-     * @param o get方法获取到的对象
-     * @return void
-     **/
-    public static  void setCellValueTypeAndValue(Cell cell , Class cs , Object o) {
-
-        if(Boolean.class.equals(cs) || boolean.class.equals(cs)) {
-            //boolean类型
-            cell.setCellValue((Boolean) o);
-        } else if (int.class.equals(cs) || Integer.class.equals(cs)) {
-            //int类型
-            cell.setCellValue((Integer) o);
-        } else if(double.class.equals(cs) || Double.class.equals(cs)) {
-            //浮点数类型 也可以是float类型什么的
-            cell.setCellValue((Double) o);
-        }else if(BigDecimal.class.equals(cs) || Decimal.class.equals(cs)){
-            //金钱类型
-            cell.setCellValue(((BigDecimal) o).toString());
-        } else if(LocalDate.class.equals(cs) || Date.class.equals(cs)){
-            //日期类型
-            cell.setCellValue(((LocalDate) o).toString());
-        } else {
-            //默认为字符串类型
-            cell.setCellValue((String) o);
-        }
-    }
-
-    /**
-     * @description 根据属性名称获取对应的get方法
-     * @author 三文鱼先生
-     * @date 10:38 2022/8/26
-     * @param param 属性名称
-     * @return java.lang.String
-     **/
-    public static String getGetterMethodName(String param) {
-        char[] chars = param.toCharArray();
-        //首字母大写
-        if(Character.isLowerCase(chars[0])) {
-            chars[0] -= 32;
-        }
-        //拼接get方法
-        return "get" + new String(chars);
-    }
-}

+ 0 - 65
src/main/java/com/repair/common/utils/ExcelUtils.java

@@ -1,65 +0,0 @@
-package com.repair.common.utils;
-
-import com.repair.model.result.CommonResult;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.boot.system.ApplicationHome;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/10 星期一 14:21
- * @Description: com.repair.common.utils
- * @Version: 1.0
- */
-@Slf4j
-public class ExcelUtils {
-    public static void fileDownload(String fileName, HttpServletResponse response) {
-        try {
-            ApplicationHome applicationHome = new ApplicationHome(ExcelUtils.class);
-            String pathResouce = applicationHome.getDir().getParentFile().getParentFile().getAbsolutePath();
-            String decode = URLDecoder.decode(pathResouce, "utf-8");
-            File readPath = new File(decode + "/project/repair" + File.separator);
-            File file = new File(readPath.getAbsolutePath() + fileName);
-            // 获取文件名
-            String filename = file.getName();
-            // 获取文件后缀名
-            String ext = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
-            InputStream inputStream = new FileInputStream(file);//根据路径获取要下载的文件输入流
-            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-            response.setCharacterEncoding("utf-8");
-            response.setHeader("Content-disposition", "attachment;fileName=" + URLEncoder.encode(filename, "UTF-8"));
-            OutputStream out = response.getOutputStream();
-            byte[] b = new byte[1024];  //创建数据缓冲区
-            int length;
-            while ((length = inputStream.read(b)) > 0) {  //把文件流写到缓冲区里
-                out.write(b, 0, length);
-            }
-            out.flush();
-            out.close();
-            inputStream.close();
-        } catch (IOException ex) {
-            System.out.println("模板导出失败:" + ex.getMessage());
-            ex.printStackTrace();
-        }
-    }
-
-    public static void excelDownload(Workbook workbook, String fileName, HttpServletResponse response) {
-        try {
-            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-            response.setCharacterEncoding("utf-8");
-            response.setHeader("Content-disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
-            OutputStream out = response.getOutputStream();
-            workbook.write(out);
-            out.flush();
-            out.close();
-        } catch (IOException ex) {
-            System.out.println("模板导出失败:" + ex.getMessage());
-            ex.printStackTrace();
-        }
-    }
-}

+ 112 - 0
src/main/java/com/repair/common/utils/HttpUtils.java

@@ -0,0 +1,112 @@
+package com.repair.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"));
+            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;
+    }
+}

+ 0 - 479
src/main/java/com/repair/common/utils/HttpsClient.java

@@ -1,479 +0,0 @@
-package com.repair.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.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
-
-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;
-
-    /**
-     * 发起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));
-        System.out.println("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();
-        System.out.println("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();
-    }
-
-    //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) {
-            System.out.println("发送 请求出现异常!" + 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) {
-            System.out.println("发送 请求出现异常!" + 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();// 获取字节长度
-            System.out.println(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;
-    }
-
-    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();
-            System.out.println("aaa: "+result);
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                is.close();
-                out.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return result;
-    }
-
-}

+ 0 - 61
src/main/java/com/repair/common/utils/MimeTypeUtils.java

@@ -1,61 +0,0 @@
-package com.repair.common.utils;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/24 星期一 17:53
- * @Description: com.repair.common.utils
- * @Version: 1.0
- */
-public class MimeTypeUtils {
-    public static final String IMAGE_PNG = "image/png";
-
-    public static final String IMAGE_JPG = "image/jpg";
-
-    public static final String IMAGE_JPEG = "image/jpeg";
-
-    public static final String IMAGE_BMP = "image/bmp";
-
-    public static final String IMAGE_GIF = "image/gif";
-
-    public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
-
-    public static final String[] FLASH_EXTENSION = { "swf", "flv" };
-
-    public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
-            "asf", "rm", "rmvb" };
-
-    public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" };
-
-    public static final String[] DEFAULT_ALLOWED_EXTENSION = {
-            // 图片
-//            "bmp", "gif", "jpg", "jpeg", "png",
-//            // word excel powerpoint
-//            "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
-//            // 压缩文件
-//            "rar", "zip", "gz", "bz2",
-//            // 视频格式
-//            "mp4", "avi", "rmvb",
-//            // pdf
-//            "pdf"
-            "pdf", "bmp", "jpg", "JPEG", "png", "zip", "rar"
-    };
-
-    public static String getExtension(String prefix)
-    {
-        switch (prefix)
-        {
-            case IMAGE_PNG:
-                return "png";
-            case IMAGE_JPG:
-                return "jpg";
-            case IMAGE_JPEG:
-                return "jpeg";
-            case IMAGE_BMP:
-                return "bmp";
-            case IMAGE_GIF:
-                return "gif";
-            default:
-                return "";
-        }
-    }
-}

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

@@ -1,23 +0,0 @@
-package com.repair.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;
-    }
-}

File diff suppressed because it is too large
+ 0 - 195
src/main/java/com/repair/common/utils/RSAUtils.java


+ 0 - 178
src/main/java/com/repair/common/utils/SendSms.java

@@ -1,178 +0,0 @@
-package com.repair.common.utils;
-
-import com.tencentcloudapi.common.Credential;
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
-
-//导入可选配置类
-import com.tencentcloudapi.common.profile.ClientProfile;
-import com.tencentcloudapi.common.profile.HttpProfile;
-
-// 导入对应SMS模块的client
-import com.tencentcloudapi.sms.v20210111.SmsClient;
-
-// 导入要请求接口对应的request response类
-import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
-import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
-import com.tencentcloudapi.sms.v20210111.models.SendStatus;
-import com.repair.config.SmsConfig;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * Tencent Cloud Sms Sendsms
- */
-public class SendSms {
-
-    @Autowired
-    private static SmsConfig smsConfig;
-
-    //腾讯云上的签名
-
-    private static String secretID = "AKIDDPo13qZCZqtgJsGQL7AyYu1wc7QVMyLl";
-    //腾讯云上的密钥
-
-    private static String secretKey = "JPGrELFySiv0pOrKOPEwSnulOq9IPPDr";
-    //短信应用id
-
-    private static String sdkAppid = "1400813506";
-    //短信签名内容
-
-    private static String signName = "华仁享学教育";
-    //模板Id
-
-    private static String templateId = "1770016";
-    //验证码有效时长
-
-    private static String smsMin = "1";
-
-
-    public static SendStatus[] sendSms(String phoneNumber, String code) {
-        SendStatus[] returString = {};
-        try {
-            /* 必要步骤:
-             * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。
-             * 这里采用的是从环境变量读取的方式,需要在环境变量中先设置这两个值。
-             * 你也可以直接在代码中写死密钥对,但是小心不要将代码复制、上传或者分享给他人,
-             * 以免泄露密钥对危及你的财产安全。
-             * SecretId、SecretKey 查询: https://console.cloud.tencent.com/cam/capi */
-//            Credential cred = new Credential(smsConfig.getSecretID(), smsConfig.getSecretKey());
-            Credential cred = new Credential(secretID, secretKey);
-
-            // 实例化一个http选项,可选,没有特殊需求可以跳过
-            HttpProfile httpProfile = new HttpProfile();
-            // 设置代理(无需要直接忽略)
-            // httpProfile.setProxyHost("真实代理ip");
-            // httpProfile.setProxyPort(真实代理端口);
-            /* SDK默认使用POST方法。
-             * 如果你一定要使用GET方法,可以在这里设置。GET方法无法处理一些较大的请求 */
-            httpProfile.setReqMethod("POST");
-            /* SDK有默认的超时时间,非必要请不要进行调整
-             * 如有需要请在代码中查阅以获取最新的默认值 */
-            httpProfile.setConnTimeout(60);
-            /* 指定接入地域域名,默认就近地域接入域名为 sms.tencentcloudapi.com ,也支持指定地域域名访问,例如广州地域的域名为 sms.ap-guangzhou.tencentcloudapi.com */
-            httpProfile.setEndpoint("sms.tencentcloudapi.com");
-
-            /* 非必要步骤:
-             * 实例化一个客户端配置对象,可以指定超时时间等配置 */
-            ClientProfile clientProfile = new ClientProfile();
-            /* SDK默认用TC3-HMAC-SHA256进行签名
-             * 非必要请不要修改这个字段 */
-            clientProfile.setSignMethod("HmacSHA256");
-            clientProfile.setHttpProfile(httpProfile);
-            /* 实例化要请求产品(以sms为例)的client对象
-             * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,支持的地域列表参考 https://cloud.tencent.com/document/api/382/52071#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8 */
-            SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
-            /* 实例化一个请求对象,根据调用的接口和实际情况,可以进一步设置请求参数
-             * 你可以直接查询SDK源码确定接口有哪些属性可以设置
-             * 属性可能是基本类型,也可能引用了另一个数据结构
-             * 推荐使用IDE进行开发,可以方便的跳转查阅各个接口和数据结构的文档说明 */
-            SendSmsRequest req = new SendSmsRequest();
-
-            /* 填充请求参数,这里request对象的成员变量即对应接口的入参
-             * 你可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义
-             * 基本类型的设置:
-             * 帮助链接:
-             * 短信控制台: https://console.cloud.tencent.com/smsv2
-             * 腾讯云短信小助手: https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81 */
-
-            /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666 */
-            // 应用 ID 可前往 [短信控制台](https://console.cloud.tencent.com/smsv2/app-manage) 查看
-//            String sdkAppId = "1400009099";
-//            req.setSmsSdkAppId(smsConfig.getSdkAppid());
-            req.setSmsSdkAppId(sdkAppid);
-
-            /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
-            // 签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看
-//            String signName = "腾讯云";
-//            req.setSignName(smsConfig.getSignName());
-            req.setSignName(signName);
-
-            /* 模板 ID: 必须填写已审核通过的模板 ID */
-            // 模板 ID 可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-template) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-template) 的正文模板管理查看
-//            String templateId = "449739";
-//            req.setTemplateId(smsConfig.getTemplateId());
-            req.setTemplateId(templateId);
-
-
-            /* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
-//           第一个为验证码,第二个为有效时间
-//            String[] templateParamSet = {code,smsConfig.getSmsMin()};
-            String[] templateParamSet = {code, "1"};
-            req.setTemplateParamSet(templateParamSet);
-
-            /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
-             * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */
-//            String[] phoneNumberSet = {"+8621212313123", "+8612345678902", "+8612345678903"};
-            String[] phoneNumbers = {phoneNumber};
-            req.setPhoneNumberSet(phoneNumbers);
-
-            /* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
-//            String sessionContext = "";
-//            req.setSessionContext(sessionContext);
-
-            /* 短信码号扩展号(无需要可忽略): 默认未开通,如需开通请联系 [腾讯云短信小助手] */
-//            String extendCode = "";
-//            req.setExtendCode(extendCode);
-
-            /* 国际/港澳台短信 SenderId(无需要可忽略): 国内短信填空,默认未开通,如需开通请联系 [腾讯云短信小助手] */
-//            String senderid = "";
-//            req.setSenderId(senderid);
-
-            /* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
-             * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
-            SendSmsResponse res = client.SendSms(req);
-
-            // 输出json格式的字符串回包
-//            System.out.println(SendSmsResponse.toJsonString(res));
-
-            // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义
-            // System.out.println(res.getRequestId());
-
-            /* 当出现以下错误码时,快速解决方案参考
-             * [FailedOperation.SignatureIncorrectOrUnapproved](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Afailedoperation.signatureincorrectorunapproved-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
-             * [FailedOperation.TemplateIncorrectOrUnapproved](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Afailedoperation.templateincorrectorunapproved-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
-             * [UnauthorizedOperation.SmsSdkAppIdVerifyFail](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Aunauthorizedoperation.smssdkappidverifyfail-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
-             * [UnsupportedOperation.ContainDomesticAndInternationalPhoneNumber](https://cloud.tencent.com/document/product/382/9558#.E7.9F.AD.E4.BF.A1.E5.8F.91.E9.80.81.E6.8F.90.E7.A4.BA.EF.BC.9Aunsupportedoperation.containdomesticandinternationalphonenumber-.E5.A6.82.E4.BD.95.E5.A4.84.E7.90.86.EF.BC.9F)
-             * 更多错误,可咨询[腾讯云助手](https://tccc.qcloud.com/web/im/index.html#/chat?webAppId=8fa15978f85cb41f7e2ea36920cb3ae1&title=Sms)
-             */
-            SendStatus sendStatus = res.getSendStatusSet()[0];
-//            System.out.println("sendStatus = " + sendStatus);
-
-
-            returString = res.getSendStatusSet();
-
-        } catch (TencentCloudSDKException e) {
-            e.printStackTrace();
-        }
-        return returString;
-    }
-
-
-    public static void main(String[] args) throws TencentCloudSDKException {
-        //这里定义一个存储电话号码的数组
-
-        String tels = "+8615779633758"; // 手机号前面记得带上国家区域编码
-//        SendStatus[] test = sendSms(tels);
-
-    }
-
-}

+ 0 - 84
src/main/java/com/repair/common/utils/SeqUtils.java

@@ -1,84 +0,0 @@
-package com.repair.common.utils;
-
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/24 星期一 17:39
- * @Description: com.repair.common.utils
- * @Version: 1.0
- */
-public class SeqUtils {
-    // 通用序列类型
-    public static final String commSeqType = "COMMON";
-
-    // 上传序列类型
-    public static final String uploadSeqType = "UPLOAD";
-
-    // 通用接口序列数
-    private static AtomicInteger commSeq = new AtomicInteger(1);
-
-    // 上传接口序列数
-    private static AtomicInteger uploadSeq = new AtomicInteger(1);
-
-    // 机器标识
-    private static String machineCode = "A";
-
-    /**
-     * 获取通用序列号
-     *
-     * @return 序列值
-     */
-    public static String getId() {
-        return getId(commSeqType);
-    }
-
-    /**
-     * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串
-     *
-     * @return 序列值
-     */
-    public static String getId(String type) {
-        AtomicInteger atomicInt = commSeq;
-        if (uploadSeqType.equals(type)) {
-            atomicInt = uploadSeq;
-        }
-        return getId(atomicInt, 3);
-    }
-
-    /**
-     * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串
-     *
-     * @param atomicInt 序列数
-     * @param length    数值长度
-     * @return 序列值
-     */
-    public static String getId(AtomicInteger atomicInt, int length) {
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyMMddHHmmss");
-        String result = simpleDateFormat.format(new Date());
-        result += machineCode;
-        result += getSeq(atomicInt, length);
-        return result;
-    }
-
-    /**
-     * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数
-     *
-     * @return 序列值
-     */
-    private synchronized static String getSeq(AtomicInteger atomicInt, int length) {
-        // 先取值再+1
-        int value = atomicInt.getAndIncrement();
-
-        // 如果更新后值>=10 的 (length)幂次方则重置为1
-        int maxSeq = (int) Math.pow(10, length);
-        if (atomicInt.get() >= maxSeq) {
-            atomicInt.set(1);
-        }
-        // 转字符串,用0左补齐
-        return String.format("%0"+length+"d", value);
-    }
-}

+ 0 - 103
src/main/java/com/repair/common/utils/StrUtils.java

@@ -1,103 +0,0 @@
-package com.repair.common.utils;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * @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 ="";
-
-    }
-}

+ 6 - 433
src/main/java/com/repair/common/utils/TimeExchange.java

@@ -1,24 +1,11 @@
 package com.repair.common.utils;
 
-import com.repair.model.enumModel.eWeekStatu;
-import com.repair.model.pojo.UnitTimeHelpModel;
-import com.repair.model.request.insertConsumablesRequest;
-import com.repair.model.vo.ChangeConsumesVo;
-import com.repair.model.vo.ClassSettingDateVo;
-import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.commons.lang3.time.DateUtils;
 
-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.*;
-import java.util.stream.Collectors;
 
 /**
  * 时间转化工具 date转为时间戳 时间戳转date 互相与String的转换
@@ -32,10 +19,9 @@ public class TimeExchange {
      *
      * @param time
      * @return
-     * @throws ParseException
      */
     // String date = "2010/05/04 12:34:23";
-    public static Date StringToDate(String time, String formatDate) throws ParseException {
+    public static Date StringToDate(String time, String formatDate) {
 
         Date date = new Date();
         // 注意format的格式要与日期String的格式相匹配
@@ -68,266 +54,34 @@ public class TimeExchange {
         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(String time) throws ParseException {
-        Calendar nowTime2 = Calendar.getInstance();
-        nowTime2.setTime(StringToDate(time, "yyyy-MM-dd HH:mm:ss"));
-        nowTime2.add(Calendar.HOUR, -1);
-        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    要加减的时间(单位为分钟
+     * @param amount    要加减的时间(单位为小时)
      * @return
      * @throws ParseException
      */
-    public static String TimeRangeI(String time, int amount, String FormatStr) throws ParseException {
-        Date endTime = DateUtils.addMinutes(ShortStringToDate(time, FormatStr), amount);
+    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      时间
@@ -346,14 +100,6 @@ public class TimeExchange {
     }
 
     /**
-     * 日期路径 即年/月/日 如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
@@ -371,112 +117,6 @@ public class TimeExchange {
         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, 3));
-        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)));
-        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();
@@ -533,47 +173,6 @@ public class TimeExchange {
     }
     //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相差的秒数
      *
@@ -608,22 +207,6 @@ public class TimeExchange {
         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 void main(String[] args) throws ParseException {
 //        LocalDateTime start = StringToLocalTime("12:00","HH:mm");
@@ -632,17 +215,7 @@ public class TimeExchange {
 //        LocalDateTime start1 = StringToLocalTime("13:00","HH:mm");
 //        LocalDateTime end1 = StringToLocalTime("15:00","HH:mm");
 
-        List<Integer> newDatas = new ArrayList<>();
-        newDatas.add(1);
-        newDatas.add(3);
-        newDatas.add(5);
-        List<Integer> oldDatas = new ArrayList<>();
-        oldDatas.add(0);
-        oldDatas.add(5);
-        oldDatas.add(0);
-        oldDatas.add(3);
-        List<Integer> finall = newDatas.stream().filter(item -> !oldDatas.contains(item)).collect(Collectors.toList());
-
+        String dateSre = TimeRangeHour(new Date(), -24,"yyyy-MM-dd HH:mm:ss");
         String sss = "";
     }
 }

+ 0 - 127
src/main/java/com/repair/common/utils/WeiXiaoUtil.java

@@ -1,127 +0,0 @@
-package com.repair.common.utils;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.repair.config.WxOpenidConfig;
-import com.repair.model.pojo.WxAccessToken;
-import com.repair.model.result.CommonResult;
-import com.repair.services.WxAccessTokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.client.RestTemplate;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @Author: binguo
- * @Date: 2023/8/1 星期二 8:50
- * @Description: com.repair.common.utils
- * @Version: 1.0
- */
-@Component
-public class WeiXiaoUtil {
-    @Autowired
-    private WxOpenidConfig wxOpenidConfig;
-    @Autowired
-    private WxAccessTokenService wxAccessTokenService;
-
-    /**
-     * 获取token
-     * @return
-     */
-    public String getApplicationToken() {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        Calendar nowTime = Calendar.getInstance();
-        nowTime.add(Calendar.MINUTE, 1);
-        String dateNow = sdf.format(nowTime.getTime());
-        System.out.println();
-        WxAccessToken aData = wxAccessTokenService.getRepairByDate(dateNow);
-        if(aData != null){
-            return aData.getAccessToken();
-        }
-
-        Map<String, Object> jsonMap = doGetApplicationToken();
-        String accessToken = jsonMap.get("access_token").toString();
-        String expiresIn = jsonMap.get("expires_in").toString();
-        System.out.println("accessToken:"+accessToken+";expires_in:"+expiresIn);
-
-        aData = new WxAccessToken();
-        aData.setAccessToken(accessToken);
-        Calendar newTime = Calendar.getInstance();
-        newTime.add(Calendar.SECOND, Integer.valueOf(expiresIn));
-        aData.setExpiresTime(newTime.getTime());
-
-        wxAccessTokenService.insertwxAccessToken(aData);
-        return accessToken;
-    }
-
-    /**
-     * 发送通知
-     * @param cards 卡号集合
-     * @param digest 摘要
-     * @param title 通知标题
-     * @param content 通知内容
-     * @param customs 自定义参数,长度为2,分别为提示文案和通知跳转链接
-     */
-    public CommonResult sendNotice(List<String> cards, String digest, String title, String content, List<String> customs) {
-        String uri = "https://open.wecard.qq.com/cgi-bin/notice/send?access_token="+ getApplicationToken();
-        Map<String, String> params = new HashMap<>();
-
-        try {
-            ObjectMapper mapper = new ObjectMapper();
-            params.put("cards", mapper.writeValueAsString(cards));
-            params.put("title", title);
-            params.put("content", content);
-            params.put("sender", "报修系统");
-            params.put("digest", digest);
-            if (customs != null && customs.size() == 2) {
-                params.put("customs", mapper.writeValueAsString(customs));
-            }
-
-            RestTemplate client = new RestTemplate();
-            ResponseEntity<String> tokenResponse = client.postForEntity(uri, params, String.class);
-            String body = tokenResponse.getBody();
-            //log.info("微校发送通知返回结果【{}】", body);
-            System.out.println("微校发送通知返回结果:"+body);
-            return CommonResult.ok("操作成功");
-        } catch (Exception e) {
-            System.out.println("微校发送通知错误:"+e.getMessage());
-            //log.error("微校发送通知错误【{}】", e.getMessage());
-            return CommonResult.fail("操作失败");
-        }
-    }
-
-    /**
-     * 获取token
-     * @return
-     */
-    private Map<String, Object> doGetApplicationToken() {
-        String uri = "https://open.wecard.qq.com/cgi-bin/oauth2/token";
-
-        // 构建请求参数
-        Map<String, String> tokenParams = new HashMap<>();
-        tokenParams.put("app_key", wxOpenidConfig.getAppid());
-        tokenParams.put("app_secret", wxOpenidConfig.getAppkey());
-        tokenParams.put("grant_type", "client_credentials");
-        tokenParams.put("scope", "base");
-        tokenParams.put("ocode", wxOpenidConfig.getOcode());
-
-        try {
-            RestTemplate client = new RestTemplate();
-            ResponseEntity<String> tokenResponse = client.postForEntity(uri, tokenParams, String.class);
-            String body = tokenResponse.getBody();
-            ObjectMapper mapper = new ObjectMapper();
-            Map<String, Object> jsonMap = mapper.readValue(body, new TypeReference<Map<String, Object>>() {});
-
-
-            return jsonMap;
-        } catch (Exception e) {
-            String sss = e.getMessage();
-        }
-        return null;
-    }
-}

+ 67 - 0
src/main/java/com/repair/common/utils/WxUtil.java

@@ -1,6 +1,7 @@
 package com.repair.common.utils;
 
 import com.repair.config.WxOpenidConfig;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -375,5 +376,71 @@ public class WxUtil {
 		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<Map.Entry<String, String>> es = params.entrySet();
+		Iterator<Map.Entry<String, String>> it = es.iterator();
+		while (it.hasNext()) {
+			Map.Entry<String, String> entry = (Map.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");
+	}
 }

+ 74 - 0
src/main/java/com/repair/common/utils/XmlUtil.java

@@ -0,0 +1,74 @@
+package com.repair.common.utils;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/10/26 星期四 11:04
+ * @Description: com.repair.common.utils
+ * @Version: 1.0
+ */
+public class XmlUtil {
+    /**
+     * xml⽂档解析为对象
+     * @param xml   xml文档
+     * @return
+     */
+
+    public static Map<String,Object> fromXML(String xml){
+        Map<String,Object> map = new HashMap<String,Object>();
+        try {
+            Document doc = DocumentHelper.parseText(xml);
+            Element root = doc.getRootElement();
+            Iterator it = root.elementIterator();
+            while (it.hasNext()) {
+                Element element = (Element) it.next();
+                map.put(element.getName(), element.getTextTrim());
+            }
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        }
+
+        return map;
+
+    }
+
+    public static void main(String[] args) throws ParseException {
+        String xml = "<xml>\n" +
+                "<appid><![CDATA[wxd6f090391d410534]]></appid>\n" +
+                "<cash_fee><![CDATA[200]]></cash_fee>\n" +
+                "<cash_refund_fee_0><![CDATA[50]]></cash_refund_fee_0>\n" +
+                "<mch_id><![CDATA[1653095601]]></mch_id>\n" +
+                "<nonce_str><![CDATA[yW7LCKfvoddlUaG7]]></nonce_str>\n" +
+                "<out_refund_no_0><![CDATA[1833905972023102621241119001698286702]]></out_refund_no_0>\n" +
+                "<out_trade_no><![CDATA[086339330913483]]></out_trade_no>\n" +
+                "<refund_account_0><![CDATA[REFUND_SOURCE_RECHARGE_FUNDS]]></refund_account_0>\n" +
+                "<refund_channel_0><![CDATA[ORIGINAL]]></refund_channel_0>\n" +
+                "<refund_count>1</refund_count>\n" +
+                "<refund_fee>50</refund_fee>\n" +
+                "<refund_fee_0>50</refund_fee_0>\n" +
+                "<refund_id_0><![CDATA[50301807582023102686566845969]]></refund_id_0>\n" +
+                "<refund_recv_accout_0><![CDATA[支付用户零钱]]></refund_recv_accout_0>\n" +
+                "<refund_status_0><![CDATA[SUCCESS]]></refund_status_0>\n" +
+                "<refund_success_time_0><![CDATA[2023-10-26 10:19:15]]></refund_success_time_0>\n" +
+                "<result_code><![CDATA[SUCCESS]]></result_code>\n" +
+                "<return_code><![CDATA[SUCCESS]]></return_code>\n" +
+                "<return_msg><![CDATA[OK]]></return_msg>\n" +
+                "<sign><![CDATA[21BB06BA9C42251EA344BFF2FE060055]]></sign>\n" +
+                "<total_fee><![CDATA[200]]></total_fee>\n" +
+                "<transaction_id><![CDATA[4200001986202310262124111900]]></transaction_id>\n" +
+                "</xml>";
+
+        Map<String,Object> dateSre = fromXML(xml);
+        String sss = "";
+    }
+}

+ 0 - 27
src/main/java/com/repair/common/utils/paramUtils.java

@@ -1,27 +0,0 @@
-package com.repair.common.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.ObjectError;
-
-import java.util.List;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/5 星期三 16:11
- * @Description: com.template.utils
- * @Version: 1.0
- */
-@Slf4j
-public class paramUtils {
-    public static String getParamError(BindingResult bindingResult) {
-        //有校验没通过
-        List<ObjectError> errorList = bindingResult.getAllErrors();
-        StringBuilder st = new StringBuilder();
-        for (ObjectError error : errorList) {
-            st.append(error.getDefaultMessage() + "! ");//输出具体的错误信息
-        }
-
-        return st.toString();
-    }
-}

+ 0 - 25
src/main/java/com/repair/common/utils/smsUtil.java

@@ -1,25 +0,0 @@
-package com.repair.common.utils;
-
-/**
- * @Author: binguo
- * @Date: 2023/4/20 星期四 8:26
- * @Description: common
- * @Version: 1.0
- */
-public class smsUtil {
-//    @Autowired
-//    private static smsConfig smsConfig;
-//
-//    /**
-//     * 发送单条短信验证码
-//     * @param smmCode 短信验证码
-//     * @param phoneNumber 手机号
-//     * @return
-//     */
-//    public static void sendSingleMessage(String smmCode, String phoneNumber) throws HTTPException, IOException {
-//        String[] params = {smmCode,Integer.toString(smsConfig.getSmsMin())};
-//        SmsSingleSender ssender = new SmsSingleSender(smsConfig.getSdkAppid(), smsConfig.getAppKey());
-//        SmsSingleSenderResult result = ssender.sendWithParam("86", phoneNumber, smsConfig.getTemplateId(), params, smsConfig.getSmsSign(), "", "");
-//        System.out.println(result);
-//    };
-}

+ 19 - 0
src/main/java/com/repair/config/ScheduledConfig.java

@@ -0,0 +1,19 @@
+package com.repair.config;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 定时任务配置
+ */
+@EnableScheduling
+@Configuration
+public class ScheduledConfig{
+
+}

+ 0 - 36
src/main/java/com/repair/config/SmsConfig.java

@@ -1,36 +0,0 @@
-package com.repair.config;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-/**
- * @Author: binguo
- * @Date: 2023/4/20 星期四 8:29
- * @Description: com.video.config
- * @Version: 1.0
- */
-
-@Component
-@ConfigurationProperties(prefix = "tencentcloud")
-@Data
-public class SmsConfig {
-    //腾讯云上的签名
-
-    private String secretID;
-    //腾讯云上的密钥
-
-    private String secretKey;
-    //短信应用id
-
-    private String sdkAppid;
-    //短信签名内容
-
-    private String signName;
-    //模板Id
-
-    private String templateId;
-    //验证码有效时长
-
-    private String smsMin;
-}

+ 12 - 0
src/main/java/com/repair/config/WxOpenidConfig.java

@@ -28,4 +28,16 @@ public class WxOpenidConfig {
 
     //微校主体码
     private String ocode;
+
+    //微信小程序appId
+    private String xappid;
+
+    //微信小程序secret
+    private String xsecret;
+
+    //商户号
+    private String shappid;
+
+    //商户密钥
+    private String shsecret;
 }

+ 0 - 358
src/main/java/com/repair/controller/LoginController.java

@@ -1,358 +0,0 @@
-package com.repair.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.repair.annotation.PassToken;
-import com.repair.api.LoginControllerAPI;
-import com.repair.common.utils.HttpsClient;
-import com.repair.config.WxOpenidConfig;
-import com.repair.model.enumModel.eSchool;
-import com.repair.model.enumModel.eStatu;
-import com.repair.model.enumModel.eUserZZ;
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.pojo.RepairUser;
-import com.repair.model.request.changePasswordRequest;
-import com.repair.model.request.loginRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.Wx_user;
-import com.repair.model.vo.LoginVo;
-import com.repair.model.vo.routeDataVo;
-import com.repair.model.vo.wxLoginVo;
-import com.repair.services.RepairAdminService;
-import com.repair.common.utils.AesUtils;
-import com.repair.common.utils.paramUtils;
-import com.repair.common.utils.JWTUtil;
-import com.repair.services.RepairUserService;
-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.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.client.RestTemplate;
-
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Author: binguo
- * @Date: 2023/7/5 星期三 9:28
- * @Description: com.template.controller
- * @Version: 1.0
- */
-@RestController
-public class LoginController implements LoginControllerAPI {
-
-    @Autowired
-    private RepairAdminService repairAdminService;
-    @Autowired
-    private RepairUserService repairUserService;
-    @Autowired
-    private WxOpenidConfig wxOpenidConfig;
-
-
-    /**
-     * 查看系统版本号
-     *
-     * @return
-     */
-    @Override
-    @PassToken
-    public CommonResult queryReduce() {
-        return CommonResult.ok("ip地址为"+wxOpenidConfig.getIpconfig()+"的系统版本为:1V");
-    }
-
-    /**
-     * 注册接口
-     *
-     * @param registerdo account 账号
-     *                   password 密码
-     *                   username 昵称
-     *                   phone 手机号
-     * @return
-     */
-    @Override
-    @PassToken
-    public CommonResult Register(@RequestBody RepairAdmin registerdo, BindingResult bindingResult) {
-
-        if (registerdo == null) {
-            return CommonResult.fail("请传递参数");
-        }
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairAdmin data = repairAdminService.getRepairByAccount(registerdo.getAccount());
-        if (data != null) {
-            return CommonResult.fail("该账号已存在!");
-        }
-
-        int result = repairAdminService.insertRepairAdmin(registerdo);
-
-        if (result > 0) {
-            return CommonResult.ok("注册成功!");
-        }
-        return CommonResult.fail("注册失败!");
-    }
-
-    /**
-     * 登录接口
-     *
-     * @param loginRequest account 账号
-     *                     password 密码
-     * @return
-     */
-    @Override
-    @PassToken
-    public CommonResult Login(@RequestBody loginRequest loginRequest, BindingResult bindingResult) {
-        if (loginRequest == null) {
-            return CommonResult.fail("请传递参数");
-        }
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairAdmin result = repairAdminService.getRepairByAccount(loginRequest.getAccount());
-        if (result == null) {
-            return CommonResult.fail("账号或密码错误");
-        }
-
-        if (result.getStatu().equals(eStatu.Freeze.getValue())) {
-            return CommonResult.fail("该账号已被冻结");
-        }
-
-        String encPassword = AesUtils.encrypt(loginRequest.getPassword());
-        if (!encPassword.equals(result.getPassword())) {
-            return CommonResult.fail("密码错误");
-        }
-
-        String token = JWTUtil.getToken(result, null);
-        LoginVo login = new LoginVo();
-        login.setSchoolId(result.getIsSuper() == 1 ? 0 : result.getSchoolId());
-        login.setToken(token);
-        login.setTokenTtl(JWTUtil.getExpired());
-        login.setUserName(result.getUsername());
-        login.setUserhead(AesUtils.encrypt(result.getId()));
-
-        //要在账户表中添加一条对应的数据
-
-        return CommonResult.ok("登录成功", login);
-    }
-
-    /**
-     * 修改密码
-     *
-     * @param cpr           oldPassword 旧密码
-     *                      newPassword 新密码
-     *                      confirmPassword 确认密码
-     * @param userhead
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult ChangePassword(changePasswordRequest cpr, @RequestHeader("user_head") String userhead, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        if (!cpr.getNewPassword().equals(cpr.getConfirmPassword())) {
-            return CommonResult.fail("确认密码和新密码不一致!");
-        }
-
-        String userID = AesUtils.decrypt(userhead);
-        RepairAdmin operateData = repairAdminService.getRepairById(userID);
-        if (operateData == null) {
-            return CommonResult.fail("当前账号不合法!");
-        }
-
-        if (operateData.getStatu() == eStatu.Freeze.getValue()) {
-            return CommonResult.fail("该账号已被冻结");
-        }
-
-        if (!AesUtils.encrypt(cpr.getOldPassword()).equals(operateData.getPassword())) {
-            return CommonResult.fail("原密码错误!");
-        }
-
-        RepairAdmin ra = new RepairAdmin();
-        ra.setId(userID);
-        ra.setPassword(AesUtils.encrypt(cpr.getNewPassword()));
-        int result = repairAdminService.updateRepairAdmin(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    @PassToken
-    public CommonResult Openid(String wxcode) throws JsonProcessingException {
-        Gson gson = new Gson();
-        String tokenUrl = "https://open.wecard.qq.com/connect/oauth2/token";
-        Map<String, String> tokenParams = new HashMap<>();
-        String url = "mnp://wxd6f090391d410534";
-        tokenParams.put("wxcode", wxcode);
-        tokenParams.put("app_key", wxOpenidConfig.getAppid());
-        tokenParams.put("app_secret", wxOpenidConfig.getAppkey());
-        tokenParams.put("grant_type", wxOpenidConfig.getGranttype());
-        tokenParams.put("redirect_uri", url); // 小程序为 mnp:// + 小程序app id
-
-        // wecode换取token
-        String respon = HttpsClient.post(tokenUrl, tokenParams);
-        HashMap<String, Object> tokenMap = gson.fromJson(respon, new TypeToken<HashMap<String, Object>>() {
-        }.getType());
-        String accessToken = (String) tokenMap.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);
-        String userinfo = HttpsClient.post(userInfoUrl, userInfoParam);
-        String card_number = null;
-        String user_name = null;
-        String phone = null;
-        int identity_type = 0;
-        String campus = null;
-        Wx_user userinfos = gson.fromJson(userinfo, new TypeToken<Wx_user>() {
-        }.getType());
-        System.out.println(userinfo);
-        System.out.println(userinfos.getIdentity_type());
-        try {
-            card_number = userinfos.getCard_number();
-            user_name = userinfos.getName();
-            phone = userinfos.getTelephone();
-            identity_type = userinfos.getIdentity_type();
-            campus = userinfos.getCampus();
-
-        } catch (Exception e) {
-            return CommonResult.fail(e.getMessage());
-        }
-
-        if(card_number == null || card_number.equals("")){
-            return CommonResult.fail("卡号为空,授权失败");
-        }
-        //根据卡号查询repair_user表中的用户信息
-        RepairUser user = repairUserService.getRepairByCardNumber(card_number);
-        if(identity_type != 4 && user == null){
-            return CommonResult.fail("非法权限,授权失败");
-        }
-
-        if(user == null){
-            user = new RepairUser();
-            user.setCardNumber(card_number);
-            user.setUserName(user_name);
-            user.setUserPhone(phone);
-            user.setUserZzid(eUserZZ.User.getValue());
-            user.setIdentityType(identity_type);
-            user.setSchoolId(eSchool.integerOf(campus));//校区ID
-            user.setIsChange(0);
-            int num = repairUserService.insertRepairUser(user);
-            if(num <= 0){
-                return CommonResult.fail("无法记录用户信息,授权失败");
-            }
-            RepairAdmin admin = new RepairAdmin();
-            admin.setAccount(card_number);
-            admin.setPassword("974264710");
-            admin.setUsername(user_name);
-            admin.setPhone(phone);
-            admin.setIsSuper(0);
-            admin.setStatu(1);
-            admin.setIsMobile(1);
-            int adminNum = repairAdminService.insertRepairAdmin(admin);
-            if(adminNum <= 0){
-                return CommonResult.fail("无法记录账号信息,授权失败");
-            }
-        }
-
-        RepairAdmin adminData = repairAdminService.getRepairByAccount(card_number);
-
-        wxLoginVo wlv = new wxLoginVo();
-        routeDataVo data = getRoutes(user.getUserZzid());
-        wlv.setUserId(user.getId());
-        wlv.setRoutes(data == null ? new ArrayList<>() :data.getRoutes());
-        wlv.setBtns(data == null ? new ArrayList<>() :data.getBtns());
-        wlv.setUserName(user.getUserName());
-        wlv.setUserZZid(user.getUserZzid());
-        wlv.setUserZZName(eUserZZ.stringOf(user.getUserZzid()));
-        wlv.setSchoolId(user.getSchoolId());
-        wlv.setSchoolName(eSchool.stringOf(user.getSchoolId()));
-        long expired = 1000 * 60 * 60 * 24 * 365 * 10;
-        String token = JWTUtil.getToken(adminData, expired);
-        wlv.setToken(token);
-        wlv.setUserhead(AesUtils.encrypt(adminData.getId()));
-
-        return CommonResult.ok(wlv);
-    }
-
-    public routeDataVo getRoutes(Integer userZZid){
-        routeDataVo result = new routeDataVo();
-        List<String> routes = new ArrayList<>();
-        List<String> btns = new ArrayList<>();
-        switch (userZZid){
-            //维修师傅
-            //eUserZZ.Maintenance.getValue():1
-            case 1:
-                routes.add("首页");
-                routes.add("工单管理");
-                routes.add("待处理池");
-
-                btns.add("协作");
-                btns.add("接单");
-                btns.add("转单");
-                btns.add("报价");
-                btns.add("维修完成");
-                break;
-            //管理者(郭班长)
-            //eUserZZ.Monitor.getValue():2
-            case 2:
-                routes.add("首页");
-                routes.add("工单管理");
-                routes.add("待处理池");
-                routes.add("通讯录");
-
-                btns.add("首页分段器");
-                btns.add("表格编辑");
-                btns.add("工单管理分段器");
-                btns.add("延时");
-                btns.add("审核");
-                btns.add("接单");
-                btns.add("报价");
-                btns.add("维修完成");
-                btns.add("派单");
-                break;
-            //后勤
-            //eUserZZ.Logistics.getValue():3
-            case 3:
-                routes.add("首页");
-                routes.add("工单管理");
-                routes.add("待处理池");
-                routes.add("通讯录");
-
-                btns.add("表格编辑");
-                btns.add("延时");
-                btns.add("派单");
-                btns.add("审核");
-                btns.add("分段器按钮");
-                break;
-            //用户(默认都是用户)
-            //eUserZZ.User.getValue():0
-            default:
-                routes.add("报修");
-                routes.add("我的报修");
-                break;
-        }
-        result.setRoutes(routes);
-        result.setBtns(btns);
-
-        return result;
-    }
-}

+ 0 - 37
src/main/java/com/repair/controller/MaintenanceConsumeablesRequest.java

@@ -1,37 +0,0 @@
-package com.repair.controller;
-
-import com.repair.model.request.insertConsumablesRequest;
-import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-import java.math.BigDecimal;
-import java.util.List;
-
-/**
- * @Author: binguo
- * @Date: 2023/8/5 星期六 10:05
- * @Description: com.repair.controller
- * @Version: 1.0
- */
-@Data
-public class MaintenanceConsumeablesRequest {
-    /**
-     * 报修记录
-     */
-    @NotNull(message = "报修记录ID不能为空")
-    private Integer recordId;
-
-
-    /**
-     * 耗材集合
-     */
-    @NotEmpty(message = "耗材集合不能为空")
-    private List<insertConsumablesRequest> consumes;
-
-    /**
-     * 总价
-     */
-    @NotNull(message = "总价不能为空")
-    private BigDecimal totalPrice;
-}

+ 0 - 231
src/main/java/com/repair/controller/RepairAdminController.java

@@ -1,231 +0,0 @@
-package com.repair.controller;
-
-import com.repair.api.RepairAdminControllerAPI;
-import com.repair.common.utils.*;
-import com.repair.model.enumModel.eIsSuper;
-import com.repair.model.enumModel.eStatu;
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.pojo.RepairUser;
-import com.repair.model.request.freezeRepairAdminRequest;
-import com.repair.model.request.updateRepairAdminRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.ConsumableExcelVo;
-import com.repair.services.RepairAdminService;
-import com.repair.services.RepairUserService;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-05
- */
-@RestController
-public class RepairAdminController implements RepairAdminControllerAPI {
-
-    @Autowired
-    private RepairAdminService repairAdminService;
-    @Autowired
-    private RepairUserService repairUserService;
-
-    /**
-     * 添加账号数据
-     * 只有超级管理员能添加账号
-     * @param ra account 账号
-     *           password 密码
-     *           username 用户名称
-     *           phone 手机号
-     * @return
-     */
-    @Override
-    public CommonResult InsertRepairAdmin(@RequestBody RepairAdmin ra, @RequestHeader("user_head") String userhead, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        String userID = AesUtils.decrypt(userhead);
-        RepairAdmin operateData = repairAdminService.getRepairById(userID);
-        if (!operateData.getIsSuper().equals(eIsSuper.Super.getValue())) {
-            return CommonResult.fail("只有超级管理员才能添加账号!");
-        }
-
-        //根据微校卡号判断移动端是否存在数据
-        RepairUser user = repairUserService.getRepairByCardNumber(ra.getCardNumber());
-        if(user == null){
-            return CommonResult.fail("此账号无法与移动端用户信息进行绑定,新增账号失败");
-        }
-
-        RepairAdmin data = repairAdminService.getRepairByAccount(ra.getAccount());
-        if (data != null) {
-            return CommonResult.fail("该账号已存在!");
-        }
-        ra.setIsMobile(0);
-        int result = repairAdminService.insertRepairAdmin(ra); // 帮我们自动生成id
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    /**
-     * 查询账户列表数据
-     *
-     * @param currentPage 当前页
-     * @param pageCount   一页数据条数
-     * @param account     账号
-     * @param startTime   开始时间
-     * @param endTime     结束时间
-     * @return
-     */
-    @Override
-    public CommonResult queryPageRepairAdmins(@RequestParam int currentPage, @RequestParam int pageCount, String account, String startTime, String endTime) {
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-
-        PageUtils<RepairAdmin> result = repairAdminService.queryPageList(currentPage, pageCount, account, startTime, endTime);
-
-        return CommonResult.ok(result);
-    }
-
-    /**
-     * 根据ID冻结账号账号数据
-     *
-     * @param frar id 数据ID
-     *             statu 状态
-     *             正常:0;冻结:1
-     * @return
-     */
-    @Override
-    public CommonResult freezeRepairAdminById(@RequestBody freezeRepairAdminRequest frar, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        RepairAdmin data = repairAdminService.getRepairById(frar.getId());
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,解冻失败!");
-        }
-        if (data.getStatu().equals(frar.getStatu())) {
-            String Message = frar.getStatu().equals(eStatu.Freeze.getValue()) ? "当前处于冻结状态,请勿重复操作!" : "当前处于未冻结状态,请勿重复操作!";
-            return CommonResult.fail(Message);
-        }
-
-        String success = frar.getStatu().equals(eStatu.Freeze.getValue()) ? "冻结成功!" : "解冻成功";
-        String fail = frar.getStatu().equals(eStatu.Freeze.getValue()) ? "冻结失败!" : "解冻失败";
-        RepairAdmin ra = new RepairAdmin();
-        ra.setId(frar.getId());
-        ra.setStatu(frar.getStatu());
-        int result = repairAdminService.updateRepairAdmin(ra);
-        System.out.println(result);
-        return result > 0 ? CommonResult.ok(success) : CommonResult.fail(fail);
-    }
-
-    /**
-     * 根据ID删除账号数据
-     *
-     * @param id id 数据ID
-     * @return
-     */
-    @Override
-    public CommonResult deleteRepairAdminById(@RequestParam String id) {
-        RepairAdmin data = repairAdminService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairAdminService.deleteRepairAdminById(id);
-
-        return result > 0 ? CommonResult.ok() : CommonResult.fail();
-    }
-
-    /**
-     * 编辑账号
-     *
-     * @param ra id 数据ID
-     *           username 账号名称
-     *           phone 手机号
-     *           password 密码
-     * @return
-     */
-    @Override
-    public CommonResult updateRepairAdminById(updateRepairAdminRequest ra, @RequestHeader("user_head") String userhead, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairAdmin data = repairAdminService.getRepairById(ra.getId());
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,编辑失败!");
-        }
-
-        //只有操作管理员才能编辑他人的密码
-        String userID = AesUtils.decrypt(userhead);
-        if (ra.getPassword() != null && !userID.equals(ra.getId())) {
-            RepairAdmin operateData = repairAdminService.getRepairById(userID);
-            if (operateData == null) {
-                return CommonResult.fail("操作身份不合法,编辑失败!");
-            }
-            if (!data.getPassword().equals(AesUtils.encrypt(ra.getPassword())) && !operateData.getIsSuper().equals(eIsSuper.Super.getValue())) {
-                return CommonResult.fail("只有超级管理员才能更改密码!");
-            }
-        }
-
-        int result = repairAdminService.updateRepaiRadmin(ra);
-        return result > 0 ? CommonResult.ok("编辑成功") : CommonResult.fail("编辑失败");
-    }
-
-    @Override
-    public void downloadRepairAdminExcel(String account, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-
-        Map<String, String> map = new HashMap<>();
-        //表头与键值对的映射关系
-        map.put("username", "昵称");
-        map.put("account", "账号");
-        map.put("phone", "手机号");
-        map.put("updateTimeStr", "创建时间");
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-
-        List<RepairAdmin> datas = repairAdminService.queryRepairAdminList(account, startTime, endTime);
-
-        List<String> orderList = new ArrayList<>();
-        orderList.add("username");
-        orderList.add("account");
-        orderList.add("phone");
-        orderList.add("updateTimeStr");
-
-        //导出逻辑 这里的list是从导入里面哪来的 map1与map不一样 orderList这里为空
-        Workbook workbook = ExcelExportUtil.createWorkbook(datas, map, 1, "账号管理表", orderList);
-
-        ExcelUtils.excelDownload(workbook, "账号管理.xlsx", response);
-    }
-}
-

+ 0 - 156
src/main/java/com/repair/controller/RepairAreaController.java

@@ -1,156 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairAreaControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairArea;
-import com.repair.model.request.updateRepairAreaRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.RepairAreaTreeVo;
-import com.repair.model.vo.RepairSchoolVo;
-import com.repair.services.RepairAreaService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-12
- */
-@RestController
-public class RepairAreaController implements RepairAreaControllerAPI {
-
-    @Autowired
-    private RepairAreaService repairAreaService;
-
-    @Override
-    public CommonResult InsertRepairArea(RepairArea repairArea, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairAreaService.insertRepairArea(repairArea);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairAreaById(updateRepairAreaRequest urar, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        RepairArea ra = new RepairArea();
-        ra.setId(urar.getId());
-        ra.setName(urar.getName());
-        int result = repairAreaService.updateRepairArea(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairAreas(int currentPage, int pageCount, String name) {
-        PageUtils<RepairArea> result = repairAreaService.queryPageRepairAreas(currentPage, pageCount, name);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult queryRepairSchools() {
-        List<RepairSchoolVo> result = repairAreaService.queryRepairSchools();
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairAreaById(int id) {
-        RepairArea data = repairAreaService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairAreaService.deleteRepairAreaById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult queryRepairAreaTree(int schoolId) {
-        List<RepairArea> result = repairAreaService.getRepairAreas();
-        List<RepairAreaTreeVo> datas = QueryAreaTreeRecords(schoolId, result);
-        return CommonResult.ok(datas);
-    }
-
-    /*
-    根据父类ID获取树形菜单数据
-     */
-    private List<RepairAreaTreeVo> QueryAreaTreeRecords(Integer parentID, List<RepairArea> lists) {
-        List<RepairAreaTreeVo> newTrees = new ArrayList<>();
-
-        List<RepairArea> datas = lists.stream().filter(e -> e.getParentId() == parentID).collect(Collectors.toList());
-
-        for (RepairArea data : datas) {
-            RepairAreaTreeVo item = RepairAreaTreeVo.builder()
-                    .id(data.getId())
-                    .parentId(data.getParentId())
-                    .name(data.getName())
-                    .build();
-            List<RepairAreaTreeVo> news = QueryAreaTreeRecords(item.getId(), lists);
-            if (news == null || news.size() == 0) {
-                newTrees.add(item);
-                continue;
-            } else {
-                item.setChildren(news);
-                newTrees.add(item);
-            }
-        }
-
-        return newTrees;
-    }
-
-    @Override
-    public CommonResult queryRepairAreaSecond(int schoolId) {
-        List<RepairArea> result = repairAreaService.getRepairAreas();
-        List<RepairAreaTreeVo> datas = QueryAreaTreeRecords(schoolId, result, 2);
-        return CommonResult.ok(datas);
-    }
-
-    /*
-    查询二层楼栋
-     */
-    private List<RepairAreaTreeVo> QueryAreaTreeRecords(Integer parentID, List<RepairArea> lists, int i) {
-        i--;
-        List<RepairAreaTreeVo> newTrees = new ArrayList<>();
-
-        List<RepairArea> datas = lists.stream().filter(e -> e.getParentId() == parentID).collect(Collectors.toList());
-        if(i < 0){
-            datas = new ArrayList<>();
-        }
-        for (RepairArea data : datas) {
-            RepairAreaTreeVo item = RepairAreaTreeVo.builder()
-                    .id(data.getId())
-                    .parentId(data.getParentId())
-                    .name(data.getName())
-                    .build();
-            List<RepairAreaTreeVo> news = QueryAreaTreeRecords(item.getId(), lists, i);
-            if (news == null || news.size() == 0) {
-                newTrees.add(item);
-                continue;
-            } else {
-                item.setChildren(news);
-                newTrees.add(item);
-            }
-        }
-
-        return newTrees;
-    }
-
-}
-

+ 0 - 170
src/main/java/com/repair/controller/RepairArticleTypeController.java

@@ -1,170 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairArticleTypeControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairArea;
-import com.repair.model.pojo.RepairArticleType;
-import com.repair.model.request.updateRepairArticleTypeRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.*;
-import com.repair.model.vo.RepairArticleTypeTreeVo;
-import com.repair.services.RepairAreaService;
-import com.repair.services.RepairArticleTypeService;
-import com.repair.services.RepairConsumeService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-18
- */
-@RestController
-public class RepairArticleTypeController implements RepairArticleTypeControllerAPI {
-
-    @Autowired
-    private RepairArticleTypeService repairArticleTypeService;
-    @Autowired
-    private RepairConsumeService repairConsumeService;
-
-    @Override
-    public CommonResult InsertRepairArticleType(RepairArticleType rat, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairArticleType data = repairArticleTypeService.getRepairArticleTypeByName(rat.getName(), rat.getSchoolId());
-        if (data != null) {
-            return CommonResult.fail("该物品已存在!");
-        }
-
-        int result = repairArticleTypeService.insertRepairArticleType(rat);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairArticleTypeById(updateRepairArticleTypeRequest uratr, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairArticleType data = repairArticleTypeService.getRepairArticleTypeByName(uratr.getName(),null);
-        if (data != null && !data.getId().equals(uratr.getId())) {
-            return CommonResult.fail("该物品已存在!");
-        }
-
-        RepairArticleType rat = new RepairArticleType();
-        rat.setId(uratr.getId());
-        rat.setName(uratr.getName());
-
-        int result = repairArticleTypeService.updateRepairArticleType(rat);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairArticleTypes(int currentPage, int pageCount, String name) {
-        PageUtils<RepairArticleType> result = repairArticleTypeService.queryPageRepairArticleTypes(currentPage, pageCount, name);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairArticleTypeById(int id) {
-        RepairArticleType data = repairArticleTypeService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairArticleTypeService.deleteRepairArticleTypeById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult queryRepairArticleTypeTree(int schoolId) {
-        List<RepairArticleType> result = repairArticleTypeService.getRepairArticleTypesBySchoolId(schoolId);
-        List<RepairArticleTypeTreeVo> datas = QueryArticleTypeTreeRecords(0, result);
-
-        return CommonResult.ok(datas);
-    }
-
-    @Override
-    public CommonResult queryRepairArticleType(int schoolId) {
-        List<RepairWorkTypeVo> result = repairArticleTypeService.getRepairArticleTypes(schoolId);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult queryConsumeMaterial(int schoolId, String keyWord) {
-        List<RepairArticleChildVo> result = repairArticleTypeService.getRepairParentArticleTypes(schoolId);
-        List<String> articleIds = Arrays.stream(StringUtils.join(result.stream().map(RepairArticleChildVo::getChildId).collect(Collectors.toList()), ',').split(",")).distinct().collect(Collectors.toList());
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < articleIds.size(); i++) {
-            sb.append("FIND_IN_SET(" + articleIds.get(i) + ",article_id)");
-            if (i + 1 != articleIds.size()) {
-                sb.append(" or ");
-            }
-        }
-
-        String sss = sb.toString();
-        //耗材数据
-        List<RepairArticleConsumeVo> consumeResult = repairConsumeService.queryArticleConsumes(schoolId, keyWord, sb.toString());
-        for (RepairArticleChildVo article : result) {
-            List<String> ids =  new ArrayList<>(Arrays.asList(article.getChildId().split(",")));
-            for (String id:ids) {
-                List<RepairArticleConsumeVo> datas = consumeResult.stream().filter(e -> (","+e.getArticleId()+",").contains((","+id+","))).collect(Collectors.toList());
-                if(datas.size() > 0){
-                    article.setConsumes(datas);
-                }
-            }
-        }
-
-        //判断获取子类的 按查询内容模糊查询获取
-        return CommonResult.ok(result);
-    }
-
-    /*
-    根据父类ID获取树形菜单数据
-     */
-    private List<RepairArticleTypeTreeVo> QueryArticleTypeTreeRecords(Integer parentID, List<RepairArticleType> lists) {
-        List<RepairArticleTypeTreeVo> newTrees = new ArrayList<>();
-
-        List<RepairArticleType> datas = lists.stream().filter(e -> e.getParentId() == parentID).collect(Collectors.toList());
-
-        for (RepairArticleType data : datas) {
-            RepairArticleTypeTreeVo item = RepairArticleTypeTreeVo.builder()
-                    .id(data.getId())
-                    .schoolId(data.getSchoolId())
-                    .parentId(data.getParentId())
-                    .name(data.getName())
-                    .build();
-            List<RepairArticleTypeTreeVo> news = QueryArticleTypeTreeRecords(item.getId(), lists);
-            if (news == null || news.size() == 0) {
-                newTrees.add(item);
-                continue;
-            } else {
-                item.setChildren(news);
-                newTrees.add(item);
-            }
-        }
-
-        return newTrees;
-    }
-}
-

+ 0 - 608
src/main/java/com/repair/controller/RepairClassesSettingsController.java

@@ -1,608 +0,0 @@
-package com.repair.controller;
-
-import com.repair.annotation.PassToken;
-import com.repair.api.RepairClassesSettingsControllerAPI;
-import com.repair.common.utils.ExcelExportUtil;
-import com.repair.common.utils.ExcelUtils;
-import com.repair.common.utils.TimeExchange;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eFileType;
-import com.repair.model.enumModel.eSchool;
-import com.repair.model.pojo.RepairClassesSettings;
-import com.repair.model.pojo.RepairShiftSettings;
-import com.repair.model.pojo.RepairUser;
-import com.repair.model.request.insertRepairClassesRequest;
-import com.repair.model.request.updateRepairClassesRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.*;
-import com.repair.services.RepairClassesSettingsService;
-import com.repair.services.RepairShiftSettingsService;
-import com.repair.services.RepairUserService;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.text.ParseException;
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.ZoneId;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-13
- */
-@RestController
-public class RepairClassesSettingsController implements RepairClassesSettingsControllerAPI {
-
-    @Autowired
-    private RepairClassesSettingsService repairClassesSettingsService;
-    @Autowired
-    private RepairShiftSettingsService repairShiftSettingsService;
-    @Autowired
-    private RepairUserService repairUserService;
-
-    public CommonResult InsertRepairClassesSettings(insertRepairClassesRequest ircr, BindingResult bindingResult) throws ParseException {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        if (ircr.getStartDate() == null) {
-            return CommonResult.fail("开始日期不能为空");
-        }
-
-        //防止选择的班次重叠
-        List<RepairShiftSettings> datas = repairShiftSettingsService.getRepairsByShiftIds(ircr.getShiftIds());
-        for (int i = 0; i < datas.size(); i++) {
-            for (int j = i + 1; j < datas.size(); j++) {
-                boolean isOver = TimeExchange.overlapping(datas.get(i).getStartTime(), datas.get(i).getEndTime(), datas.get(j).getStartTime(), datas.get(j).getEndTime());
-                if (isOver) {
-                    return CommonResult.fail(datas.get(i).getStartTime() + "-" + datas.get(i).getEndTime() + "时间段和" + datas.get(j).getStartTime() + "-" + datas.get(j).getEndTime() + "时间段存在重叠");
-                }
-            }
-        }
-
-        RepairClassesSettings rcs = new RepairClassesSettings();
-
-        rcs.setUserId(ircr.getUserId());
-        rcs.setShiftId(StringUtils.join(ircr.getShiftIds(), ','));
-        rcs.setStartDate(ircr.getStartDate());
-
-        int result = repairClassesSettingsService.insertRepairClassesSettings(rcs);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairClassesSettingsById(updateRepairClassesRequest urcr, BindingResult bindingResult) throws ParseException {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        if (urcr.getStartDate() == null) {
-            return CommonResult.fail("开始日期不能为空");
-        }
-
-        //防止选择的班次重叠
-        List<RepairShiftSettings> datas = repairShiftSettingsService.getRepairsByShiftIds(urcr.getShiftIds());
-        for (int i = 0; i < datas.size(); i++) {
-            for (int j = i + 1; j < datas.size(); j++) {
-                boolean isOver = TimeExchange.overlapping(datas.get(i).getStartTime(), datas.get(i).getEndTime(), datas.get(j).getStartTime(), datas.get(j).getEndTime());
-                if (isOver) {
-                    return CommonResult.fail(datas.get(i).getStartTime() + "-" + datas.get(i).getEndTime() + "时间段和" + datas.get(j).getStartTime() + "-" + datas.get(j).getEndTime() + "时间段存在重叠");
-                }
-            }
-        }
-
-        RepairClassesSettings rcs = new RepairClassesSettings();
-        rcs.setId(urcr.getId());
-        rcs.setUserId(urcr.getUserId());
-        rcs.setShiftId(StringUtils.join(urcr.getShiftIds(), ','));
-        rcs.setStartDate(urcr.getStartDate());
-
-        int result = repairClassesSettingsService.updateRepairClassesSettings(rcs);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairClassesSettingss(int currentPage, int pageCount, String startTime, String endTime) {
-        PageUtils<RepairUser> result = repairUserService.queryPageRepairUser(currentPage, pageCount);
-        List<Integer> userIds = result.getList().stream().map(RepairUser::getId).collect(Collectors.toList());
-
-        if (startTime == null || endTime == null) {
-            String[] weeks = TimeExchange.getCurrentWeekTimeFrame();
-            startTime = weeks[0];
-            endTime = weeks[1];
-        }
-
-        LocalDate StartDate = LocalDate.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        LocalDate EndDate = LocalDate.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        List<ClassSettingDateVo> dates = TimeExchange.getDatesBetween(StartDate, EndDate);
-
-        try {
-            startTime = startTime == null ? startTime : TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-            endTime = endTime == null ? endTime : TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-        } catch (Exception e) {
-
-        }
-
-        List<ClassesSettingVo> datas = repairClassesSettingsService.getRepairByUserIds(userIds, startTime, endTime);
-        List<ClassesSettingPageDataVo> cspds = new ArrayList<>();
-        for (RepairUser ru : result.getList()) {
-            ClassesSettingPageDataVo cspd = new ClassesSettingPageDataVo();
-            cspd.setSchoolId(ru.getSchoolId());
-            cspd.setSchoolName(eSchool.stringOf(ru.getSchoolId()));
-            cspd.setUserId(ru.getId());
-            cspd.setUserName(ru.getUserName());
-            List<ClassesSettingVo> classDatas = datas.stream().filter(e -> e.getUserId() == ru.getId()).collect(Collectors.toList());
-
-            for (ClassSettingDateVo d : dates) {
-                Optional<ClassesSettingVo> o = classDatas.stream().filter(e -> e.getStartDate().equals(d.getDateStr())).findFirst();
-                if (!(o != null && o.isPresent())) {
-                    ClassesSettingVo newData = new ClassesSettingVo();
-                    newData.setStartDate(d.getDateStr());
-                    newData.setUserId(ru.getId());
-                    classDatas.add(newData);
-                }
-            }
-            classDatas.sort(Comparator.comparing(ClassesSettingVo::getStartDate));
-            cspd.setClassSettings(classDatas);
-            cspds.add(cspd);
-        }
-
-        ClassesSettingPageVo data = new ClassesSettingPageVo();
-        data.setDates(dates);
-        PageUtils ssss = new PageUtils(cspds, result.getTotalCount(), result.getTotalPage(), result.getCurrPage());
-        data.setPageDatas(ssss);
-        return CommonResult.ok(data);
-    }
-
-    @Override
-    public void downloadRepairClassesExcel(String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        List<RepairUser> result = repairUserService.queryRepairUsers();
-
-        List<Integer> userIds = result.stream().map(RepairUser::getId).collect(Collectors.toList());
-
-        if (startTime == null || endTime == null) {
-            String[] weeks = TimeExchange.getCurrentWeekTimeFrame();
-            startTime = weeks[0];
-            endTime = weeks[1];
-        }
-
-        LocalDate StartDate = LocalDate.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        LocalDate EndDate = LocalDate.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        List<ClassSettingDateVo> dates = TimeExchange.getDatesBetween(StartDate, EndDate);
-
-        try {
-            startTime = startTime == null ? startTime : TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-            endTime = endTime == null ? endTime : TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-        } catch (Exception e) {
-
-        }
-
-        List<ClassesSettingVo> datas = repairClassesSettingsService.getRepairByUserIds(userIds, startTime, endTime);
-        List<Map<String, Object>> list = new ArrayList<>();
-        for (RepairUser ru : result) {
-            Map<String, Object> map = new LinkedHashMap<>();
-            map.put("名称", ru.getUserName());
-            List<ClassesSettingVo> classDatas = datas.stream().filter(e -> e.getUserId() == ru.getId()).collect(Collectors.toList());
-
-            for (ClassSettingDateVo d : dates) {
-                Optional<ClassesSettingVo> o = classDatas.stream().filter(e -> e.getStartDate().equals(d.getDateStr())).findFirst();
-                if (!(o != null && o.isPresent())) {
-                    map.put(d.getDateStr() + "(" + d.getWeekStr() + ")", "");
-                } else {
-                    map.put(d.getDateStr() + "(" + d.getWeekStr() + ")", o.get().getShiftName());
-                }
-            }
-
-            list.add(map);
-        }
-
-        ExcelExportUtil.createExcel(list, "testExcel.xlsx", "测试文档", response);
-    }
-
-
-    @Override
-    public CommonResult deleteRepairClassesSettingsById(int id) {
-        RepairClassesSettings data = repairClassesSettingsService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairClassesSettingsService.deleteRepairClassesSettingsById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public void downloadRepairClassesSettingExcel(HttpServletResponse response) {
-        ExcelUtils.fileDownload("/自定义排班模板.xlsx", response);
-    }
-
-    @Override
-    public CommonResult queryPageUserClasses(int currentPage, int pageCount, int schoolId) {
-        PageUtils<AddressBookVo> result = repairUserService.queryUserPageBySchoolId(currentPage, pageCount, schoolId);
-        List<Integer> userIds = result.getList().stream().map(AddressBookVo::getId).collect(Collectors.toList());
-
-        List<ClassesDataVo> users = repairClassesSettingsService.queryClassesDatas(userIds, schoolId);
-
-        List<UserScheduleVo> results = new ArrayList<>();
-        for (AddressBookVo ru : result.getList()) {
-            UserScheduleVo dataV = new UserScheduleVo();
-            dataV.setId(ru.getId());
-            dataV.setUserName(ru.getUserName());
-            dataV.setUserPhone(ru.getUserPhone());
-            dataV.setWorkTypeName(ru.getWorkTypeName());
-            dataV.setState(ru.getState());
-            dataV.setStateStr(ru.getStateStr());
-            Optional<ClassesDataVo> data = users.stream().filter(e -> Integer.valueOf(e.getUserId()).equals(ru.getId())).findFirst();
-            if (data != null && data.isPresent()) {
-                dataV.setShifts(data.get().getShifts());
-                dataV.setClassId(data.get().getId());
-            }
-            results.add(dataV);
-        }
-
-        PageUtils resultPage = new PageUtils(results, result.getTotalCount(), result.getTotalPage(), result.getCurrPage());
-        return CommonResult.ok(resultPage);
-    }
-
-    @Override
-    public CommonResult updateUserClasses(UserScheduleVo usv, BindingResult bindingResult) throws ParseException {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairUser user = repairUserService.getRepairById(usv.getId());
-        if (user == null) {
-            return CommonResult.fail("用户信息失效,修改失败");
-        }
-
-        if (!user.getState().equals(usv.getState())) {
-            user.setState(usv.getState());
-            int updateUser = repairUserService.updateRepairUser(user);
-            if (updateUser <= 0) {
-                return CommonResult.fail("用户信息更新失败");
-            }
-        }
-        if (usv.getShifts() != null && usv.getShifts().size() > 0) {
-            List<String> shifts = usv.getShifts().stream().map(ShiftSettingDataVo::getId).distinct().collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.toList());
-
-            List<RepairShiftSettings> datas = repairShiftSettingsService.getRepairsByShiftIds(shifts);
-            for (int i = 0; i < datas.size(); i++) {
-                for (int j = i + 1; j < datas.size(); j++) {
-                    boolean isOver = TimeExchange.overlapping(datas.get(i).getStartTime(), datas.get(i).getEndTime(), datas.get(j).getStartTime(), datas.get(j).getEndTime());
-                    if (isOver) {
-                        return CommonResult.fail(datas.get(i).getStartTime() + "-" + datas.get(i).getEndTime() + "时间段和" + datas.get(j).getStartTime() + "-" + datas.get(j).getEndTime() + "时间段存在重叠");
-                    }
-                }
-            }
-
-            RepairClassesSettings rcs = new RepairClassesSettings();
-            //为空则新增排班数据
-            if (usv.getClassId() == null) {
-                //判断对应师傅当天排班数据是否存在
-                ClassesDataVo csv = repairClassesSettingsService.queryClassesData(usv.getId());
-                if (csv != null) {
-                    return CommonResult.fail("排班数据已存在,新增失败");
-                }
-
-                rcs.setUserId(usv.getId());
-                Date date = new Date();
-                Instant instant = date.toInstant();
-                ZoneId zoneId = ZoneId.systemDefault();
-                // atZone()方法返回在指定时区从此Instant生成的ZonedDateTime。
-                LocalDate localDate = instant.atZone(zoneId).toLocalDate();
-                rcs.setStartDate(localDate);
-                rcs.setShiftId(StringUtils.join(shifts, ","));
-
-                int insertClasses = repairClassesSettingsService.insertRepairClassesSettings(rcs);
-                if (insertClasses <= 0) {
-                    return CommonResult.fail("排班信息新增失败");
-                }
-            } else {
-                rcs.setShiftId(StringUtils.join(shifts, ","));
-                int updateClasses = repairClassesSettingsService.updateRepairClassesSettings(rcs);
-                if (updateClasses <= 0) {
-                    return CommonResult.fail("排班信息更新失败");
-                }
-            }
-        }
-
-        return CommonResult.ok("操作成功");
-
-    }
-
-    @Override
-    public CommonResult importRepairClassesSettingExcel(MultipartFile file) throws IOException, ParseException {
-        if (file.isEmpty() || file.getSize() == 0) {
-            return CommonResult.fail("导入文件不能为空");
-        }
-        String ContentType = file.getContentType();
-        InputStream inputStream = file.getInputStream();
-        List<RepairClassesSettings> result = new ArrayList<>();
-
-        //xls格式文件
-        if (ContentType.equals(eFileType.Xls.getValue())) {
-
-            CommonResult<List<RepairClassesSettings>> resultData = readXls(inputStream);
-            if (!resultData.isSuccess()) {
-                return resultData;
-            }
-            result = resultData.getData();
-
-        } else if (ContentType.equals(eFileType.Xlsx.getValue())) {
-            CommonResult<List<RepairClassesSettings>> resultData = readXlsx(inputStream);
-            if (!resultData.isSuccess()) {
-                return resultData;
-            }
-            result = resultData.getData();
-
-        } else {
-            return CommonResult.fail("排班数据导入只支持Xls、Xlsx");
-        }
-
-        boolean resultBool = repairClassesSettingsService.saveBatch(result);
-
-        return resultBool ? CommonResult.ok("导入成功") : CommonResult.fail("导入失败");
-    }
-
-
-    private CommonResult<List<RepairClassesSettings>> readXls(InputStream inputStream) throws IOException, ParseException {
-        int days = 0;
-        int month = 0;
-        int year = 0;
-        List<String> datas = new ArrayList<>();
-        HSSFWorkbook sheets = new HSSFWorkbook(inputStream);
-        List<RepairClassesSettings> result = new ArrayList<>();
-        //读取第一张sheet
-        HSSFSheet sheetAt = sheets.getSheetAt(0);
-
-        List<String> UserNames = new ArrayList<>();
-        List<Integer> userZZs = new ArrayList<>();
-        userZZs.add(1);
-        userZZs.add(2);
-        List<RepairUser> users = repairUserService.getRepairByUserZZ(userZZs, null);
-        List<RepairShiftSettings> shifts = repairShiftSettingsService.getRepairs();
-        List<RepairClassesSettings> clssses = new ArrayList<>();
-        //rowNum = 3 从第三行开始获取值
-        //sheetAt.getLastRowNum():从0开始统计数量 所以得+1
-        for (int rowNum = 0; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
-
-            HSSFRow row = sheetAt.getRow(rowNum);
-
-
-            if (row != null) {
-                //使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
-                //所以先使用setCellType()方法先将该单元格的类型设置为STRING
-                //然后poi会根据字符串读取它
-                //第一行数据获取月份
-                if (rowNum == 0) {
-                    try {
-                        row.getCell(0).setCellType(CellType.STRING);
-                        month = Integer.valueOf(row.getCell(0).getStringCellValue().substring(4, 6));
-                        year = Integer.valueOf(row.getCell(0).getStringCellValue().substring(0, 4));
-                    } catch (Exception e) {
-                        return CommonResult.fail("请按模板格式导入数据");
-                    }
-                    clssses = repairClassesSettingsService.getRepairByMonths(year + "-" + String.format("%02d", month));
-                } else if (rowNum == 3) {//日期
-
-                    days = TimeExchange.getMonthDays(TimeExchange.getDate(), month);
-                    for (int d = 1; d <= row.getPhysicalNumberOfCells() - 1; d++) {
-                        row.getCell(d).setCellType(CellType.STRING);
-                        String stringCellValue = year + "-" + String.format("%02d", month) + "-" + String.format("%02d", Integer.valueOf(row.getCell(d).getStringCellValue()));
-                        datas.add(stringCellValue);
-                    }
-                } else if (rowNum >= 4) {
-                    row.getCell(0).setCellType(CellType.STRING);
-                    String UserName = row.getCell(0).getStringCellValue();
-                    int userId = 0;
-                    Optional<RepairUser> userData = users.stream().filter(e -> e.getUserName().equals(UserName)).findFirst();
-                    if (userData != null && userData.isPresent()) {
-                        userId = userData.get().getId();
-                    }
-                    if (userId == 0) {
-                        return CommonResult.fail(UserName + "用户数据不存在");
-                    }
-                    UserNames.add(UserName);
-                    if (UserNames.stream().distinct().count() != UserNames.size()) {
-                        return CommonResult.fail("导入的Excel中" + UserName + "存在重复数据");
-                    }
-
-                    for (int d = 1; d <= datas.size(); d++) {
-                        Integer userid = userId;
-                        String dateStr = datas.get(d - 1);
-                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-                        //重复数据不让导入
-                        long exist = clssses.stream().filter(e -> e.getUserId().equals(userid) && e.getStartDate().format(formatter).equals(dateStr)).count();
-                        if (exist > 0) {
-                            return CommonResult.fail(UserName + "的" + dateStr + "日数据在系统中已存在,请勿重复导入");
-                        }
-
-                        //用户ID
-                        RepairClassesSettings classData = new RepairClassesSettings();
-                        classData.setUserId(userId);
-                        //日期
-                        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-                        LocalDate dateParam = LocalDate.parse(datas.get(d - 1), df);
-                        classData.setStartDate(dateParam);
-                        //班次ID
-                        row.getCell(d).setCellType(CellType.STRING);
-                        String stringCellValue = row.getCell(d).getStringCellValue();
-                        String[] shiftStrs = stringCellValue.split("、");
-                        List<String> shiftIds = new ArrayList<>();
-                        List<RepairShiftSettings> shiftDatas = new ArrayList<>();
-                        for (String shiftStr : shiftStrs) {
-                            if (!shiftStr.equals("")) {
-                                Optional<RepairShiftSettings> shiftData = shifts.stream().filter(e -> e.getName().equals(shiftStr)).findFirst();
-                                if (shiftData != null && shiftData.isPresent()) {
-                                    shiftIds.add(shiftData.get().getId().toString());
-                                    shiftDatas.add(shiftData.get());
-                                } else {
-                                    return CommonResult.fail(UserName + "的" + datas.get(d - 1) + "的" + shiftStr + "数据不存在");
-                                }
-                            }
-                        }
-
-                        for (int i = 0; i < shiftDatas.size(); i++) {
-                            for (int j = i + 1; j < shiftDatas.size(); j++) {
-                                boolean isOver = TimeExchange.overlapping(shiftDatas.get(i).getStartTime(), shiftDatas.get(i).getEndTime(), shiftDatas.get(j).getStartTime(), shiftDatas.get(j).getEndTime());
-                                if (isOver) {
-                                    return CommonResult.fail(UserName + "师傅的" + datas.get(d - 1) + "日" + shiftDatas.get(i).getStartTime() + "-" + shiftDatas.get(i).getEndTime() + "时间段和" + shiftDatas.get(j).getStartTime() + "-" + shiftDatas.get(j).getEndTime() + "时间段存在重叠");
-                                }
-                            }
-                        }
-                        classData.setShiftId(StringUtils.join(shiftIds, ','));
-                        result.add(classData);
-                    }
-                }
-            }
-        }
-        return CommonResult.ok(result);
-    }
-
-    private CommonResult<List<RepairClassesSettings>> readXlsx(InputStream inputStream) throws IOException, ParseException {
-        int days = 0;
-        int month = 0;
-        int year = 0;
-        List<String> datas = new ArrayList<>();
-        XSSFWorkbook sheets = new XSSFWorkbook(inputStream);
-        List<RepairClassesSettings> result = new ArrayList<>();
-        //读取第一张sheet
-        XSSFSheet sheetAt = sheets.getSheetAt(0);
-
-        List<String> UserNames = new ArrayList<>();
-        List<Integer> userZZs = new ArrayList<>();
-        userZZs.add(1);
-        userZZs.add(2);
-        List<RepairUser> users = repairUserService.getRepairByUserZZ(userZZs, null);
-        List<RepairShiftSettings> shifts = repairShiftSettingsService.getRepairs();
-        List<RepairClassesSettings> clssses = new ArrayList<>();
-        //rowNum = 3 从第三行开始获取值
-        //sheetAt.getLastRowNum():从0开始统计数量 所以得+1
-        for (int rowNum = 0; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
-
-            XSSFRow row = sheetAt.getRow(rowNum);
-
-
-            if (row != null) {
-                //使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
-                //所以先使用setCellType()方法先将该单元格的类型设置为STRING
-                //然后poi会根据字符串读取它
-                //第一行数据获取月份
-                if (rowNum == 0) {
-                    try {
-                        row.getCell(0).setCellType(CellType.STRING);
-                        month = Integer.valueOf(row.getCell(0).getStringCellValue().substring(4, 6));
-                        year = Integer.valueOf(row.getCell(0).getStringCellValue().substring(0, 4));
-                    } catch (Exception e) {
-                        return CommonResult.fail("请按模板格式导入数据");
-                    }
-                    clssses = repairClassesSettingsService.getRepairByMonths(year + "-" + String.format("%02d", month));
-
-                } else if (rowNum == 3) {//日期
-
-                    days = TimeExchange.getMonthDays(TimeExchange.getDate(), month);
-                    for (int d = 1; d <= row.getPhysicalNumberOfCells() - 1; d++) {
-                        row.getCell(d).setCellType(CellType.STRING);
-                        String stringCellValue = year + "-" + String.format("%02d", month) + "-" + String.format("%02d", Integer.valueOf(row.getCell(d).getStringCellValue()));
-                        datas.add(stringCellValue);
-                    }
-                } else if (rowNum >= 4) {
-                    row.getCell(0).setCellType(CellType.STRING);
-                    String UserName = row.getCell(0).getStringCellValue();
-                    int userId = 0;
-                    Optional<RepairUser> userData = users.stream().filter(e -> e.getUserName().equals(UserName)).findFirst();
-                    if (userData != null && userData.isPresent()) {
-                        userId = userData.get().getId();
-                    }
-                    if (userId == 0) {
-                        return CommonResult.fail(UserName + "用户数据不存在");
-                    }
-                    UserNames.add(UserName);
-                    if (UserNames.stream().distinct().count() != UserNames.size()) {
-                        return CommonResult.fail("导入的Excel中" + UserName + "存在重复数据");
-                    }
-
-                    for (int d = 1; d <= datas.size(); d++) {
-                        Integer userid = userId;
-                        String dateStr = datas.get(d - 1);
-                        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-                        //重复数据不让导入
-                        long exist = clssses.stream().filter(e -> e.getUserId().equals(userid) && e.getStartDate().format(formatter).equals(dateStr)).count();
-                        if (exist > 0) {
-                            return CommonResult.fail(UserName + "的" + dateStr + "日数据在系统中已存在,请勿重复导入");
-                        }
-
-                        //用户ID
-                        RepairClassesSettings classData = new RepairClassesSettings();
-                        classData.setUserId(userId);
-                        //日期
-                        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-                        LocalDate dateParam = LocalDate.parse(datas.get(d - 1), df);
-                        classData.setStartDate(dateParam);
-                        //班次ID
-                        row.getCell(d).setCellType(CellType.STRING);
-                        String stringCellValue = row.getCell(d).getStringCellValue();
-                        String[] shiftStrs = stringCellValue.split("、");
-                        List<String> shiftIds = new ArrayList<>();
-                        List<RepairShiftSettings> shiftDatas = new ArrayList<>();
-                        for (String shiftStr : shiftStrs) {
-                            if (!shiftStr.equals("")) {
-                                Optional<RepairShiftSettings> shiftData = shifts.stream().filter(e -> e.getName().equals(shiftStr)).findFirst();
-                                if (shiftData != null && shiftData.isPresent()) {
-                                    shiftIds.add(shiftData.get().getId().toString());
-                                    shiftDatas.add(shiftData.get());
-                                } else {
-                                    return CommonResult.fail(UserName + "的" + datas.get(d - 1) + "的" + shiftStr + "数据不存在");
-                                }
-                            }
-                        }
-
-                        for (int i = 0; i < shiftDatas.size(); i++) {
-                            for (int j = i + 1; j < shiftDatas.size(); j++) {
-                                boolean isOver = TimeExchange.overlapping(shiftDatas.get(i).getStartTime(), shiftDatas.get(i).getEndTime(), shiftDatas.get(j).getStartTime(), shiftDatas.get(j).getEndTime());
-                                if (isOver) {
-                                    return CommonResult.fail(UserName + "师傅的" + datas.get(d - 1) + "日" + shiftDatas.get(i).getStartTime() + "-" + shiftDatas.get(i).getEndTime() + "时间段和" + shiftDatas.get(j).getStartTime() + "-" + shiftDatas.get(j).getEndTime() + "时间段存在重叠");
-                                }
-                            }
-                        }
-                        classData.setShiftId(StringUtils.join(shiftIds, ','));
-                        result.add(classData);
-                    }
-                }
-            }
-        }
-        return CommonResult.ok(result);
-    }
-
-}
-

+ 0 - 80
src/main/java/com/repair/controller/RepairCloseController.java

@@ -1,80 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairCloseControllerAPI;
-
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairClose;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairCloseService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-08-04
- */
-@RestController
-public class RepairCloseController implements RepairCloseControllerAPI {
-
-    @Autowired
-    private RepairCloseService repairCloseService;
-
-    @Override
-    public CommonResult InsertRepairClose(RepairClose rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairCloseService.insertRepairClose(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairCloseById(RepairClose rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairCloseService.updateRepairClose(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairCloses(int currentPage, int pageCount, String name) {
-        PageUtils<RepairClose> result = repairCloseService.queryPageRepairCloses(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairCloseById(int id) {
-        RepairClose data = repairCloseService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairCloseService.deleteRepairCloseById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult queryRepairCloses() {
-        List<RepairClose> result = repairCloseService.getRepairs();
-        return CommonResult.ok(result);
-    }
-}
-

+ 0 - 75
src/main/java/com/repair/controller/RepairCollaborateRecordController.java

@@ -1,75 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairCollaborateRecordControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairCollaborateRecord;
-import com.repair.model.pojo.RepairCollaborateRecord;
-import com.repair.model.pojo.RepairCollaborateRecord;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairCollaborateRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairCollaborateRecordController implements RepairCollaborateRecordControllerAPI {
-
-    @Autowired
-    private RepairCollaborateRecordService repairCollaborateRecordService;
-
-    @Override
-    public CommonResult InsertrepairCollaborateRecord(RepairCollaborateRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairCollaborateRecordService.insertRepairCollaborateRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairCollaborateRecordById(RepairCollaborateRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairCollaborateRecordService.updateRepairCollaborateRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairCollaborateRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairCollaborateRecord> result = repairCollaborateRecordService.queryPageRepairCollaborateRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairCollaborateRecordById(int id) {
-        RepairCollaborateRecord data = repairCollaborateRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairCollaborateRecordService.deleteRepairCollaborateRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 334
src/main/java/com/repair/controller/RepairConsumablesController.java

@@ -1,334 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairConsumablesControllerAPI;
-import com.repair.common.utils.ExcelExportUtil;
-import com.repair.common.utils.ExcelUtils;
-import com.repair.common.utils.TimeExchange;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eRecordStatu;
-import com.repair.model.pojo.RepairConsumables;
-import com.repair.model.pojo.RepairRecord;
-import com.repair.model.request.insertConsumablesRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.ChangeConsumesVo;
-import com.repair.model.vo.ChangePriceConsumeVo;
-import com.repair.model.vo.ConsumableExcelVo;
-import com.repair.model.vo.ConsumablePageVo;
-import com.repair.services.RepairConsumablesService;
-import com.repair.services.RepairRecordService;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairConsumablesController implements RepairConsumablesControllerAPI {
-
-    @Autowired
-    private RepairConsumablesService repairConsumablesService;
-    @Autowired
-    private RepairRecordService repairRecordService;
-
-    @Override
-    public CommonResult InsertrepairConsumables(RepairConsumables rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairConsumablesService.insertRepairConsumables(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairConsumablesById(RepairConsumables rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairConsumablesService.updateRepairConsumables(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairConsumabless(int currentPage, int pageCount, String name) {
-        PageUtils<RepairConsumables> result = repairConsumablesService.queryPageRepairConsumabless(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairConsumablesById(int id) {
-        RepairConsumables data = repairConsumablesService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairConsumablesService.deleteRepairConsumablesById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult queryRepairConsumablePageList(int currentPage, int pageCount, String keyWord, String startTime, String endTime) {
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-
-        PageUtils<ConsumablePageVo> result = repairConsumablesService.queryConsumablePageList(currentPage, pageCount, keyWord, startTime, endTime);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public void downloadRepairConsumableExcel(String keyWord, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        Map<String, String> map = new HashMap<>();
-        //表头与键值对的映射关系
-        map.put("id", "数据ID");
-        map.put("consumeName", "耗材名称");
-        map.put("price", "单价(元)");
-        map.put("number", "数量");
-        map.put("totalPrice", "金额(元)");
-        map.put("articleName", "工单");
-        map.put("reportTimeStr", "报修时间");
-        map.put("updateTimeStr", "维修时间");
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-        List<ConsumableExcelVo> datas = repairConsumablesService.queryConsumablePageList(keyWord, startTime, endTime);
-
-        List<String> orderList = new ArrayList<>();
-        orderList.add("id");
-        orderList.add("consumeName");
-        orderList.add("price");
-        orderList.add("number");
-        orderList.add("totalPrice");
-        orderList.add("articleName");
-        orderList.add("reportTimeStr");
-        orderList.add("updateTimeStr");
-
-        //导出逻辑 这里的list是从导入里面哪来的 map1与map不一样 orderList这里为空
-        Workbook workbook = ExcelExportUtil.createWorkbook(datas, map, 1, "耗材记录表", orderList);
-
-        ExcelUtils.excelDownload(workbook, "耗材记录.xlsx", response);
-    }
-
-    @Override
-    @Transactional(rollbackFor = {Exception.class})
-    public CommonResult InsertMaintenanceConsumables(MaintenanceConsumeablesRequest data, BindingResult bindingResult) throws Exception {
-        try {
-            if (bindingResult.hasErrors()) {
-                String st = paramUtils.getParamError(bindingResult);
-                return CommonResult.fail(st);
-            }
-
-            if (data.getConsumes().size() <= 0) {
-                return CommonResult.fail("无耗材数据,报价失败");
-            }
-
-            List<RepairConsumables> rcDatas = new ArrayList<>();
-            for (insertConsumablesRequest rc : data.getConsumes()) {
-                if (rc.getConsumeId() == null) {
-                    return CommonResult.fail("耗材ID不能为空");
-                }
-                if (rc.getConsumeName() == null) {
-                    return CommonResult.fail("耗材名称不能为空");
-                }
-                if (rc.getNumber() == null || rc.getNumber() <= 0) {
-                    return CommonResult.fail("耗材数量不能为空");
-                }
-                if (rc.getPrice() == null) {
-                    return CommonResult.fail("耗材单价不能为空");
-                }
-                RepairConsumables rcData = new RepairConsumables();
-                rcData.setRecordId(data.getRecordId());
-                rcData.setArticleId(rc.getArticleId());
-                rcData.setConsumeId(rc.getConsumeId());
-                rcData.setConsumeName(rc.getConsumeName());
-                rcData.setNumber(rc.getNumber());
-                rcData.setPrice(rc.getPrice());
-                rcData.setTotalPrice(new BigDecimal(rcData.getNumber()).multiply(rcData.getPrice()));
-                rcDatas.add(rcData);
-            }
-
-            RepairRecord rr = repairRecordService.getRepairById(data.getRecordId());
-            if (rr == null) {
-                return CommonResult.fail("报修工单不存在,报价失败");
-            }
-
-            if (rr.getMaintenanceState() == eRecordStatu.Finished.getValue()
-                    || rr.getMaintenanceState() == eRecordStatu.Canceled.getValue()
-                    || rr.getMaintenanceState() == eRecordStatu.Closed.getValue()) {
-                return CommonResult.fail("当前报修工单状态发生变化,报价失败");
-            }
-
-            boolean result = repairConsumablesService.insertConsumableBatch(rcDatas);
-
-            if (!result) {
-                throw new Exception("报价失败!");
-            }
-
-            //只有用户支付完了之后,维修师傅才能继续看到这个单子
-            rr.setMaintenanceState(eRecordStatu.ToConfirmed.getValue());
-            rr.setPrice(data.getTotalPrice());
-            int updateRecord = repairRecordService.updateRepairRecord(rr);
-            if (updateRecord <= 0) {
-                throw new Exception("报价失败!");
-            }
-        } catch (Exception e) {
-            throw new Exception("报价失败!");
-        }
-
-        return CommonResult.ok("报价成功");
-    }
-
-    @Override
-    public CommonResult queryChangePriceConsumables(Integer recordId) {
-        RepairRecord rr = repairRecordService.getRepairById(recordId);
-        if (rr == null) {
-            return CommonResult.fail("维修单已失效,改价失败");
-        }
-
-        if (rr.getMaintenanceState() != eRecordStatu.ToConfirmed.getValue()) {
-            return CommonResult.fail("维修单不是待确认状态,无法进行改价操作");
-        }
-        ChangePriceConsumeVo result = new ChangePriceConsumeVo();
-        result.setRecordId(recordId);
-        result.setTotalPrice(rr.getPrice());
-        result.setMaintenancerName(rr.getMaintenancerName());
-        result.setMaintenancerPhone(rr.getMaintenancerPhone());
-
-        List<ChangeConsumesVo> consumables = repairConsumablesService.repairChangeConsumes(recordId);
-
-        result.setConsumes(consumables);
-        return CommonResult.ok(result);
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = {Exception.class})
-    public CommonResult changeMaintenanceConsumables(MaintenanceConsumeablesRequest data, BindingResult bindingResult) throws Exception {
-        try {
-            if (bindingResult.hasErrors()) {
-                String st = paramUtils.getParamError(bindingResult);
-                return CommonResult.fail(st);
-            }
-
-            if (data.getConsumes().size() <= 0) {
-                return CommonResult.fail("无耗材数据,改价失败");
-            }
-
-            List<RepairConsumables> rcDatas = new ArrayList<>();
-            for (insertConsumablesRequest rc : data.getConsumes()) {
-                if (rc.getArticleId() == null) {
-                    return CommonResult.fail("报修物品ID不能为空");
-                }
-                if (rc.getConsumeId() == null) {
-                    return CommonResult.fail("耗材ID不能为空");
-                }
-                if (rc.getConsumeName() == null) {
-                    return CommonResult.fail("耗材名称不能为空");
-                }
-                if (rc.getNumber() == null || rc.getNumber() <= 0) {
-                    return CommonResult.fail("耗材数量不能为空");
-                }
-                if (rc.getPrice() == null) {
-                    return CommonResult.fail("耗材单价不能为空");
-                }
-                RepairConsumables rcData = new RepairConsumables();
-                if (rc.getId() != null && rc.getId() > 0) {
-                    rcData.setId(rc.getId());
-                }else{
-                    rcData.setId(0);
-                }
-                rcData.setRecordId(data.getRecordId());
-                rcData.setArticleId(rc.getArticleId());
-                rcData.setConsumeId(rc.getConsumeId());
-                rcData.setConsumeName(rc.getConsumeName());
-                rcData.setNumber(rc.getNumber());
-                rcData.setPrice(rc.getPrice());
-                rcData.setTotalPrice(new BigDecimal(rcData.getNumber()).multiply(rcData.getPrice()));
-                rcDatas.add(rcData);
-            }
-            //获取原有的耗材记录数据
-            List<ChangeConsumesVo> oldConsumables = repairConsumablesService.repairChangeConsumes(data.getRecordId());
-
-            RepairRecord rr = repairRecordService.getRepairById(data.getRecordId());
-            if (rr == null) {
-                return CommonResult.fail("报修工单不存在,改价失败");
-            }
-
-            if (rr.getMaintenanceState() == eRecordStatu.Finished.getValue()
-                    || rr.getMaintenanceState() == eRecordStatu.Canceled.getValue()
-                    || rr.getMaintenanceState() == eRecordStatu.Closed.getValue()) {
-                return CommonResult.fail("当前报修工单状态发生变化,改价失败");
-            }
-
-            boolean result = repairConsumablesService.saveorUpdateConsumableBatch(rcDatas);
-
-            if (!result) {
-                throw new Exception("改价失败!");
-            }
-
-            //只有用户支付完了之后,维修师傅才能继续看到这个单子
-            rr.setMaintenanceState(eRecordStatu.ToConfirmed.getValue());
-            rr.setPrice(data.getTotalPrice());
-            int updateRecord = repairRecordService.updateRepairRecord(rr);
-            if (updateRecord <= 0) {
-                throw new Exception("改价失败!");
-            }
-
-            List<Integer> newDatas = rcDatas.stream().map(RepairConsumables::getId).collect(Collectors.toList());
-            List<Integer> oldDatas = oldConsumables.stream().map(ChangeConsumesVo::getId).collect(Collectors.toList());
-            //oldData集合不在newDatas集合中的内容
-            List<Integer> ids = oldDatas.stream().filter(item -> !newDatas.contains(item)).collect(Collectors.toList());
-
-            if(ids.size() > 0){
-                int deleted = repairConsumablesService.deletedConsumableByIds(ids);
-                if (updateRecord <= 0) {
-                    throw new Exception("改价失败!");
-                }
-            }
-
-        } catch (Exception e) {
-            throw new Exception("改价失败!");
-        }
-
-        return CommonResult.ok("改价成功");
-    }
-}
-

+ 0 - 456
src/main/java/com/repair/controller/RepairConsumeController.java

@@ -1,456 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairConsumeControllerAPI;
-import com.repair.common.utils.ExcelExportUtil;
-import com.repair.common.utils.ExcelUtils;
-import com.repair.common.utils.TimeExchange;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eFileType;
-import com.repair.model.enumModel.eRecordStatu;
-import com.repair.model.pojo.*;
-import com.repair.model.request.insertRepairAssociationRequest;
-import com.repair.model.request.insertRepairConsumeRequest;
-import com.repair.model.request.updateRepairConsumeRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.ChangePriceConsumeVo;
-import com.repair.model.vo.ConsumeVo;
-import com.repair.model.vo.RepairConsumeVo;
-import com.repair.model.vo.RepairSchoolVo;
-import com.repair.services.RepairAreaService;
-import com.repair.services.RepairArticleTypeService;
-import com.repair.services.RepairConsumeService;
-import com.repair.services.RepairRecordService;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hpsf.Decimal;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.DataFormatter;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.util.*;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-18
- */
-@RestController
-public class RepairConsumeController implements RepairConsumeControllerAPI {
-
-    @Autowired
-    private RepairAreaService repairAreaService;
-    @Autowired
-    private RepairRecordService repairRecordService;
-    @Autowired
-    private RepairConsumeService repairConsumeService;
-    @Autowired
-    private RepairArticleTypeService repairArticleTypeService;
-
-    @Override
-    public CommonResult InsertRepairAssociation(insertRepairAssociationRequest irc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairConsume data = repairConsumeService.queryConsumeByName(irc.getName(), irc.getSchoolId());
-        if (data != null) {
-            return CommonResult.fail("该报修耗材已存在!");
-        }
-
-        RepairConsume rc = new RepairConsume()
-                .setName(irc.getName())
-                .setSchoolId(irc.getSchoolId())
-                .setArticleId(irc.getArticleId())
-                .setPrice(new BigDecimal(0));
-
-        int result = repairConsumeService.insertRepairConsume(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult InsertRepairConsume(insertRepairConsumeRequest ircr, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairConsume data = repairConsumeService.queryConsumeByName(ircr.getName(), ircr.getSchoolId());
-        if (data != null) {
-            return CommonResult.fail("该报修耗材已存在!");
-        }
-
-        RepairConsume rc = new RepairConsume()
-                .setName(ircr.getName())
-                .setSchoolId(ircr.getSchoolId())
-                .setArticleId(StringUtils.join(ircr.getArticleIds(), ','))
-                .setPrice(ircr.getPrice())
-                .setContent(ircr.getContent());
-
-        int result = repairConsumeService.insertRepairConsume(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairConsumeById(updateRepairConsumeRequest urcr, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairConsume data = repairConsumeService.queryConsumeByName(urcr.getName(), urcr.getSchoolId());
-        if (data != null && !data.getId().equals(urcr.getId())) {
-            return CommonResult.fail("该报修耗材已存在!");
-        }
-
-        RepairConsume rc = new RepairConsume()
-                .setId(urcr.getId())
-                .setSchoolId(urcr.getSchoolId())
-                .setName(urcr.getName())
-                .setArticleId(StringUtils.join(urcr.getArticleIds(), ','))
-                .setPrice(urcr.getPrice())
-                .setContent(urcr.getContent());
-
-        int result = repairConsumeService.updateRepairConsume(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairConsumes(int currentPage, int pageCount, String name, String startTime, String endTime) {
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-
-        PageUtils<RepairConsumeVo> result = repairConsumeService.queryPageRepairConsumes(currentPage, pageCount, name, startTime, endTime);
-
-        for (RepairConsumeVo r : result.getList()) {
-            if (r.getArticleId() != null) {
-                r.setArticleIds(Arrays.asList(r.getArticleId().split(",")));
-            }
-            if (r.getArticleName() != null) {
-                r.setArticleNames(Arrays.asList(r.getArticleName().split(",")));
-            }
-        }
-
-        return CommonResult.ok(result);
-
-    }
-
-    @Override
-    public CommonResult deleteRepairConsumeById(int id) {
-        RepairConsume data = repairConsumeService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairConsumeService.deleteRepairConsumeById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public void downloadRepairConsumeExcel(String name, String startTime, String endTime, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        Map<String, String> map = new HashMap<>();
-        //表头与键值对的映射关系
-        map.put("id", "数据ID");
-        map.put("name", "耗材名称");
-        map.put("schoolName", "校区名称");
-        map.put("price", "耗材单价");
-        map.put("artileName", "物品类型");
-        map.put("entryName", "录入人员");
-        map.put("updateTimeStr", "录入时间");
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-        List<ConsumeVo> datas = repairConsumeService.queryConsumeList(name, startTime, endTime);
-
-        List<String> orderList = new ArrayList<>();
-        orderList.add("id");
-        orderList.add("name");
-        orderList.add("schoolName");
-        orderList.add("price");
-        orderList.add("artileName");
-        orderList.add("entryName");
-        orderList.add("updateTimeStr");
-
-        //导出逻辑 这里的list是从导入里面哪来的 map1与map不一样 orderList这里为空
-        Workbook workbook = ExcelExportUtil.createWorkbook(datas, map, 1, "耗材管理表", orderList);
-
-        ExcelUtils.excelDownload(workbook, "耗材管理.xlsx", response);
-    }
-
-    @Override
-    public void downloadRepairConsumeModelExcel(HttpServletResponse response) {
-        ExcelUtils.fileDownload("/耗材管理模板.xlsx", response);
-    }
-
-    @Override
-    public CommonResult importRepairConsumeExcel(MultipartFile file) throws IOException {
-        if (file.isEmpty() || file.getSize() == 0) {
-            return CommonResult.fail("导入文件不能为空");
-        }
-        String ContentType = file.getContentType();
-        InputStream inputStream = file.getInputStream();
-        List<RepairConsume> result = new ArrayList<>();
-
-        //xls格式文件
-        if (ContentType.equals(eFileType.Xls.getValue())) {
-
-            CommonResult<List<RepairConsume>> resultData = readXls(inputStream);
-            if (!resultData.isSuccess()) {
-                return resultData;
-            }
-            result = resultData.getData();
-
-        } else if (ContentType.equals(eFileType.Xlsx.getValue())) {
-            CommonResult<List<RepairConsume>> resultData = readXlsx(inputStream);
-            if (!resultData.isSuccess()) {
-                return resultData;
-            }
-            result = resultData.getData();
-
-        } else {
-            return CommonResult.fail("耗材数据导入只支持Xls、Xlsx");
-        }
-
-        boolean resultBool = repairConsumeService.saveBatch(result);
-
-        return resultBool ? CommonResult.ok("导入成功") : CommonResult.fail("导入失败");
-    }
-
-    private CommonResult<List<RepairConsume>> readXls(InputStream inputStream) throws IOException {
-        HSSFWorkbook sheets = new HSSFWorkbook(inputStream);
-        List<RepairConsume> result = new ArrayList<>();
-        List<String> ConsumeNames = new ArrayList<>();
-        //读取第一张sheet
-        HSSFSheet sheetAt = sheets.getSheetAt(0);
-
-        //获取校区数据
-        List<RepairSchoolVo> schools = repairAreaService.queryRepairSchools();
-        //报修物品
-        List<RepairArticleType> articles = repairArticleTypeService.getRepairArticleTypes();
-        //耗材数据
-        List<RepairConsume> consumes = repairConsumeService.getConsumes();
-
-        DataFormatter dataFormatter = new DataFormatter();
-
-        try {
-            //sheetAt.getLastRowNum():从0开始统计数量 所以得+1
-            for (int rowNum = 1; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
-
-                HSSFRow row = sheetAt.getRow(rowNum);
-
-                if (rowNum == 1) {
-                    String name = dataFormatter.formatCellValue(row.getCell(0));//耗材名称
-                    if (!name.equals("名称")) {
-                        return CommonResult.fail("导入数据第一列为名称");
-                    }
-                    String schoolName = dataFormatter.formatCellValue(row.getCell(1));//校区名称
-                    if (!schoolName.equals("校区")) {
-                        return CommonResult.fail("导入数据第二列为校区");
-                    }
-                    String ArticleName = dataFormatter.formatCellValue(row.getCell(2));//报修物品类别
-                    if (!ArticleName.equals("类别")) {
-                        return CommonResult.fail("导入数据第三列为类别");
-                    }
-                    String price = dataFormatter.formatCellValue(row.getCell(3));//耗材单价
-                    if (!price.equals("价格(元)")) {
-                        return CommonResult.fail("导入数据第四列为价格");
-                    }
-
-                } else {
-                    RepairConsume data = new RepairConsume();
-                    //耗材名称
-                    String name = dataFormatter.formatCellValue(row.getCell(0));
-                    ConsumeNames.add(name);
-                    if (ConsumeNames.stream().distinct().count() != ConsumeNames.size()) {
-                        return CommonResult.fail("导入的Excel中" + name + "存在重复数据");
-                    }
-                    data.setName(name);
-                    //校区
-                    String schoolName = dataFormatter.formatCellValue(row.getCell(1));
-                    Optional<RepairSchoolVo> school = schools.stream().filter(e -> e.getName().equals(schoolName)).findFirst();
-                    if (school != null && school.isPresent()) {
-                        data.setSchoolId(school.get().getId());
-                    } else {
-                        return CommonResult.fail(name + "的" + schoolName + "校区数据在数据库中不存在");
-                    }
-
-                    //重复数据提示
-                    long exist = consumes.stream().filter(e -> e.getSchoolId().equals(school.get().getId()) && e.getName().equals(name)).count();
-                    if (exist > 0) {
-                        return CommonResult.fail(schoolName + "的" + name + "耗材数据在系统中已存在,请勿重复导入");
-                    }
-
-                    //报修物品(类别)
-                    String article = dataFormatter.formatCellValue(row.getCell(2));
-                    String[] articleStrs = null;
-                    if (article.contains("、")) {
-                        articleStrs = article.split("、");
-                    } else if (article.contains(",")) {
-                        articleStrs = article.split(",");
-                    } else {
-                        articleStrs = new String[1];
-                        articleStrs[0] = article;
-                    }
-                    List<String> ass = new ArrayList<>();
-                    for (String as : articleStrs) {
-                        if (!as.equals("")) {
-                            Optional<RepairArticleType> shiftData = articles.stream().filter(e -> e.getName().equals(as)).findFirst();
-                            if (shiftData != null && shiftData.isPresent()) {
-                                ass.add(shiftData.get().getId().toString());
-                            } else {
-                                return CommonResult.fail(name + "的" + as + "数据不存在");
-                            }
-                        }
-                        data.setArticleId(StringUtils.join(ass, ','));
-                        result.add(data);
-                    }
-
-                    //价格
-                    BigDecimal price = new BigDecimal(String.valueOf(row.getCell(3))).stripTrailingZeros();
-                    data.setPrice(price);
-                }
-            }
-        } catch (Exception e) {
-            return CommonResult.fail("请按模板格式导入数据");
-        }
-
-        return CommonResult.ok(result);
-    }
-
-    private CommonResult<List<RepairConsume>> readXlsx(InputStream inputStream) throws IOException {
-        XSSFWorkbook sheets = new XSSFWorkbook(inputStream);
-        List<RepairConsume> result = new ArrayList<>();
-        List<String> ConsumeNames = new ArrayList<>();
-        //读取第一张sheet
-        XSSFSheet sheetAt = sheets.getSheetAt(0);
-
-        //获取校区数据
-        List<RepairSchoolVo> schools = repairAreaService.queryRepairSchools();
-        //报修物品
-        List<RepairArticleType> articles = repairArticleTypeService.getRepairArticleTypes();
-        //耗材数据
-        List<RepairConsume> consumes = repairConsumeService.getConsumes();
-
-        DataFormatter dataFormatter = new DataFormatter();
-
-        try {
-            //sheetAt.getLastRowNum():从0开始统计数量 所以得+1
-            for (int rowNum = 1; rowNum < sheetAt.getLastRowNum() + 1; rowNum++) {
-
-                XSSFRow row = sheetAt.getRow(rowNum);
-
-                if (rowNum == 1) {
-                    String name = dataFormatter.formatCellValue(row.getCell(0));//耗材名称
-                    if (!name.equals("名称")) {
-                        return CommonResult.fail("导入数据第一列为名称");
-                    }
-                    String schoolName = dataFormatter.formatCellValue(row.getCell(1));//校区名称
-                    if (!schoolName.equals("校区")) {
-                        return CommonResult.fail("导入数据第二列为校区");
-                    }
-                    String ArticleName = dataFormatter.formatCellValue(row.getCell(2));//报修物品类别
-                    if (!ArticleName.equals("类别")) {
-                        return CommonResult.fail("导入数据第三列为类别");
-                    }
-                    String price = dataFormatter.formatCellValue(row.getCell(3));//耗材单价
-                    if (!price.equals("价格(元)")) {
-                        return CommonResult.fail("导入数据第四列为价格");
-                    }
-
-                } else {
-                    RepairConsume data = new RepairConsume();
-                    //耗材名称
-                    String name = dataFormatter.formatCellValue(row.getCell(0));
-                    ConsumeNames.add(name);
-                    if (ConsumeNames.stream().distinct().count() != ConsumeNames.size()) {
-                        return CommonResult.fail("导入的Excel中" + name + "存在重复数据");
-                    }
-                    data.setName(name);
-                    //校区
-                    String schoolName = dataFormatter.formatCellValue(row.getCell(1));
-                    Optional<RepairSchoolVo> school = schools.stream().filter(e -> e.getName().equals(schoolName)).findFirst();
-                    if (school != null && school.isPresent()) {
-                        data.setSchoolId(school.get().getId());
-                    } else {
-                        return CommonResult.fail(name + "的" + schoolName + "校区数据在数据库中不存在");
-                    }
-
-                    //重复数据提示
-                    long exist = consumes.stream().filter(e -> e.getSchoolId().equals(school.get().getId()) && e.getName().equals(name)).count();
-                    if (exist > 0) {
-                        return CommonResult.fail(schoolName + "的" + name + "耗材数据在系统中已存在,请勿重复导入");
-                    }
-
-                    //报修物品(类别)
-                    String article = dataFormatter.formatCellValue(row.getCell(2));
-                    String[] articleStrs = null;
-                    if (article.contains("、")) {
-                        articleStrs = article.split("、");
-                    } else if (article.contains(",")) {
-                        articleStrs = article.split(",");
-                    } else {
-                        articleStrs = new String[1];
-                        articleStrs[0] = article;
-                    }
-                    List<String> ass = new ArrayList<>();
-                    for (String as : articleStrs) {
-                        if (!as.equals("")) {
-                            Optional<RepairArticleType> shiftData = articles.stream().filter(e -> e.getName().equals(as)).findFirst();
-                            if (shiftData != null && shiftData.isPresent()) {
-                                ass.add(shiftData.get().getId().toString());
-                            } else {
-                                return CommonResult.fail(name + "的" + as + "数据不存在");
-                            }
-                        }
-                        data.setArticleId(StringUtils.join(ass, ','));
-                        result.add(data);
-                    }
-
-                    //价格
-                    BigDecimal price = new BigDecimal(dataFormatter.formatCellValue(row.getCell(3)));
-                    data.setPrice(price);
-                }
-            }
-        } catch (Exception e) {
-            return CommonResult.fail("请按模板格式导入数据");
-        }
-
-        return CommonResult.ok(result);
-    }
-}
-

+ 0 - 75
src/main/java/com/repair/controller/RepairDispatchRecordController.java

@@ -1,75 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairDispatchRecordControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairDispatchRecord;
-import com.repair.model.pojo.RepairDispatchRecord;
-import com.repair.model.pojo.RepairDispatchRecord;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairDispatchRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairDispatchRecordController implements RepairDispatchRecordControllerAPI {
-
-    @Autowired
-    private RepairDispatchRecordService repairDispatchRecordService;
-
-    @Override
-    public CommonResult InsertrepairDispatchRecord(RepairDispatchRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairDispatchRecordService.insertRepairDispatchRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairDispatchRecordById(RepairDispatchRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairDispatchRecordService.updateRepairDispatchRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairDispatchRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairDispatchRecord> result = repairDispatchRecordService.queryPageRepairDispatchRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairDispatchRecordById(int id) {
-        RepairDispatchRecord data = repairDispatchRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairDispatchRecordService.deleteRepairDispatchRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 89
src/main/java/com/repair/controller/RepairEvaluateController.java

@@ -1,89 +0,0 @@
-package com.repair.controller;
-
-
-import com.alibaba.excel.EasyExcel;
-import com.repair.api.RepairEvaluateControllerAPI;
-import com.repair.common.utils.ExcelUtils;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairEvaluate;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.EvaluateVo;
-import com.repair.services.RepairEvaluateService;
-import org.apache.poi.ss.formula.functions.T;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletResponse;
-import java.net.URLEncoder;
-import java.util.Date;
-import java.util.List;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-10
- */
-@RestController
-public class RepairEvaluateController implements RepairEvaluateControllerAPI {
-
-    @Autowired
-    private RepairEvaluateService repairEvaluateService;
-
-    @Override
-    public CommonResult InsertRepairEvaluate(@RequestBody RepairEvaluate repairEvaluate, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairEvaluateService.insertRepairEvaluate(repairEvaluate);// 帮我们自动生成id
-
-        return result > 0 ? CommonResult.ok() : CommonResult.fail();
-    }
-
-    @Override
-    public CommonResult queryPageRepairEvaluates(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord, String startTime, String endTime) {
-        PageUtils<RepairEvaluate> result = repairEvaluateService.queryPageList(currentPage, pageCount, keyWord, startTime, endTime);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairEvaluateById(int id) {
-        RepairEvaluate data = repairEvaluateService.getRepairById(String.valueOf(id));
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairEvaluateService.deleteRepairEvaluateById(id);
-
-        return result > 0 ? CommonResult.ok() : CommonResult.fail();
-    }
-
-    @Override
-    public void toRepairEvaluateExcel(HttpServletResponse response,String keyWord, String startTime, String endTime) {
-        List<EvaluateVo> result = repairEvaluateService.queryEvaluateList(keyWord, startTime, endTime);
-
-        String sheelName = "评价信息";
-        try {
-            String fileName = URLEncoder.encode(sheelName + new Date().getTime(), "UTF-8");
-            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-            response.setCharacterEncoding("utf-8");
-            response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
-
-            EasyExcel.write(response.getOutputStream(), EvaluateVo.class).sheet(sheelName).doWrite(result);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
-

+ 0 - 133
src/main/java/com/repair/controller/RepairLeaveMessageController.java

@@ -1,133 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairLeaveMessageControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eRecordStatu;
-import com.repair.model.pojo.RepairLeaveMessage;
-import com.repair.model.pojo.RepairRecord;
-import com.repair.model.request.repairLeaveMessageRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.RepairLogisticsVo;
-import com.repair.services.RepairLeaveMessageService;
-import com.repair.services.RepairRecordService;
-import com.repair.services.RepairUserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairLeaveMessageController implements RepairLeaveMessageControllerAPI {
-
-    @Autowired
-    private RepairLeaveMessageService repairLeaveMessageService;
-    @Autowired
-    private RepairRecordService repairRecordService;
-    @Autowired
-    private RepairUserService repairUserService;
-
-
-    @Override
-    public CommonResult InsertrepairLeaveMessage(RepairLeaveMessage rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairLeaveMessageService.insertRepairLeaveMessage(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairLeaveMessageById(RepairLeaveMessage rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairLeaveMessageService.updateRepairLeaveMessage(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairLeaveMessages(int currentPage, int pageCount, String name) {
-        PageUtils<RepairLeaveMessage> result = repairLeaveMessageService.queryPageRepairLeaveMessages(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairLeaveMessageById(int id) {
-        RepairLeaveMessage data = repairLeaveMessageService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairLeaveMessageService.deleteRepairLeaveMessageById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult transferToLogistics(repairLeaveMessageRequest rlmr, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        //只有待确认能转后勤
-        RepairRecord rr = repairRecordService.getRepairById(rlmr.getRecordId());
-        if(rr == null){
-            return CommonResult.fail("报修单不存在,转后勤失败");
-        }
-
-        if(rr.getMaintenanceState() != eRecordStatu.ToConfirmed.getValue()){
-            return CommonResult.fail("待确认的报修单才能进行转后勤操作");
-        }
-
-        /**
-         * 获取报修工单对应校区的所有后勤人员
-         */
-        List<RepairLogisticsVo> users = repairUserService.queryLogisticsList(rlmr.getRecordId());
-        if (users.size() <= 0) {
-            return CommonResult.fail("该报修区域缺少后勤人员");
-        }
-
-        //有可能有多个后勤
-        List<RepairLeaveMessage> datas = new ArrayList<>();
-        for (RepairLogisticsVo u : users) {
-            RepairLeaveMessage data = new RepairLeaveMessage();
-            data.setSenderId(rlmr.getUserId());
-            data.setRecipientId(u.getId());
-            data.setContent(rlmr.getContent());
-            data.setRecordId(rlmr.getRecordId());
-            datas.add(data);
-        }
-
-        boolean result = repairLeaveMessageService.inserBatchLeaveMessage(datas);
-
-        //将工单状态更改为待处理
-        rr.setId(rlmr.getRecordId());
-        rr.setMaintenanceState(eRecordStatu.ToLogistics.getValue());
-
-        repairRecordService.updateRepairRecord(rr);
-
-        return result ? CommonResult.ok("操作成功") : CommonResult.fail("操作失败");
-    }
-}
-

+ 0 - 148
src/main/java/com/repair/controller/RepairNoticeSettingController.java

@@ -1,148 +0,0 @@
-package com.repair.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.repair.api.RepairNoticeSettingControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eIsTop;
-import com.repair.model.enumModel.eStatu;
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.pojo.RepairNoticeSetting;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.NoticePageVo;
-import com.repair.model.vo.NoticeVo;
-import com.repair.services.RepairNoticeSettingService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.ParseException;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-11
- */
-@RestController
-public class RepairNoticeSettingController implements RepairNoticeSettingControllerAPI {
-
-    @Autowired
-    private RepairNoticeSettingService repairNoticeSettingService;
-
-    /**
-     * 新增公告数据
-     * @param repairNoticeSetting
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult InsertRepairNoticeSetting(RepairNoticeSetting repairNoticeSetting, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairNoticeSettingService.insertRepairNoticeSetting(repairNoticeSetting);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    /**
-     * 编辑公告数据
-     * @param ra
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult updateRepairNoticeSettingById(RepairNoticeSetting ra, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairNoticeSettingService.updateRepairNoticeSetting(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    /**
-     * 查询公告分页数据
-     * @param currentPage 当前页
-     * @param pageCount 一页数据条数
-     * @param createTime 创建时间
-     * @return
-     */
-    @Override
-    public CommonResult queryPageRepairNoticeSettings(int currentPage, int pageCount, String createTime) throws ParseException {
-        PageUtils<NoticePageVo> result = repairNoticeSettingService.queryPageRepairNoticeSettings(currentPage, pageCount, createTime);
-
-        return CommonResult.ok(result);
-    }
-
-    /**
-     * 取消或置顶公告数据
-     * @param id 数据ID
-     * @param isTop 是否置顶
-     *               未置顶:0
-     *               置顶:1
-     * @return
-     */
-    @Override
-    public CommonResult cancelOrTopNoticeById(int id, int isTop) {
-        RepairNoticeSetting data = repairNoticeSettingService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,操作失败!");
-        }
-        if (data.getIsTop() == isTop) {
-            String Message = isTop == eIsTop.Top.getValue() ? "当前处于置顶状态,请勿重复操作!" : "当前处于未置顶状态,请勿重复操作!";
-            return CommonResult.fail(Message);
-        }
-
-        String success = isTop == eIsTop.Top.getValue() ? "置顶成功!" : "取消置顶成功";
-        String fail = isTop == eIsTop.Top.getValue() ? "置顶失败!" : "取消置顶失败";
-        RepairNoticeSetting ra = new RepairNoticeSetting();
-        ra.setId(id);
-        ra.setIsTop(isTop);
-        int result = repairNoticeSettingService.updateRepairNoticeSetting(ra);
-        System.out.println(result);
-        return result > 0 ? CommonResult.ok(success) : CommonResult.fail(fail);
-    }
-
-    /**
-     * 删除公告数据
-     * @param id 数据ID
-     * @return
-     */
-    @Override
-    public CommonResult deleteRepairNoticeSettingById(int id) {
-        RepairNoticeSetting data = repairNoticeSettingService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairNoticeSettingService.deleteRepairNoticeSettingById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult queryRepairNoticeSettingByTop() {
-        List<RepairNoticeSetting> result = repairNoticeSettingService.getRepairNotices();
-
-        NoticeVo data = new NoticeVo();
-
-        List<String> NotriceStr = result.stream().map(RepairNoticeSetting::getContent).collect(Collectors.toList());
-
-        data.setNoticeStr(StringUtils.join(NotriceStr, "    "));
-
-        return CommonResult.ok(data);
-    }
-}
-

+ 0 - 410
src/main/java/com/repair/controller/RepairPayRecordController.java

@@ -1,410 +0,0 @@
-package com.repair.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.repair.api.RepairPayRecordControllerAPI;
-import com.repair.common.utils.TimeExchange;
-import com.repair.common.utils.UUIDUtils;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eIsSuccess;
-import com.repair.model.enumModel.ePayPageStatu;
-import com.repair.model.enumModel.eRecordStatu;
-import com.repair.model.pojo.RepairPayRecord;
-import com.repair.model.pojo.RepairRecord;
-import com.repair.model.pojo.RepairRefundRecord;
-import com.repair.model.pojo.RepairUser;
-import com.repair.model.request.RefundableAmountRequest;
-import com.repair.model.request.repairPayRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.ProsperityRepairPayRecordsVo;
-import com.repair.services.RepairPayRecordService;
-import com.repair.services.RepairRecordService;
-import com.repair.services.RepairRefundRecordService;
-import com.repair.services.RepairUserService;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static com.repair.common.utils.StrUtils.getUUIDBits;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairPayRecordController implements RepairPayRecordControllerAPI {
-
-    @Autowired
-    private RepairRecordService repairRecordService;
-    @Autowired
-    private RepairPayRecordService repairPayRecordService;
-
-    @Autowired
-    private RepairUserService repairUserService;
-
-    @Autowired
-    private RepairRefundRecordService repairRefundRecordService;
-
-    @Override
-    public CommonResult InsertrepairPayRecord(RepairPayRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairPayRecordService.insertRepairPayRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairPayRecordById(RepairPayRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairPayRecordService.updateRepairPayRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairPayRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairPayRecord> result = repairPayRecordService.queryPageRepairPayRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairPayRecordById(int id) {
-        RepairPayRecord data = repairPayRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairPayRecordService.deleteRepairPayRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult repairPayment(repairPayRequest rpr, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairRecord data = repairRecordService.getRepairById(rpr.getRecordId());
-        if (data == null) {
-            return CommonResult.fail("维修单数据异常,支付失败");
-        }
-
-        if (data.getMaintenanceState() != eRecordStatu.ToConfirmed.getValue()) {
-            return CommonResult.fail("订单状态异常,支付失败");
-        }
-
-        if (data.getPrice().compareTo(rpr.getPrice()) != 0) {
-            return CommonResult.fail("支付金额与订单金额不一致");
-        }
-
-        //查找是否存在支付成功的数据,有的话提示已经支付过了
-        RepairPayRecord payData = repairPayRecordService.getRepairPaySuccessByRecordId(rpr.getRecordId());
-        if (payData != null) {
-            return CommonResult.fail("该订单已支付,请勿重复操作");
-        }
-        String payResult = null;
-        try {
-            //支付金额和订单都为0元的时候不唤起支付模块
-            payResult = notifyPay(TimeExchange.DateToString(new Date(), "yyyyMMddHHmmss"), data.getRecordNo(), rpr.getPrice().toString(), getUUIDBits(15), "02", "2", "1234567891");
-            if (!payResult.equals("success")) {
-                return CommonResult.fail("支付失败");
-            }
-        } catch (Exception e) {
-            return CommonResult.fail("支付失败");
-        }
-
-        return CommonResult.ok("支付成功");
-    }
-
-    /**
-     * 支付回调接口
-     *
-     * @param orderDate   交易日期时间 格式为:yyyyMMddHHmmss 24小时制
-     * @param orderNo     订单号
-     * @param amount      订单金额
-     * @param jylsh       支付平台交易流水号
-     * @param tranStat    订单支付状态
-     * @param return_type 通知类型
-     * @param sign        订单签名数据
-     * @return
-     */
-    @Transactional(rollbackFor = {Exception.class})
-    public String notifyPay(String orderDate, String orderNo, String amount, String jylsh, String tranStat, String return_type, String sign) throws Exception {
-
-        try {
-//            除去sign参数外,通知接口各参数皆是待签名参数。按照参数列表顺序,以“key=value&key1=value1”方式生成待签名字符串,再拼接密钥。进行MD5运算生成签名。
-//            示例:
-//            密钥:key=umz4aea6g97skeect0jtxigvjkrimd0o
-//            待签名字符串:
-//            orderDate=20140319163131&orderNo=1403190004&amount=10.00&jylsh=1303190000001&tranStat=1&return_type=1
-//            报文:
-//            orderDate=20140319163131&orderNo=1403190004&amount=10.00&jylsh=1303190000001&tranStat=1&return_type=1umz4aea6g97skeect0jtxigvjkrimd0o
-//            签名:3c797055ef08c16f296d1c28b696f301
-
-            RepairPayRecord data = repairPayRecordService.queryPaymentData(orderNo);
-
-            RepairRecord rr = repairRecordService.queryRepairByRecordno(orderNo);
-            if (rr == null) {
-                throw new Exception("支付回调失败!");
-            }
-
-            if (rr.getPrice().compareTo(new BigDecimal(amount)) != 0) {
-                throw new Exception("支付回调失败!");
-            }
-            //是否支付成功 未支付/等待支付:1;支付成功:2;支付失败:3
-            //可能支付平台会重复回调 所以原来支付成功的订单就不用处理了
-            if (data != null) {
-                if (data.getIsSuccess().equals(2)) {
-                    return "success";
-                }
-                data.setIsSuccess(Integer.valueOf(tranStat));
-                data.setRemark(data.getRemark() + "/n" + tranStat);
-
-                int updateData = repairPayRecordService.updateRepairPayRecord(data);
-                if (updateData <= 0) {
-                    throw new Exception("支付回调失败!");
-                }
-
-            } else {
-                data = new RepairPayRecord();
-                data.setRecordId(rr.getId());
-                data.setUserId(rr.getUserId());
-                data.setPayNo(jylsh);
-                data.setPayPrice(new BigDecimal(amount));
-                data.setIsSuccess(Integer.valueOf(tranStat));
-                data.setRemark(return_type);
-                int insertData = repairPayRecordService.insertRepairPayRecord(data);
-
-                if (insertData <= 0) {
-                    throw new Exception("支付回调失败!");
-                }
-            }
-
-            if (tranStat.equals("02")) {
-                //用户成功支付完成后将维修单状态由待确认改为维修中
-                rr.setMaintenanceState(eRecordStatu.Maintenance.getValue());
-                int rrData = repairRecordService.updateRepairRecord(rr);
-                if (rrData <= 0) {
-                    throw new Exception("支付回调失败!");
-                }
-            }
-
-        } catch (Exception e) {
-            throw new Exception("支付回调失败!");
-        }
-
-        return "success";
-    }
-
-    /**
-     * 支付成功分页
-     *
-     * @param currentPage
-     * @param pageCount
-     * @param keyWord
-     * @param startTime
-     * @param endTime
-     * @return
-     */
-    @Override
-    public CommonResult     queryProsperityRepairPayRecords(int currentPage, int pageCount, String keyWord, String startTime, String endTime) {
-
-        if (startTime != null && endTime != null) {
-            try {
-                startTime = TimeExchange.getStartOfDayStr(TimeExchange.StringToDate(startTime, "yyyy-MM-dd"));
-                endTime = TimeExchange.getEndOfDayStr(TimeExchange.StringToDate(endTime, "yyyy-MM-dd"));
-            } catch (Exception e) {
-            }
-        }
-
-
-        if (currentPage <= 0 && pageCount <= 0) {
-            currentPage = 1;
-            pageCount = 10;
-        }
-
-//      判断是否为名字
-        LambdaQueryWrapper<RepairUser> userWrapper = new LambdaQueryWrapper<>();
-        userWrapper.like(ObjectUtils.isNotEmpty(keyWord), RepairUser::getUserName, keyWord);
-
-        ArrayList<Integer> userIdList = new ArrayList<>();
-
-        List<RepairUser> list = repairUserService.list(userWrapper);
-        if (ObjectUtils.isNotEmpty(list) && list.size() >= 0) {
-            list.forEach(repairUser -> {
-                userIdList.add(repairUser.getId());
-            });
-        }
-
-
-        LambdaQueryWrapper<RepairPayRecord> wrapper = new LambdaQueryWrapper<>();
-
-        wrapper.in(ObjectUtils.isNotEmpty(keyWord) && userIdList.size() > 0, RepairPayRecord::getUserId, userIdList)
-                .between(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime), RepairPayRecord::getCreateTime, startTime, endTime)
-                .eq(RepairPayRecord::getIsSuccess, eIsSuccess.Succeed.getValue())
-                .or()
-                .like(ObjectUtils.isNotEmpty(keyWord), RepairPayRecord::getRecordId, keyWord)
-                .between(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime), RepairPayRecord::getCreateTime, startTime, endTime)
-                .eq(RepairPayRecord::getIsSuccess, eIsSuccess.Succeed.getValue());
-
-        IPage<RepairPayRecord> page = repairPayRecordService.page(new Page<>(currentPage, pageCount), wrapper);
-
-        IPage<ProsperityRepairPayRecordsVo> prpr = new Page<>();
-        BeanUtils.copyProperties(page, prpr);
-
-
-        ArrayList<ProsperityRepairPayRecordsVo> vos = new ArrayList<>();
-
-//    订单号
-        ArrayList<Integer> recordIdList = new ArrayList<>();
-
-//        报修人id
-        List<Integer> userIds = new ArrayList<>();
-
-        List<RepairPayRecord> records = page.getRecords();
-//        获取所有订单号
-        if (ObjectUtils.isEmpty(records)) {
-            records.forEach(repairPayRecord -> {
-                recordIdList.add(repairPayRecord.getRecordId());
-                userIds.add(repairPayRecord.getUserId());
-            });
-        }
-
-//        通过订单号查询退款记录
-        LambdaQueryWrapper<RepairRefundRecord> rrrsWrapepr = new LambdaQueryWrapper<>();
-        rrrsWrapepr.in(RepairRefundRecord::getRecordId, recordIdList)
-                .eq(RepairRefundRecord::getIsSuccess, eIsSuccess.Succeed.getValue());
-
-        List<RepairRefundRecord> refundRecords = repairRefundRecordService.list(rrrsWrapepr);
-
-//        通过人员id查询用户
-        LambdaQueryWrapper<RepairUser> userListWrapper = new LambdaQueryWrapper<>();
-        userListWrapper.in(RepairUser::getId, userIds)
-                .select(RepairUser::getId, RepairUser::getUserName);
-
-        List<RepairUser> users = repairUserService.list(userListWrapper);
-
-
-        records.forEach(rpr -> {
-            ProsperityRepairPayRecordsVo prrpv = new ProsperityRepairPayRecordsVo();
-            BeanUtils.copyProperties(rpr, prrpv);
-//            交易时间
-            prrpv.setPayTime(rpr.getCreateTime());
-
-            Integer recordId = rpr.getRecordId();
-
-            List<RepairRefundRecord> repairRefundRecords = new ArrayList<>();
-
-//            报修人id
-            Integer userId = rpr.getUserId();
-
-//            名字
-            if (ObjectUtils.isNotEmpty(users) && users.size() > 0) {
-                for (RepairUser user : users) {
-                    if (userId.equals(user.getId())) {
-                        prrpv.setUserName(user.getUserName());
-                    }
-                }
-            }
-
-
-//            退款总金额
-            BigDecimal refundPrice = BigDecimal.valueOf(0);
-//            退款记录
-            if (ObjectUtils.isNotEmpty(refundRecords) && refundRecords.size() > 0) {
-                for (RepairRefundRecord refundRecord : refundRecords) {
-                    if (recordId.equals(refundRecord.getRecordId())) {
-                        repairRefundRecords.add(refundRecord);
-                        refundPrice = refundPrice.add(refundRecord.getRefundPrice());
-                    }
-                }
-            }
-//      状态
-            if (repairRefundRecords.size() > 0) {
-                BigDecimal payPrice = rpr.getPayPrice();
-//
-                if (payPrice.compareTo(refundPrice) == 0) {
-                    prrpv.setState(ePayPageStatu.Refunded.getValue());
-                } else {
-                    prrpv.setState(ePayPageStatu.Rebates.getValue());
-                }
-            } else {
-                prrpv.setState(ePayPageStatu.HavePaid.getValue());
-            }
-
-            prrpv.setRepairRefundRecordList(repairRefundRecords);
-
-            vos.add(prrpv);
-        });
-
-        prpr.setRecords(vos);
-
-        return CommonResult.ok(prpr);
-    }
-
-    /**
-     * 实退
-     *
-     * @return
-     */
-    @Override
-    public CommonResult refundableAmount(RefundableAmountRequest rar, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-//      支付订单ID
-        Integer repairPayRecordId = rar.getRepairPayRecordId();
-//      总金额
-        BigDecimal refundPrice = rar.getRefundPrice();
-
-        RepairPayRecord repairPayRecord = repairPayRecordService.getById(repairPayRecordId);
-
-        RepairRefundRecord repairRefundRecord = new RepairRefundRecord();
-
-        repairRefundRecord.setRecordId(repairPayRecord.getRecordId());
-        repairRefundRecord.setUserId(repairPayRecord.getUserId());
-        repairRefundRecord.setWxNo(repairPayRecord.getPayNo());
-        repairRefundRecord.setRefundNo("ST"+ UUIDUtils.create());
-        repairRefundRecord.setRefundPrice(refundPrice);
-        repairRefundRecord.setIsSuccess(eIsSuccess.Succeed.getValue());
-        repairRefundRecord.setRemark("实退");
-
-        boolean save = repairRefundRecordService.save(repairRefundRecord);
-
-        if (save) {
-            return CommonResult.ok("实退成功");
-        }
-
-        return CommonResult.fail("实退失败");
-    }
-}
-

+ 0 - 74
src/main/java/com/repair/controller/RepairReceivingController.java

@@ -1,74 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairReceivingControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairReceiving;
-import com.repair.model.pojo.RepairReceiving;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairReceivingService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairReceivingController implements RepairReceivingControllerAPI {
-
-    @Autowired
-    private RepairReceivingService repairReceivingService;
-
-    @Override
-    public CommonResult InsertrepairReceiving(RepairReceiving rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairReceivingService.insertRepairReceiving(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairReceivingById(RepairReceiving rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairReceivingService.updateRepairReceiving(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairReceivings(int currentPage, int pageCount, String name) {
-        PageUtils<RepairReceiving> result = repairReceivingService.queryPageRepairReceivings(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairReceivingById(int id) {
-        RepairReceiving data = repairReceivingService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairReceivingService.deleteRepairReceivingById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

File diff suppressed because it is too large
+ 0 - 2221
src/main/java/com/repair/controller/RepairRecordController.java


+ 0 - 72
src/main/java/com/repair/controller/RepairRefundRecordController.java

@@ -1,72 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairRefundRecordControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairRefundRecord;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairRefundRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairRefundRecordController implements RepairRefundRecordControllerAPI {
-
-    @Autowired
-    private RepairRefundRecordService repairRefundRecordService;
-
-    @Override
-    public CommonResult InsertrepairRefundRecord(RepairRefundRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairRefundRecordService.insertRepairRefundRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairRefundRecordById(RepairRefundRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairRefundRecordService.updateRepairRefundRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairRefundRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairRefundRecord> result = repairRefundRecordService.queryPageRepairRefundRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairRefundRecordById(int id) {
-        RepairRefundRecord data = repairRefundRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairRefundRecordService.deleteRepairRefundRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 76
src/main/java/com/repair/controller/RepairSchoolController.java

@@ -1,76 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairSchoolControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairSchool;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairSchoolService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-12
- */
-@RestController
-public class RepairSchoolController implements RepairSchoolControllerAPI {
-
-    @Autowired
-    private RepairSchoolService repairSchoolService;
-
-    @Override
-    public CommonResult InsertRepairSchool(RepairSchool repairSchool, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = 0;
-        try {
-            result = repairSchoolService.insertRepairSchool(repairSchool);
-        } catch (Exception e) {
-            if (e.getCause().getMessage().contains("'repair_school.name_unique'")) {
-                return CommonResult.fail("该校区名称已存在!");
-            }
-            return CommonResult.fail("系统异常,用户数据添加失败!");
-        }
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairSchoolById(RepairSchool ra, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairSchoolService.updateRepairSchool(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairSchools(int currentPage, int pageCount, String name) {
-        PageUtils<RepairSchool> result = repairSchoolService.queryPageRepairSchools(currentPage, pageCount, name);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairSchoolById(int id) {
-        RepairSchool data = repairSchoolService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairSchoolService.deleteRepairSchoolById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 205
src/main/java/com/repair/controller/RepairShiftSettingsController.java

@@ -1,205 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairShiftSettingsControllerAPI;
-import com.repair.common.utils.TimeExchange;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairShiftSettings;
-import com.repair.model.request.insertRepairShiftSettingRequest;
-import com.repair.model.request.timeVo;
-import com.repair.model.request.updateRepairShiftRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairShiftSettingsService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.ParseException;
-import java.time.Duration;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-13
- */
-@RestController
-public class RepairShiftSettingsController implements RepairShiftSettingsControllerAPI {
-
-    @Autowired
-    private RepairShiftSettingsService repairShiftSettingsService;
-
-    @Override
-    public CommonResult InsertRepairShiftSettings(insertRepairShiftSettingRequest irssr, BindingResult bindingResult) throws ParseException {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        if (!TimeExchange.CompareDate(irssr.getStartTime(), irssr.getEndTime(), "HH:mm")) {
-            return CommonResult.fail("开始时间不能大于结束时间");
-        }
-
-        List<timeVo> tvs = new ArrayList<>();
-        //非工作时间必须都在结束时间之内 防止非工作时间重叠
-        for (String i : irssr.getNotWorkTime()) {
-            String[] time = i.split("-");
-            if(TimeExchange.CompareDate(time[0],time[1],"HH:mm")){
-                timeVo tv = new timeVo();
-                tv.setStart(time[0]);
-                tv.setEnd(time[1]);
-                tvs.add(tv);
-            }
-        }
-
-        for (int i = 0;i<tvs.size();i++){
-            for (int j = i+1;j<tvs.size();j++){
-                boolean isOver = TimeExchange.overlapping(tvs.get(i).getStart(),tvs.get(i).getEnd(),tvs.get(j).getStart(),tvs.get(j).getEnd());
-                if(isOver){
-                    return CommonResult.fail(tvs.get(i).getStart()+"-"+tvs.get(i).getEnd()+"时间段和"+tvs.get(j).getStart()+"-"+tvs.get(j).getEnd()+"时间段存在重叠");
-                }
-            }
-        }
-
-        //非工作时间的最小时间不能小于起止时间的开始时间
-        //非工作时间的最大时间不能大于起止时间的结束时间
-        tvs.sort(Comparator.comparing(timeVo::getStart));
-        if(tvs.size() > 0){
-            if(TimeExchange.CompareDate(tvs.get(0).getStart(),irssr.getStartTime(),"HH:mm")){
-                return CommonResult.fail(tvs.get(0).getStart()+"非工作时间段不能小于开始工作时间"+irssr.getStartTime());
-            }
-            if(TimeExchange.CompareDate(irssr.getEndTime(),tvs.get(tvs.size() -1).getEnd(),"HH:mm")){
-                return CommonResult.fail(tvs.get(tvs.size() -1).getEnd()+"非工作时间段不能大于工作结束时间"+irssr.getEndTime());
-            }
-        }
-
-        RepairShiftSettings rss = new RepairShiftSettings();
-        rss.setName(irssr.getName());
-        rss.setStartTime(irssr.getStartTime());
-        rss.setEndTime(irssr.getEndTime());
-        rss.setNotWorkTime(StringUtils.join(irssr.getNotWorkTime(), ','));
-        rss.setIsDuty(irssr.getIsDuty());
-        rss.setColor(irssr.getColor());
-
-        int result = repairShiftSettingsService.insertRepairShiftSettings(rss);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    public static void main(String[] args) throws ParseException {
-        List<timeVo> tvs = new ArrayList<>();
-        timeVo tv = new timeVo();
-        tv.setStart("5:00");
-        tv.setEnd("6:00");
-        tvs.add(tv);
-
-        timeVo tv2 = new timeVo();
-        tv2.setStart("11:00");
-        tv2.setEnd("12:00");
-        tvs.add(tv2);
-
-        timeVo tv1 = new timeVo();
-        tv1.setStart("7:00");
-        tv1.setEnd("11:30");
-        tvs.add(tv1);
-
-
-        for (int i = 0;i<tvs.size();i++){
-            for (int j = i+1;j<tvs.size();j++){
-                boolean isOver = TimeExchange.overlapping(tvs.get(i).getStart(),tvs.get(i).getEnd(),tvs.get(j).getStart(),tvs.get(j).getEnd());
-                if(isOver){
-                    String sss = tvs.get(i).getStart()+"-"+tvs.get(i).getEnd()+"时间段和"+tvs.get(j).getStart()+"-"+tvs.get(j).getEnd()+"时间段存在重叠";
-                    String ssds = "";
-                }
-            }
-        }
-    }
-
-    @Override
-    public CommonResult updateRepairShiftSettingsById(updateRepairShiftRequest ursr, BindingResult bindingResult) throws ParseException {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        if (!TimeExchange.CompareDate(ursr.getStartTime(), ursr.getEndTime(), "HH:mm")) {
-            return CommonResult.fail("开始时间不能大于结束时间");
-        }
-
-        List<timeVo> tvs = new ArrayList<>();
-        //非工作时间必须都在结束时间之内 防止非工作时间重叠
-        for (String i : ursr.getNotWorkTime()) {
-            String[] time = i.split("-");
-            if(TimeExchange.CompareDate(time[0],time[1],"HH:mm")){
-                timeVo tv = new timeVo();
-                tv.setStart(time[0]);
-                tv.setEnd(time[1]);
-                tvs.add(tv);
-            }
-        }
-
-        for (int i = 0;i<tvs.size();i++){
-            for (int j = i+1;j<tvs.size();j++){
-                boolean isOver = TimeExchange.overlapping(tvs.get(i).getStart(),tvs.get(i).getEnd(),tvs.get(j).getStart(),tvs.get(j).getEnd());
-                if(isOver){
-                    return CommonResult.fail(tvs.get(i).getStart()+"-"+tvs.get(i).getEnd()+"时间段和"+tvs.get(j).getStart()+"-"+tvs.get(j).getEnd()+"时间段存在重叠");
-                }
-            }
-        }
-
-        //非工作时间的最小时间不能小于起止时间的开始时间
-        //非工作时间的最大时间不能大于起止时间的结束时间
-        tvs.sort(Comparator.comparing(timeVo::getStart));
-        if(tvs.size() > 0){
-            if(TimeExchange.CompareDate(tvs.get(0).getStart(),ursr.getStartTime(),"HH:mm")){
-                return CommonResult.fail(tvs.get(0).getStart()+"非工作时间段不能小于开始工作时间"+ursr.getStartTime());
-            }
-            if(TimeExchange.CompareDate(ursr.getEndTime(),tvs.get(tvs.size() -1).getEnd(),"HH:mm")){
-                return CommonResult.fail(tvs.get(tvs.size() -1).getEnd()+"非工作时间段不能大于工作结束时间"+ursr.getEndTime());
-            }
-        }
-
-        RepairShiftSettings ra = new RepairShiftSettings();
-        ra.setId(ursr.getId());
-        ra.setName(ursr.getName());
-        ra.setStartTime(ursr.getStartTime());
-        ra.setEndTime(ursr.getEndTime());
-        ra.setNotWorkTime(StringUtils.join(ursr.getNotWorkTime(), ','));
-        ra.setColor(ursr.getColor());
-        ra.setIsDuty(ursr.getIsDuty());
-
-        int result = repairShiftSettingsService.updateRepairShiftSettings(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairShiftSettingss(int currentPage, int pageCount, String name) {
-        PageUtils<RepairShiftSettings> result = repairShiftSettingsService.queryPageRepairShiftSettingss(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairShiftSettingsById(int id) {
-        RepairShiftSettings data = repairShiftSettingsService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairShiftSettingsService.deleteRepairShiftSettingsById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 72
src/main/java/com/repair/controller/RepairSystemMessagesController.java

@@ -1,72 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairSystemMessagesControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairSystemMessages;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairSystemMessagesService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairSystemMessagesController implements RepairSystemMessagesControllerAPI {
-
-    @Autowired
-    private RepairSystemMessagesService repairSystemMessagesService;
-
-    @Override
-    public CommonResult InsertrepairSystemMessages(RepairSystemMessages rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairSystemMessagesService.insertRepairSystemMessages(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairSystemMessagesById(RepairSystemMessages rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairSystemMessagesService.updateRepairSystemMessages(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairSystemMessagess(int currentPage, int pageCount, String name) {
-        PageUtils<RepairSystemMessages> result = repairSystemMessagesService.queryPageRepairSystemMessagess(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairSystemMessagesById(int id) {
-        RepairSystemMessages data = repairSystemMessagesService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairSystemMessagesService.deleteRepairSystemMessagesById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 73
src/main/java/com/repair/controller/RepairSystemSettingController.java

@@ -1,73 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairSystemSettingControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairAdmin;
-import com.repair.model.pojo.RepairSystemSetting;
-import com.repair.model.result.CommonResult;
-import com.repair.services.RepairSystemSettingService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-11
- */
-@RestController
-public class RepairSystemSettingController implements RepairSystemSettingControllerAPI {
-    @Autowired
-    private RepairSystemSettingService repairSystemSettingService;
-
-    /**
-     * 查询系统设置数据
-     * @return
-     */
-    @Override
-    public CommonResult QueryRepairSystemSetting() {
-        RepairSystemSetting result = repairSystemSettingService.queryRepairSystemSetting();
-        return CommonResult.ok(result);
-    }
-
-    /**
-     * 新增系统设置数据
-     * @param repairSystemSetting
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult InsertRepairSystemSetting(RepairSystemSetting repairSystemSetting, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairSystemSettingService.insertRepairSystemSetting(repairSystemSetting);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    /**
-     * 修改系统设置数据
-     * @param ra
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult updateRepairSystemSettingById(RepairSystemSetting ra, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        int result = repairSystemSettingService.updateRepaiSystemSetting(ra);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-}
-

+ 0 - 74
src/main/java/com/repair/controller/RepairTrackRecordController.java

@@ -1,74 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairTrackRecordControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairTrackRecord;
-import com.repair.model.pojo.RepairTrackRecord;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairTrackRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairTrackRecordController implements RepairTrackRecordControllerAPI {
-
-    @Autowired
-    private RepairTrackRecordService repairTrackRecordService;
-
-    @Override
-    public CommonResult InsertrepairTrackRecord(RepairTrackRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairTrackRecordService.insertRepairTrackRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairTrackRecordById(RepairTrackRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairTrackRecordService.updateRepairTrackRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairTrackRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairTrackRecord> result = repairTrackRecordService.queryPageRepairTrackRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairTrackRecordById(int id) {
-        RepairTrackRecord data = repairTrackRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairTrackRecordService.deleteRepairTrackRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 74
src/main/java/com/repair/controller/RepairTransferRecordController.java

@@ -1,74 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairTransferRecordControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.pojo.RepairTransferRecord;
-import com.repair.model.pojo.RepairTransferRecord;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.services.RepairTransferRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@RestController
-public class RepairTransferRecordController implements RepairTransferRecordControllerAPI {
-
-    @Autowired
-    private RepairTransferRecordService repairTransferRecordService;
-
-    @Override
-    public CommonResult InsertrepairTransferRecord(RepairTransferRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairTransferRecordService.insertRepairTransferRecord(rc);
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updaterepairTransferRecordById(RepairTransferRecord rc, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = repairTransferRecordService.updateRepairTransferRecord(rc);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPagerepairTransferRecords(int currentPage, int pageCount, String name) {
-        PageUtils<RepairTransferRecord> result = repairTransferRecordService.queryPageRepairTransferRecords(currentPage, pageCount, name);
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleterepairTransferRecordById(int id) {
-        RepairTransferRecord data = repairTransferRecordService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairTransferRecordService.deleteRepairTransferRecordById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-}
-

+ 0 - 256
src/main/java/com/repair/controller/RepairUserController.java

@@ -1,256 +0,0 @@
-package com.repair.controller;
-
-import com.repair.api.RepairUserControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eRecordStatu;
-import com.repair.model.enumModel.eUserZZ;
-import com.repair.model.pojo.RepairRecord;
-import com.repair.model.pojo.RepairUser;
-import com.repair.model.request.insertRepairUserRequest;
-import com.repair.model.request.updateAddressBookRequest;
-import com.repair.model.request.updateUserDataRequest;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.*;
-import com.repair.services.RepairRecordService;
-import com.repair.services.RepairUserService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.BindingResult;
-
-import org.springframework.web.bind.annotation.RestController;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-11
- */
-@RestController
-public class RepairUserController implements RepairUserControllerAPI {
-
-    @Autowired
-    private RepairUserService repairUserService;
-    @Autowired
-    private RepairRecordService repairRecordService;
-
-    /**
-     * 添加员工数据接口
-     *
-     * @param irur
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult InsertRepairUser(insertRepairUserRequest irur, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairUser data = repairUserService.getRepairByCardNumber(irur.getCardNumber());
-        RepairUser ru = new RepairUser();
-        if (data != null && !data.getUserZzid().equals(eUserZZ.User.getValue())) {
-            return CommonResult.fail("该卡号已存在!");
-        } else if (data != null) {
-            ru.setId(data.getId());
-        }
-        ru.setUserName(irur.getUserName());
-        ru.setCardNumber(irur.getCardNumber());
-        ru.setUserZzid(irur.getUserzzId());
-        ru.setTeamId(irur.getTeamId());
-        ru.setUserPhone(irur.getUserPhone());
-        ru.setSchoolId(irur.getSchoolId());
-        ru.setWorkType(irur.getWorkType());
-        ru.setState(1);//设置大量接单
-        ru.setArticle_id(StringUtils.join(irur.getArticleIds(), ','));
-        ru.setBuildId(StringUtils.join(irur.getBuildIds(), ','));
-        ru.setAcceptanceAssessTime(irur.getAcceptanceAssessTime());
-        ru.setMaintenanceAssessTime(irur.getMaintenanceAssessTime());
-
-        int result = 0;
-        if (data != null) {
-            result = repairUserService.updateRepairUser(ru);
-        } else {
-            result = repairUserService.insertRepairUser(ru);
-        }
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    /**
-     * 根据ID编辑用户数据的名称、手机号、身份、工种、维修班、楼栋关联ID、是否能转换、接单考核时间、维修考核时间
-     *
-     * @param ra
-     * @param bindingResult
-     * @return
-     */
-    @Override
-    public CommonResult updateRepairUserById(updateUserDataRequest ra, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        RepairUser data = new RepairUser();
-        data.setId(ra.getId());
-        data.setUserName(ra.getUserName());
-        data.setUserPhone(ra.getUserPhone());
-        data.setUserZzid(ra.getUserZzid());
-        data.setWorkType(ra.getWorkType());
-        data.setTeamId(ra.getTeamId());
-        data.setArticle_id(StringUtils.join(ra.getArticleIds(), ','));
-        data.setBuildId(StringUtils.join(ra.getBuildIds(), ','));
-        data.setIsChange(ra.getIsChange());
-        data.setAcceptanceAssessTime(ra.getAcceptanceAssessTime());
-        data.setMaintenanceAssessTime(ra.getMaintenanceAssessTime());
-
-        int result = repairUserService.updateRepairUser(data);
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    /**
-     * 用户分页数据查询
-     *
-     * @param currentPage 当前页
-     * @param pageCount   一页数据条数
-     * @param keyWord     关键字
-     * @param teamId      维修班
-     *                    校方人员:0
-     *                    第三方人员:1
-     * @param schoolId    校区ID
-     *                    黄家湖校区:1
-     *                    墨轩湖校区:2
-     * @return
-     * @Param schoolId   校区ID
-     */
-    @Override
-    public CommonResult queryPageRepairUser(int currentPage, int pageCount, String keyWord, Integer teamId, Integer schoolId) {
-        PageUtils<RepairUserVo> result = repairUserService.queryPageRepairUser(currentPage, pageCount, keyWord, teamId, schoolId);
-
-        for (RepairUserVo r : result.getList()) {
-            if (r.getBuildId() != null) {
-                r.setBuildIds(Arrays.asList(r.getBuildId().split(",")));
-            }
-            if (r.getBuildName() != null) {
-                r.setBuildNames(Arrays.asList(r.getBuildName().split(",")));
-            }
-            if (r.getArticleId() != null) {
-                r.setArticleIds(Arrays.asList(r.getArticleId().split(",")));
-            }
-            if (r.getArticleName() != null) {
-                r.setArticleNames(Arrays.asList(r.getArticleName().split(",")));
-            }
-        }
-
-        return CommonResult.ok(result);
-    }
-
-    /**
-     * 根据ID删除用户数据
-     *
-     * @param id
-     * @return
-     */
-    @Override
-    public CommonResult deleteRepairUserById(int id) {
-
-        RepairUser data = repairUserService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairUserService.deleteRepairUserById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    /**
-     * 根据卡号查找用户信息
-     *
-     * @param cardNumber 卡号
-     * @return
-     */
-    @Override
-    public CommonResult queryRepairUserByCardNumber(String cardNumber) {
-        RepairUser result = repairUserService.getRepairByCardNumber(cardNumber);
-        return result == null ? CommonResult.fail("数据不存在") : CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult queryPageRepairUsers(int currentPage, int pageCount, Integer recordId, String keyWord) {
-
-        RepairRecord rr = repairRecordService.getRepairById(recordId);
-
-        if (rr == null) {
-            return CommonResult.fail("维修单无效,获取维修师傅数据失败");
-        }
-
-        String dateNow = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
-        PageUtils<AutoDispatchUserVo> users = repairUserService.autoDispatchUser(currentPage, pageCount, rr.getSchoolId(), dateNow, rr.getArticleId(), rr.getBuildId(), keyWord);
-
-        return CommonResult.ok(users);
-    }
-
-    @Override
-    public CommonResult getAddressBook(Integer schoolId, Integer userId, String keyWord) {
-        List<AddressBookVo> abs = repairUserService.queryAddressBook(userId, schoolId, keyWord);
-
-        List<AddressBookListVo> result = new ArrayList<>();
-        for (int i = 1; i <= 2; i++) {
-            AddressBookListVo data = new AddressBookListVo();
-            data.setId(i);
-            data.setName(i == 1 ? "校方人员" : "第三方人员");
-            List<AddressBookVo> abDatas = abs.stream().filter(e -> e.getTeamId() == data.getId()).collect(Collectors.toList());
-            data.setList(abDatas);
-            result.add(data);
-        }
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult updateAddressBook(updateAddressBookRequest uabp, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        RepairUser data = repairUserService.getRepairById(uabp.getId());
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,编辑失败!");
-        }
-
-        data.setUserPhone(uabp.getPhone());
-        data.setState(uabp.getState());
-        data.setWorkType(uabp.getWorkType());
-        data.setAcceptanceAssessTime(uabp.getAcceptanceTime());
-        data.setMaintenanceAssessTime(uabp.getMaintenanceTime());
-        int result = repairUserService.updateRepairUser(data);
-
-        return result <= 0 ? CommonResult.fail("更新失败") : CommonResult.ok("更新成功");
-    }
-
-    @Override
-    public CommonResult queryPageCollaborator(int currentPage, int pageCount, Integer schoolId, Integer userId) {
-        String dateNow = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
-        PageUtils<RepairWorkTypeVo> result = repairUserService.queryCollaboratorUser(currentPage, pageCount, schoolId, userId, dateNow);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult queryPositiveReviewPage(int currentPage, int pageCount, Integer schoolId) {
-        PageUtils<PositiveReviewVo> result = repairUserService.queryPositiveReviewPage(currentPage, pageCount, schoolId);
-        return CommonResult.ok(result);
-    }
-}
-

+ 0 - 128
src/main/java/com/repair/controller/RepairWorkTypeController.java

@@ -1,128 +0,0 @@
-package com.repair.controller;
-
-
-import com.repair.api.RepairWorkTypeControllerAPI;
-import com.repair.common.utils.paramUtils;
-import com.repair.model.enumModel.eUserZZ;
-import com.repair.model.pojo.RepairWorkType;
-import com.repair.model.result.CommonResult;
-import com.repair.model.result.PageUtils;
-import com.repair.model.vo.RepairWorkTypeVo;
-import com.repair.services.RepairWorkTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-07-18
- */
-@RestController
-public class RepairWorkTypeController implements RepairWorkTypeControllerAPI {
-
-    @Autowired
-    private RepairWorkTypeService repairWorkTypeService;
-
-    @Override
-    public CommonResult InsertRepairWorkType(RepairWorkType rwt, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-
-        int result = 0;
-        try {
-            result = repairWorkTypeService.insertRepairWorkType(rwt);
-        } catch (Exception e) {
-            if (e.getCause().getMessage().contains("'repair_work_type.name_unique'")) {
-                return CommonResult.fail("该工种类型已存在!");
-            }
-            return CommonResult.fail("系统异常,添加失败!");
-        }
-
-        return result > 0 ? CommonResult.ok("添加成功") : CommonResult.fail("添加失败");
-    }
-
-    @Override
-    public CommonResult updateRepairWorkTypeById(RepairWorkType rwt, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            String st = paramUtils.getParamError(bindingResult);
-            return CommonResult.fail(st);
-        }
-        if (rwt.getId() == null) {
-            return CommonResult.fail("数据ID不能为空");
-        }
-        int result = 0;
-        try {
-            result = repairWorkTypeService.updateRepairWorkType(rwt);
-        } catch (Exception e) {
-            if (e.getCause().getMessage().contains("'repair_work_type.name_unique'")) {
-                return CommonResult.fail("该工种类型已存在!");
-            }
-            return CommonResult.fail("系统异常,添加失败!");
-        }
-
-        return result > 0 ? CommonResult.ok("修改成功") : CommonResult.fail("修改失败");
-    }
-
-    @Override
-    public CommonResult queryPageRepairWorkTypes(int currentPage, int pageCount, String name) {
-        PageUtils<RepairWorkType> result = repairWorkTypeService.queryPageRepairWorkTypes(currentPage, pageCount, name);
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult deleteRepairWorkTypeById(int id) {
-        RepairWorkType data = repairWorkTypeService.getRepairById(id);
-        if (data == null) {
-            return CommonResult.fail("当前数据不存在,删除失败!");
-        }
-
-        int result = repairWorkTypeService.deleteRepairWorkTypeById(id);
-
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
-    }
-
-    @Override
-    public CommonResult getRepairWorkTypes() {
-        List<RepairWorkTypeVo> result = repairWorkTypeService.getRepairWorkTypes();
-
-        return CommonResult.ok(result);
-    }
-
-    @Override
-    public CommonResult getReceivingState() {
-        List<RepairWorkTypeVo> rs = new ArrayList<>();
-        RepairWorkTypeVo r = new RepairWorkTypeVo();
-        r.setId(1);
-        r.setName("大量接单");
-        rs.add(r);
-        RepairWorkTypeVo r1 = new RepairWorkTypeVo();
-        r1.setId(2);
-        r1.setName("停止接单");
-        rs.add(r1);
-        return CommonResult.ok(rs);
-    }
-
-    @Override
-    public CommonResult getRepairIdentitys() {
-        List<RepairWorkTypeVo> result = new ArrayList<>();
-        for(int i = 0;i<4;i++){
-            RepairWorkTypeVo data = new RepairWorkTypeVo();
-            data.setId(i);
-            data.setName(eUserZZ.stringOf(i));
-            result.add(data);
-        }
-        return CommonResult.ok(result);
-    }
-
-}
-

+ 432 - 0
src/main/java/com/repair/controller/ScheduleController.java

@@ -0,0 +1,432 @@
+package com.repair.controller;
+
+import com.repair.common.utils.*;
+import com.repair.config.WxOpenidConfig;
+import com.repair.model.pojo.*;
+import com.repair.model.vo.*;
+import com.repair.services.*;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+@Component
+//@EnableAsync
+public class ScheduleController {
+
+    /**
+     * @Scheduled注解会在默认情况下以单线程的方式执行定时任务。 这个“单线程”指两个方面:
+     * 如果一个定时任务执行时间大于其任务间隔时间,那么下一次将会等待上一次执行结束后再继续执行。
+     * 如果多个定时任务在同一时刻执行,任务会依次执行。
+     * @Async:对某个方法进行异步执行
+     * @EnableAsync:开启异步支持
+     */
+
+    @Autowired
+    private WxOpenidConfig wxOpenidConfig;
+    @Autowired
+    private RepairUserService repairUserService;
+    @Autowired
+    private RepairRecordService repairRecordService;
+    @Autowired
+    private RepairEvaluateService repairEvaluateService;
+    @Autowired
+    private RepairTrackRecordService repairTrackRecordService;
+    @Autowired
+    private RepairArticleBuildService repairArticleBuildService;
+    @Autowired
+    private RepairRefundRecordService repairRefundRecordService;
+    @Autowired
+    private RepairShiftSettingsService repairShiftSettingsService;
+    @Autowired
+    private RepairSystemSettingService repairSystemSettingService;
+    @Autowired
+    private RepairSystemMessagesService repairSystemMessagesService;
+    @Autowired
+    private RepairDispatchRecordService repairDispatchRecordService;
+
+
+    //定时格式参考:https://blog.csdn.net/java13992394428/article/details/108740453
+
+    /**
+     * 每天八点自动派单
+     * 周六周日定时器不生效
+     * 其余时间都是早上八点前捞一遍当前时间以前的单子
+     * 有合适的维修师傅就把单子派给维修师傅
+     * 周一到周五早上七点执行:0 0 7 ? * MON-FRI
+     * 周一到周五1、2、3、4、5、6、7、18、19、20、21、22点执行:0 0 1,2,3,4,5,6,7,18,19,20,21,22 ? * MON-FRI
+     */
+    //每小时执行一次:0 0 */1 * * ?
+    //每分钟执行一次:0 */1 * * * ?
+    @Async
+    @Scheduled(cron = "0 0 7 ? * MON-FRI ")
+    //@Scheduled(cron = "0 */1 * * * ? ")
+    @Transactional(rollbackFor = {Exception.class})
+    public void autoDispatch() throws Exception {
+        System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":自动派单进来执行了一次!");
+        /**
+         * 读取未被派单的数据
+         * 拿到当前时间为止的所有未被派单的数据
+         */
+        List<pendingOrderVo> records = repairRecordService.queryPendingOrder();
+        //有待接单数据
+        if (records.size() >= 0) {
+            Date nowDate = new Date();
+            String dateHour = new SimpleDateFormat("HH:mm").format(nowDate);
+            String dateNow = new SimpleDateFormat("yyyy-MM-dd").format(nowDate);
+
+            /**
+             * 只获取当天排班和能接单的
+             * 获取维修师傅和郭班长的单子
+             */
+            List<AutoDispatchUserVo> users = repairUserService.autoDispatchUser(dateNow);
+            String shiftStr = StringUtils.join(users.stream().map(AutoDispatchUserVo::getShiftId).collect(Collectors.toList()), ",");
+            List<String> shifts = Arrays.asList(shiftStr.split(",")).stream().distinct().collect(Collectors.toList());
+            //只获取不是值班 或下班后的排班数据
+            List<RepairShiftSettings> shiftDatas = repairShiftSettingsService.getRepairsShiftIdByHour(shifts, dateHour);
+
+            //2023-11-03 A-jax 添加获取报修关联楼栋
+            List<ArticleBuildVo> articleBuilds = new ArrayList<>();
+            if(users != null && users.size() > 0){
+                List<Integer> userIds = users.stream().map(AutoDispatchUserVo::getId).collect(Collectors.toList());
+                articleBuilds = repairArticleBuildService.queryArticleBuild(StringUtils.join(userIds,","));
+            }
+
+
+            List<RepairDispatchRecord> rdrs = new ArrayList<>();
+            List<RepairSystemMessages> rsms = new ArrayList<>();
+            List<RepairTrackRecord> rtrs = new ArrayList<>();
+            for (pendingOrderVo record : records) {
+                //跟张总确认一下是不是到时候维修师傅会把所有楼栋都勾选上
+                List<AutoDispatchUserVo> schoolUsers = new ArrayList<>();
+                for (AutoDispatchUserVo user:users) {
+                    long owner = articleBuilds != null && articleBuilds.size() > 0 ? articleBuilds.stream().filter(e -> e.getUserId() == user.getId() && ("," + e.getArticleId() + ",").contains("," + record.getArticleId() + ",") && ("," + e.getBuildId() + ",").contains("," + record.getBuildId() + ",")).count() : 0;
+                    if(owner > 0){
+                        schoolUsers.add(user);
+                    }
+                }
+
+                schoolUsers.sort(Comparator.comparing(AutoDispatchUserVo::getRdrCount));
+                for (AutoDispatchUserVo user : schoolUsers) {
+                    List<RepairShiftSettings> datas = shiftDatas.stream().filter(e -> ("," + user.getShiftId() + ",").contains("," + e.getId() + ",")).collect(Collectors.toList());
+                    if (datas.size() <= 0) {
+                        continue;
+                    }
+                    Integer isDuty = 0;
+                    int acceptanceAssessTime = user.getAcceptanceTime();
+                    try {
+
+                        //2023-10-08 看是否是值班时间接单
+                        if (shiftDatas.size() > 0) {
+                            Optional<RepairShiftSettings> shiftData = datas.stream().filter(e -> nowDate.before(TimeExchange.StringToDate(e.getEndTime(), "HH:mm"))).sorted(Comparator.comparing(RepairShiftSettings::getStartTime)).findFirst();
+                            if (shiftData != null && shiftData.isPresent()) {
+                                if (shiftData.get().getIsDuty().intValue() == 1) {
+                                    isDuty = 1;
+                                }
+                            }
+                        }
+
+                        //下班之后或者值班接的单不考核 将报修工单中的is_duty改为1
+                        Date workTime = TimeExchange.StringToDate(dateNow + " " + datas.get(0).getEndTime() + ":00", "yyyy-MM-dd HH:mm:ss");
+                        if (workTime.before(nowDate)) {
+                            isDuty = 1;
+                        }
+
+                        if (isDuty == 0) {
+                            //在工作时间才去派单
+                            List<timeVo> tvs = DelayedUtils.timeVos(datas);
+
+                            //工作的时间是否够修完 临下班接的单不做延长
+                            for (int i = 0; i < tvs.size(); i++) {
+                                Date startWorkTime = TimeExchange.StringToDate(dateNow + " " + tvs.get(i).getStart() + ":00", "yyyy-MM-dd HH:mm:ss");
+                                Date endWorkTime = TimeExchange.StringToDate(dateNow + " " + tvs.get(i).getEnd() + ":00", "yyyy-MM-dd HH:mm:ss");
+
+                                //小于工作时间段的开始时间
+                                if (nowDate.before(startWorkTime) || nowDate.equals(startWorkTime) && i == 0) {
+                                    //早上开始上班之前的单子
+                                    int minute = TimeExchange.getOffsetMinutes(nowDate, startWorkTime);
+                                    int workMinte = TimeExchange.getOffsetMinutes(nowDate, endWorkTime);
+                                    acceptanceAssessTime = acceptanceAssessTime + minute;
+                                    acceptanceAssessTime = DelayedUtils.addMinuteStart(tvs, endWorkTime, acceptanceAssessTime, nowDate, dateNow, workMinte, i, 1);
+                                    break;
+                                } else if ((startWorkTime.before(nowDate) || startWorkTime.equals(nowDate)) && (nowDate.before(endWorkTime) || nowDate.equals(endWorkTime))) {
+                                    //工作时间段内的单子
+                                    int workMinte = TimeExchange.getOffsetMinutes(nowDate, endWorkTime);
+                                    acceptanceAssessTime = DelayedUtils.addMinuteStart(tvs, endWorkTime, acceptanceAssessTime, nowDate, dateNow, workMinte, i, 1);
+                                    break;
+
+                                } else {
+                                    //非工作时间段的单子
+                                    Date nextStartWorkTime = TimeExchange.StringToDate(dateNow + " " + tvs.get(i + 1).getStart() + ":00", "yyyy-MM-dd HH:mm:ss");
+                                    if ((endWorkTime.before(nowDate) || endWorkTime.equals(nowDate)) && (nowDate.before(nextStartWorkTime) || nowDate.equals(nextStartWorkTime))) {
+                                        Date nextEndWorkTime = TimeExchange.StringToDate(dateNow + " " + tvs.get(i + 1).getEnd() + ":00", "yyyy-MM-dd HH:mm:ss");
+                                        int minute = TimeExchange.getOffsetMinutes(nowDate, nextStartWorkTime);
+                                        int workMinte = TimeExchange.getOffsetMinutes(nowDate, nextEndWorkTime);
+                                        acceptanceAssessTime = acceptanceAssessTime + minute;
+                                        acceptanceAssessTime = DelayedUtils.addMinuteStart(tvs, nextEndWorkTime, acceptanceAssessTime, nowDate, dateNow, workMinte, i, 2);
+                                        break;
+                                    }
+                                }
+                            }
+
+                            RepairDispatchRecord rdr = new RepairDispatchRecord();
+                            //创建派单记录
+                            rdr.setAssignedTime(new Date());
+                            rdr.setAcceptanceAssessTime(acceptanceAssessTime);
+                            rdr.setOrderType(0);
+                            rdr.setIsLoseEfficacy(0);
+                            rdr.setUsersId(user.getId());
+                            rdr.setRecordId(record.getId());
+                            rdr.setCreateTime(new Date());
+                            rdr.setUpdateTime(new Date());
+                            rdr.setCreateUser("定时器自动派单");
+                            rdr.setUpdateUser("定时器自动派单");
+                            rdr.setDeleted(0);
+                            rdrs.add(rdr);
+                            user.setRdrCount(user.getRdrCount() + 1);
+                            //给用户的消息中心数据
+                            RepairSystemMessages rsmU = new RepairSystemMessages();
+                            rsmU.setRecordId(record.getId());
+                            rsmU.setRecipientId(record.getUserId());
+                            rsmU.setContent("工单已交给系统,系统将催促师傅师尽快接单!");
+                            rsmU.setIsRead(0);
+                            rsmU.setCreateTime(new Date());
+                            rsmU.setUpdateTime(new Date());
+                            rsmU.setCreateUser("定时器自动派单");
+                            rsmU.setUpdateUser("定时器自动派单");
+                            rsmU.setDeleted(0);
+                            rsms.add(rsmU);
+
+                            //给师傅的消息中心数据
+                            RepairSystemMessages rsmS = new RepairSystemMessages();
+                            rsmS.setRecordId(record.getId());
+                            rsmS.setRecipientId(user.getId());
+                            rsmS.setContent("系统自动分配工单,请尽快处理!");
+                            rsmS.setIsRead(0);
+                            rsmS.setCreateTime(new Date());
+                            rsmS.setUpdateTime(new Date());
+                            rsmS.setCreateUser("定时器自动派单");
+                            rsmS.setUpdateUser("定时器自动派单");
+                            rsmS.setDeleted(0);
+                            rsms.add(rsmS);
+
+                            //添加跟踪记录
+                            RepairTrackRecord rtr = new RepairTrackRecord();
+                            rtr.setRecordId(record.getId());
+                            rtr.setMaintenanceState(1);
+                            rtr.setContent("已派单");
+                            rtr.setUserId(0);
+                            rtr.setUserZzstr("系统自动派单");
+                            rtr.setCreateTime(new Date());
+                            rtr.setUpdateTime(new Date());
+                            rtr.setCreateUser("定时器自动派单");
+                            rtr.setUpdateUser("定时器自动派单");
+                            rtr.setDeleted(0);
+                            rtrs.add(rtr);
+                            break;
+                        }
+
+                    } catch (Exception e) {
+                        System.out.println("自动派单失败:" + e.getMessage());
+                        throw new Exception("自动派单失败!");
+                    }
+                }
+            }
+
+            try {
+                boolean insertDis = repairDispatchRecordService.insertDispatchBatch(rdrs);
+                if (!insertDis) {
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":存储派单数据异常!");
+                    throw new Exception("自动派单失败!");
+                }
+                boolean insertRsm = repairSystemMessagesService.inserBatchSystemMessage(rsms);
+                if (!insertRsm) {
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":消息中心数据存储异常!");
+                    throw new Exception("自动派单失败!");
+                }
+                boolean insertRtr = repairTrackRecordService.insertTrackBatch(rtrs);
+                if (!insertRtr) {
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":根据记录数据存储异常!");
+                    throw new Exception("自动派单失败!");
+                }
+            } catch (Exception e) {
+                System.out.println("新增自动派单失败:" + e.getMessage());
+                throw new Exception("自动派单失败!");
+            }
+        }
+        System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":自动派单执行成功了一次!");
+    }
+
+
+    /**
+     * 每小时执行一次
+     * 自动好评定时器
+     * XX小时后未评价的订单
+     * 获取已完成没有好评数据的维修单数据,并且自动好评
+     * 好评完成之后在消息中心添加自动好评提示信息
+     * 发给维修师傅和用户
+     */
+    //每小时执行一次:0 0 */1 * * ?
+    //每分钟执行一次:0 */1 * * * ?
+    @Async
+    @Scheduled(cron = "0 0 */1 * * ? ")
+    @Transactional(rollbackFor = {Exception.class})
+    public void autoEvaluate() throws Exception {
+
+        //读取系统设置表数据 没设置就不好评
+        RepairSystemSetting setting = repairSystemSettingService.queryRepairSystemSetting();
+        if (setting != null && setting.getHour() != null) {
+            String dateStr = TimeExchange.TimeRangeHour(new Date(), -setting.getHour(), "yyyy-MM-dd HH:mm:ss");
+
+            List<RecordEvaluateVo> evaluates = repairEvaluateService.queryEvaluateList(dateStr);
+
+            List<RepairEvaluate> res = new ArrayList<>();
+            List<RepairSystemMessages> rsms = new ArrayList<>();
+            for (RecordEvaluateVo evaluate : evaluates) {
+                RepairEvaluate re = new RepairEvaluate();
+                re.setRecordId(evaluate.getId());
+                re.setStar(5);
+                re.setContent("自动好评");
+                re.setCreateTime(new Date());
+                re.setUpdateTime(new Date());
+                re.setCreateUser("定时器自动评价");
+                re.setUpdateUser("定时器自动评价");
+                re.setDeleted(0);
+                res.add(re);
+
+                RepairSystemMessages rsm = new RepairSystemMessages();
+                rsm.setRecordId(evaluate.getId());
+                rsm.setRecipientId(evaluate.getUserId());
+                rsm.setContent("维修单" + setting.getHour() + "小时内未评价,系统自动5星好评");
+                rsm.setIsRead(0);
+                rsm.setCreateTime(new Date());
+                rsm.setUpdateTime(new Date());
+                rsm.setCreateUser("定时器自动评价");
+                rsm.setUpdateUser("定时器自动评价");
+                rsm.setDeleted(0);
+                rsms.add(rsm);
+
+                if (evaluate.getMaintenancerId() != null) {
+                    String[] userIds = evaluate.getMaintenancerId().split(",");
+                    for (int i = 0; i < userIds.length; i++) {
+                        RepairSystemMessages rsmSf = new RepairSystemMessages();
+                        rsmSf.setRecordId(evaluate.getId());
+                        rsmSf.setRecipientId(Integer.valueOf(userIds[i]));
+                        rsmSf.setContent("维修单二十四小时内未评价,系统自动5星好评");
+                        rsmSf.setIsRead(0);
+                        rsmSf.setCreateTime(new Date());
+                        rsmSf.setUpdateTime(new Date());
+                        rsmSf.setCreateUser("定时器自动评价");
+                        rsmSf.setUpdateUser("定时器自动评价");
+                        rsmSf.setDeleted(0);
+                        rsms.add(rsmSf);
+                    }
+                }
+            }
+
+            try {
+                boolean insertRes = repairEvaluateService.inserBatchEvaluate(res);
+                if (!insertRes) {
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":存储评价数据异常!");
+                    throw new Exception("自动评价失败!");
+                }
+                boolean insertRsm = repairSystemMessagesService.inserBatchSystemMessage(rsms);
+                if (!insertRsm) {
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":消息中心数据存储异常!");
+                    throw new Exception("自动评价失败!");
+                }
+            } catch (Exception e) {
+                System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":好评异常,异常信息:" + e.getMessage());
+                throw new Exception("自动评价失败!");
+            }
+
+            System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":好评执行成功了一次!");
+        }
+    }
+
+    /**
+     * 2023-10-26 A-jax 添加退款订单查询
+     * 凌晨2点执行退款查询操作
+     */
+    //凌晨两点:0 0 2 * * ?
+    //每分钟执行一次:0 */1 * * * ?
+    @Async
+    @Scheduled(cron = "0 0 2 * * ?")
+    @Transactional(rollbackFor = {Exception.class})
+    public void queryRefund() throws Exception {
+        System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":开始查询退款进度!");
+        //获取退款中或部分退款的订单
+        List<repairRefundVo> dataList = repairRefundRecordService.queryRefundRecord();
+
+        List<String> datas = dataList == null ? new ArrayList<>() : dataList.stream().map(repairRefundVo::getRecordNo).distinct().collect(Collectors.toList());
+
+        List<RepairRefundRecord> rrrs = new ArrayList<>();
+        for (String data : datas) {
+            Map<String, String> params = new HashMap<String, String>();
+            params.put("appid", wxOpenidConfig.getXappid());//微信分配的小程序ID
+            params.put("mch_id", wxOpenidConfig.getShappid());//微信支付分配的商户号
+            params.put("out_trade_no", data);//"086339330913483");//商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。详见商户订单号
+            String nonceStr = WxUtil.getWxNonceStr();
+            params.put("nonce_str", nonceStr);//随机字符串,长度要求在32位以内。推荐随机数生成算法
+            String Sign = WxUtil.getSign(params, wxOpenidConfig.getShsecret());//参数 + 商户密钥
+            params.put("sign", Sign);
+
+            String retXml = WxUtil.getRequestXml(params);
+            String msg = HttpUtils.post("https://api.mch.weixin.qq.com/pay/refundquery", retXml);
+            System.out.println(msg);
+
+            try {
+                Map<String, Object> dateSre = XmlUtil.fromXML(msg);
+                if (dateSre.get("return_code").toString().equals("SUCCESS") && dateSre.get("result_code").toString().equals("SUCCESS")) {
+                    List<repairRefundVo> repairRefunds = dataList.stream().filter(e -> e.getRecordNo().equals(data)).collect(Collectors.toList());
+                    if(repairRefunds != null && repairRefunds.size() > 0){
+                        for (repairRefundVo repairRefund : repairRefunds) {
+                            String price = repairRefund.getPayPrice().multiply(new BigDecimal(100)).toString();
+
+                            String outRefundNo =null;
+                            String refundId = null;
+                            for (int i = 0;i<repairRefunds.size();i++)  {
+                                 if(dateSre.get("refund_id_"+i).toString().equals(price)){
+                                     if(dateSre.get("refund_status_"+i).toString().equals("SUCCESS")){
+                                         outRefundNo = dateSre.get("out_refund_no_"+i).toString();//商户退款单号
+                                         refundId = dateSre.get("refund_id_"+i).toString();//微信退款单号
+                                         RepairRefundRecord rrr = new RepairRefundRecord();
+                                         rrr.setId(repairRefund.getId());
+                                         rrr.setIsSuccess(1);
+                                         rrr.setWxNo(outRefundNo);//商户退款单号
+                                         rrr.setRefundNo(refundId);//微信退款单号
+                                         rrrs.add(rrr);
+                                     }
+                                 }
+                            }
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":退款进度,异常信息:" + e.getMessage());
+                throw new Exception("退款进度查询失败!");
+            }
+        }
+
+        try {
+            if(rrrs.size() > 0){
+                boolean result = repairRefundRecordService.updateRdfundBatch(rrrs);
+                if(!result){
+                    System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":退款进度更新失败!");
+                    throw new Exception("退款进度查询失败!");
+                }
+            }
+        } catch (Exception e) {
+            System.out.println(TimeExchange.DateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ":退款查询,异常信息:" + e.getMessage());
+            throw new Exception("退款进度查询失败!");
+        }
+    }
+}

+ 0 - 20
src/main/java/com/repair/controller/WxAccessTokenController.java

@@ -1,20 +0,0 @@
-package com.repair.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author ceshi
- * @since 2023-08-01
- */
-@RestController
-public class WxAccessTokenController {
-
-}
-

+ 0 - 27
src/main/java/com/repair/core/CORSConfiguration.java

@@ -1,27 +0,0 @@
-package com.repair.core;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@Configuration
-public class CORSConfiguration{
-    @Bean
-    public WebMvcConfigurer corsConfigurer() {
-        return new WebMvcConfigurer() {
-            @Override
-            public void addCorsMappings(CorsRegistry registry) {
-                registry.addMapping("/**")
-                        //放行哪些原始域
-                        .allowedOrigins("*")
-                        //是否发送Cookie信息
-                        .allowCredentials(false)
-                        //放行哪些原始域(请求方式)
-                        .allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS")
-                        //放行哪些原始域(头部信息)
-                        .allowedHeaders("*");
-            }
-        };
-    }
-}

+ 0 - 113
src/main/java/com/repair/core/JwtAuthenticationInterceptor.java

@@ -1,113 +0,0 @@
-package com.repair.core;
-
-import com.auth0.jwt.interfaces.Claim;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.repair.annotation.PassToken;
-import com.repair.common.exception.MyCustomException;
-import com.repair.common.result.ResponseStatusEnum;
-import com.repair.common.utils.JWTUtil;
-import org.json.JSONObject;
-import org.springframework.util.StringUtils;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.HandlerInterceptor;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-public class JwtAuthenticationInterceptor implements HandlerInterceptor {
-
-    /**
-     * preHandle:进入到控制器方法之前执行的内容
-     *     boolean:
-     *         true:可以继续执行控制器方法
-     *         false:拦截
-     * posthandler:执行控制器方法之后执行的内容
-     * afterCompletion:响应结束之前执行的内容
-     *///说明
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-
-        //region 检查是否有passtoken注释,有则跳过认证
-        //PassToken注解用在方法上面
-        HandlerMethod handlerMethod = (HandlerMethod) handler;
-        Method method = handlerMethod.getMethod();
-        if (method.isAnnotationPresent(PassToken.class)) {
-            PassToken passToken = method.getAnnotation(PassToken.class);
-            if (passToken.requeired()) {
-                return true;
-            }
-        }
-        //endregion
-
-        //除了登录和注册接口不需要user_head和token请求头外其他时候基本都要请求头
-        if(request.getHeader("user_head") == null){
-            //region 自定义返回响应的json格式
-            //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-            response.setCharacterEncoding("UTF-8");
-            response.setContentType("application/json; charset=utf-8");
-            JSONObject res = new JSONObject();
-            res.put("code", ResponseStatusEnum.MISSING_REQUEST_HEADER.getStatus());
-            res.put("message",  ResponseStatusEnum.MISSING_REQUEST_HEADER.getMsg());
-            res.put("success", false);
-            PrintWriter out = null;
-            out = response.getWriter();
-            out.write(res.toString());
-            out.flush();
-            out.close();
-            //endregion
-            return false;
-        }
-
-        //region 获取url传递的参数 Query string传递的参数
-        //获取url参数 getParameter方法里的参数名和定义的参数名一致
-        String token = request.getHeader("token");
-        // 验证userToken
-        if (!StringUtils.hasText(token)) {
-            throw new MyCustomException(ResponseStatusEnum.SYSTEM_TOKEN_ERROR);
-        }
-
-        // 解析token
-        Map<String, Claim> stringClaimMap = JWTUtil.verifyToken(token);
-        if (ObjectUtils.isNotEmpty(stringClaimMap)) { // 登录
-            return true;
-        }
-        //endregion
-
-        //region 自定义返回响应的json格式
-        //加上这个可以让浏览器那里得到浏览器的401:response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-        response.setCharacterEncoding("UTF-8");
-        response.setContentType("application/json; charset=utf-8");
-        JSONObject res = new JSONObject();
-        res.put("code", ResponseStatusEnum.NO_PERMISSION.getStatus());
-        res.put("message", ResponseStatusEnum.NO_PERMISSION.getMsg());
-        res.put("success", false);
-        PrintWriter out = null;
-        out = response.getWriter();
-        out.write(res.toString());
-        out.flush();
-        out.close();
-        //endregion
-
-        //region 默认的响应提示信息
-        //上面的提示信息返回格式和下面的只能开启一个,否则应用日志系统会导致Idean抛出异常:
-        //java.lang.IllegalStateException: getWriter() has already been called for this response
-        //response.sendError(401, "无权限");
-        //endregion
-
-        return false;
-    }
-
-    @Override
-    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
-
-    }
-
-    @Override
-    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-
-    }
-}

+ 0 - 25
src/main/java/com/repair/core/JwtlnterceptorConfig.java

@@ -1,25 +0,0 @@
-package com.repair.core;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.HandlerInterceptor;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@Configuration
-public class JwtlnterceptorConfig implements WebMvcConfigurer {
-    @Override
-    public void addInterceptors(InterceptorRegistry registry) {
-        //region
-        //目前测试下来 使用 /**所有的话,response.sendError浏览器获取不到响应的信息
-        //默认拦截所有路径
-        registry.addInterceptor(authenticationInterceptor())
-                .addPathPatterns("/api/**");
-        //endregion
-    }
-
-    @Bean
-    public HandlerInterceptor authenticationInterceptor() {
-        return new JwtAuthenticationInterceptor();
-    }
-}

+ 0 - 49
src/main/java/com/repair/handler/MyMetaObjectHandler.java

@@ -1,49 +0,0 @@
-package com.repair.handler;
-
-import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
-import com.repair.common.utils.AesUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.reflection.MetaObject;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Date;
-
-@Slf4j
-@Component // 一定不要忘记把处理器加到IOC容器中!
-public class MyMetaObjectHandler implements MetaObjectHandler {
-    //创建用户和更新用户填充0的时候则说明不是账号操作的
-
-    // 插入时的填充策略
-    @Override
-    public void insertFill(MetaObject metaObject) {
-        HttpServletRequest request = getHttpServletRequest();
-        String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
-        log.info("start insert fill.....");
-        // setFieldValByName(String fieldName, Object fieldVal, MetaObject metaObject
-        this.setFieldValByName("createTime", new Date(), metaObject);
-        this.setFieldValByName("updateTime", new Date(), metaObject);
-        this.setFieldValByName("createUser", user_id , metaObject);
-        this.setFieldValByName("updateUser", user_id , metaObject);
-        this.setFieldValByName("deleted", 0 , metaObject);
-    }
-
-    // 更新时的填充策略
-    @Override
-    public void updateFill(MetaObject metaObject) {
-        HttpServletRequest request = getHttpServletRequest();
-        String user_id = request.getHeader("user_head") == null ? "0" : AesUtils.decrypt(request.getHeader("user_head"));
-        log.info("start update fill.....");
-        this.setFieldValByName("updateTime", new Date(), metaObject);
-        this.setFieldValByName("updateUser", user_id, metaObject);
-    }
-
-    private HttpServletRequest getHttpServletRequest() {
-        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
-        ServletRequestAttributes attributes = (ServletRequestAttributes) requestAttributes;
-        return attributes.getRequest();
-    }
-}

+ 0 - 17
src/main/java/com/repair/mapper/RepairAdminMapper.java

@@ -1,17 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairAdmin;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springframework.stereotype.Repository;
-
-/*
-Mapper和Repository的相同点:
-@Mapper和@Repository都是作用在dao层接口,使得其生成代理对象bean,交给spring 容器管理,对于mybatis来说,都可以不用写mapper.xml文件
-Mapper和Repository的区别:
-@Repository需要在Spring中配置扫描地址,然后生成Dao层的Bean才能被注入到Service层中:如下,在启动类中配置扫描地址:
-@Mapper不需要配置扫描地址,通过xml里面的namespace里面的接口地址,生成了Bean后注入到Service层中
-* */
-@Repository
-public interface RepairAdminMapper extends BaseMapper<RepairAdmin> {
-
-}

+ 0 - 21
src/main/java/com/repair/mapper/RepairAreaMapper.java

@@ -1,21 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairArea;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.RepairSchoolVo;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-12
- */
-@Repository
-public interface RepairAreaMapper extends BaseMapper<RepairArea> {
-    List<RepairSchoolVo> queryRepairSchools();
-}

+ 22 - 0
src/main/java/com/repair/mapper/RepairArticleBuildMapper.java

@@ -0,0 +1,22 @@
+package com.repair.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.repair.model.pojo.RepairArticleBuild;
+import com.repair.model.vo.ArticleBuildVo;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-11-02
+ */
+@Repository
+public interface RepairArticleBuildMapper extends BaseMapper<RepairArticleBuild> {
+    List<ArticleBuildVo> queryArticleBuild(@Param("userIds") String userIds);
+}

+ 0 - 25
src/main/java/com/repair/mapper/RepairArticleTypeMapper.java

@@ -1,25 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairArticleType;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.RepairArticleChildVo;
-import com.repair.model.vo.RepairWorkTypeVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-18
- */
-@Repository
-public interface RepairArticleTypeMapper extends BaseMapper<RepairArticleType> {
-    List<RepairWorkTypeVo> queryArticleTypeList(@Param("schoolId")Integer schoolId);
-
-    List<RepairArticleChildVo> queryArticleChildList(@Param("schoolId")Integer schoolId);
-}

+ 0 - 32
src/main/java/com/repair/mapper/RepairClassesSettingsMapper.java

@@ -1,32 +0,0 @@
-package com.repair.mapper;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Constants;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.repair.model.pojo.RepairClassesSettings;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.ClassesDataVo;
-import com.repair.model.vo.ClassesSettingVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-13
- */
-@Repository
-public interface RepairClassesSettingsMapper extends BaseMapper<RepairClassesSettings> {
-    List<ClassesSettingVo> queryClassesSettingList(@Param("userIds") List<Integer> userIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
-    List<ClassesDataVo> queryClassesDatas(@Param("userIds") List<Integer> userIds, @Param("startDate") Integer startDate);
-
-    ClassesDataVo queryClassesData(@Param("userId") Integer userId);
-}

+ 0 - 18
src/main/java/com/repair/mapper/RepairCloseMapper.java

@@ -1,18 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairClose;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springframework.stereotype.Repository;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-08-04
- */
-@Repository
-public interface RepairCloseMapper extends BaseMapper<RepairClose> {
-
-}

+ 0 - 25
src/main/java/com/repair/mapper/RepairCollaborateRecordMapper.java

@@ -1,25 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairCollaborateRecord;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.CollaborateDetailVo;
-import com.repair.model.vo.CollaborateRecordVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@Repository
-public interface RepairCollaborateRecordMapper extends BaseMapper<RepairCollaborateRecord> {
-    List<CollaborateRecordVo> queryCollaborateRecordList(@Param("recordIds") List<Integer> recordIds);
-
-    CollaborateDetailVo queryCollaborateDetail(@Param("recordId") Integer recordId);
-}

+ 0 - 29
src/main/java/com/repair/mapper/RepairConsumablesMapper.java

@@ -1,29 +0,0 @@
-package com.repair.mapper;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.repair.model.pojo.RepairConsumables;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.ChangeConsumesVo;
-import com.repair.model.vo.ConsumableExcelVo;
-import com.repair.model.vo.ConsumablePageVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@Repository
-public interface RepairConsumablesMapper extends BaseMapper<RepairConsumables> {
-    IPage<ConsumablePageVo> queryConsumablePageList(IPage<ConsumablePageVo> page, @Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
-    List<ConsumableExcelVo> queryConsumableExcelList(@Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
-    List<ChangeConsumesVo> repairChangeConsumes(@Param("recordId") Integer recordId);
-}

+ 0 - 31
src/main/java/com/repair/mapper/RepairConsumeMapper.java

@@ -1,31 +0,0 @@
-package com.repair.mapper;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.repair.model.pojo.RepairConsume;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.ConsumeVo;
-import com.repair.model.vo.RepairArticleConsumeVo;
-import com.repair.model.vo.RepairConsumeVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-18
- */
-@Repository
-public interface RepairConsumeMapper extends BaseMapper<RepairConsume> {
-    List<ConsumeVo> queryConsumeList(@Param("name") String name, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
-    IPage<RepairConsumeVo> queryConsumePageList(IPage<RepairConsumeVo> page, @Param("name") String name, @Param("startTime") String startTime, @Param("endTime") String endTime);
-
-    List<RepairArticleConsumeVo> queryArticleConsumes(@Param("schoolId") Integer schoolId, @Param("keyWork") String keyWork, @Param("findInSet") String findInSet);
-
-    List<RepairArticleConsumeVo> queryArticleConsumesName(@Param("findInSet")String findInSet,@Param("schoolId")int schoolId);
-}

+ 1 - 2
src/main/java/com/repair/mapper/RepairDispatchRecordMapper.java

@@ -2,7 +2,6 @@ package com.repair.mapper;
 
 import com.repair.model.pojo.RepairDispatchRecord;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.RepairCardNumberVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -18,5 +17,5 @@ import java.util.List;
  */
 @Repository
 public interface RepairDispatchRecordMapper extends BaseMapper<RepairDispatchRecord> {
-    List<RepairCardNumberVo> queryRepairCardNumber(@Param("recordId") Integer recordId);
+
 }

+ 3 - 6
src/main/java/com/repair/mapper/RepairEvaluateMapper.java

@@ -3,17 +3,15 @@ package com.repair.mapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.repair.model.pojo.RepairEvaluate;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.EvaluateVo;
-import com.repair.model.vo.RepairConsumeVo;
+import com.repair.model.vo.RecordEvaluateVo;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
-import java.util.Date;
 import java.util.List;
 
 /**
  * <p>
- *  Mapper 接口
+ * Mapper 接口
  * </p>
  *
  * @author ceshi
@@ -21,6 +19,5 @@ import java.util.List;
  */
 @Repository
 public interface RepairEvaluateMapper extends BaseMapper<RepairEvaluate> {
-    List<EvaluateVo> queryEvaluatePageList(@Param("keyWord") String keyWord,@Param("startTime") String startTime,@Param("endTime") String endTime);
-    IPage<EvaluateVo> queryEvaluatePageList(IPage<EvaluateVo> page, @Param("keyWord") String keyWord, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    List<RecordEvaluateVo> queryEvaluateList(@Param("dateStr") String dateStr);
 }

+ 0 - 18
src/main/java/com/repair/mapper/RepairLeaveMessageMapper.java

@@ -1,18 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairLeaveMessage;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.springframework.stereotype.Repository;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@Repository
-public interface RepairLeaveMessageMapper extends BaseMapper<RepairLeaveMessage> {
-
-}

+ 0 - 21
src/main/java/com/repair/mapper/RepairNoticeSettingMapper.java

@@ -1,21 +0,0 @@
-package com.repair.mapper;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.repair.model.pojo.RepairNoticeSetting;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.repair.model.vo.NoticePageVo;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-11
- */
-@Repository
-public interface RepairNoticeSettingMapper extends BaseMapper<RepairNoticeSetting> {
-    IPage<NoticePageVo> queryNoticePageList(IPage<NoticePageVo> page, @Param("startTime") String startTime, @Param("endTime") String endTime);
-}

+ 0 - 19
src/main/java/com/repair/mapper/RepairPayRecordMapper.java

@@ -1,19 +0,0 @@
-package com.repair.mapper;
-
-import com.repair.model.pojo.RepairPayRecord;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author ceshi
- * @since 2023-07-20
- */
-@Repository
-public interface RepairPayRecordMapper extends BaseMapper<RepairPayRecord> {
-    RepairPayRecord queryPaymentData(@Param("recordNo") String recordNo);
-}

+ 0 - 0
src/main/java/com/repair/mapper/RepairReceivingMapper.java


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