Explorar el Código

Merge branch 'feature/0427-school' of http://git.dayaedu.com/yonge/mec into master_saas

 Conflicts:
	.idea/httpRequests/http-requests-log.http
	mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
	mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java
	mec-common/common-core/src/main/java/com/ym/mec/common/exception/BizException.java
zouxuan hace 1 año
padre
commit
8685e3722c
Se han modificado 72 ficheros con 1073 adiciones y 557 borrados
  1. 370 1
      .idea/httpRequests/http-requests-log.http
  2. 14 27
      audio-analysis/src/main/java/com/yonge/netty/server/service/AudioCompareHandler.java
  3. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/PermissionCheckService.java
  4. 3 0
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java
  5. 7 7
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysMenuServiceImpl.java
  6. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CooperationOrganDao.java
  7. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MultiDataSourceHomeStatsDao.java
  8. 8 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  9. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  10. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImGroupMemberDto.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SchoolStaff.java
  12. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/EFriendRoleType.java
  13. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/ImGroupWrapper.java
  14. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/MultiDataSourceHomeStatsWrapper.java
  15. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolStaffWrapper.java
  16. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CooperationOrganService.java
  17. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MultiDataSourceHomeStatsService.java
  18. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  19. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CooperationOrganServiceImpl.java
  20. 6 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  21. 5 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  22. 12 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java
  23. 97 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MultiDataSourceHomeStatsServiceImpl.java
  24. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  25. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java
  26. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SchoolActivityDetailServiceImpl.java
  27. 41 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SchoolStaffServiceImpl.java
  28. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  29. 12 2
      mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml
  30. 3 0
      mec-biz/src/main/resources/config/mybatis/ImUserFriendMapper.xml
  31. 34 0
      mec-biz/src/main/resources/config/mybatis/MultiDataSourceHomeStatsMapper.xml
  32. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  33. 21 19
      mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml
  34. 4 4
      mec-biz/src/main/resources/config/mybatis/SchoolStaffMapper.xml
  35. 12 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  36. 10 4
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  37. 5 1
      mec-biz/src/main/resources/config/mybatis/StudentPlusMapper.xml
  38. 43 43
      mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java
  39. 11 0
      mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java
  40. 9 54
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java
  41. 40 15
      mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java
  42. 11 0
      mec-web/src/main/java/com/ym/mec/web/WebApplication.java
  43. 1 1
      mec-web/src/main/java/com/ym/mec/web/config/PermissionCheckService.java
  44. 5 17
      mec-web/src/main/java/com/ym/mec/web/controller/AppRedemptionCodeController.java
  45. 3 2
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  46. 3 3
      mec-web/src/main/java/com/ym/mec/web/controller/CloudCoachPaymentProgramController.java
  47. 0 7
      mec-web/src/main/java/com/ym/mec/web/controller/CloudTeacherOrderController.java
  48. 7 26
      mec-web/src/main/java/com/ym/mec/web/controller/ContractsController.java
  49. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java
  50. 0 4
      mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java
  51. 6 19
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  52. 0 4
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java
  53. 0 4
      mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java
  54. 40 58
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  55. 1 7
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  56. 0 4
      mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java
  57. 12 33
      mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java
  58. 5 12
      mec-web/src/main/java/com/ym/mec/web/controller/ImSendGroupMessageController.java
  59. 8 10
      mec-web/src/main/java/com/ym/mec/web/controller/ImUserFriendController.java
  60. 3 13
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  61. 0 7
      mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java
  62. 5 14
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java
  63. 4 17
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java
  64. 9 24
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java
  65. 3 11
      mec-web/src/main/java/com/ym/mec/web/controller/ManagerDownloadController.java
  66. 4 19
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java
  67. 4 11
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankSettingController.java
  68. 38 0
      mec-web/src/main/java/com/ym/mec/web/controller/MultiDataSourceHomeStatsController.java
  69. 3 9
      mec-web/src/main/java/com/ym/mec/web/controller/MusicEnlightenmentQuestionnaireController.java
  70. 3 1
      mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java
  71. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/StudentStatisticsController.java
  72. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/school/SchoolMusicGroupQuitController.java

+ 370 - 1
.idea/httpRequests/http-requests-log.http

@@ -1,4 +1,373 @@
-GET http://127.0.0.1:9001/open/liveBroadcastRoom/visitorFingerprint?code=0413aiGa1MplkF0RyGGa1sf6S143aiGv
+POST http://127.0.0.1:8005/imGroup/schoolQueryFriendList
+Authorization: bearer 07bef4ad-6d9e-46e0-8fd3-c24a2fd11332
+Content-Type: application/json
+Content-Length: 155
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+//  "keyword": "宁老师",
+//  "groupType": "SCHOOL",
+//  "musicGroupId": "23042416211000001",
+//  "roleType": "ORCHESTRA_TEACHER"
+  "lockFlag": false
+}
+
+<> 2023-05-24T195305.200.json
+
+###
+
+POST https://test.dayaedu.com/api-auth/smsLogin?phone=19900990033&clientId=school&clientSecret=school&smsCode=666666
+Content-Length: 0
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-24T194548.200.json
+
+###
+
+GET http://127.0.0.1:8005/imGroup/queryGroupMemberList?imGroupId=62
+Content-Type: application/json
+Authorization: bearer 387ba749-39ac-4a02-a183-00cf8ac29f10
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-24T193935.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248479&microphoneFlag=false
+Authorization: bearer aeec0ea9-4079-4765-aa72-346a7d37e735
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T175057.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248479&microphoneFlag=true
+Authorization: bearer aeec0ea9-4079-4765-aa72-346a7d37e735
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T175049.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248479&microphoneFlag=false
+Authorization: bearer aeec0ea9-4079-4765-aa72-346a7d37e735
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T175037.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248479&microphoneFlag=false
+Authorization: bearer aeec0ea9-4079-4765-aa72-346a7d37e735
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174858.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248479&microphoneFlag=false
+Authorization: bearer aeec0ea9-4079-4765-aa72-346a7d37e735
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174628.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 100
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e
+
+<> 2023-05-19T174545.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248380&microphoneFlag=false
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174527.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248380&microphoneFlag=false
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174458.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248380&microphoneFlag=false
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174300.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248380&microphoneFlag=false
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T174052.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Authorization: bearer fcf13dd1-6f06-40ae-a36e-22b4df4d5d01
+Content-Type: application/json
+Content-Length: 45
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "roomUid": "LIVE-2248336-1684474334299"
+}
+
+<> 2023-05-19T173652.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Authorization: bearer fcf13dd1-6f06-40ae-a36e-22b4df4d5d01
+Content-Type: application/json
+Content-Length: 45
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{
+  "roomUid": "LIVE-2248336-1684474334299"
+}
+
+<> 2023-05-19T173417.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Authorization: bearer fcf13dd1-6f06-40ae-a36e-22b4df4d5d01
+Content-Type: application/json
+Content-Length: 2
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{}
+
+<> 2023-05-19T173333.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Authorization: bearer fcf13dd1-6f06-40ae-a36e-22b4df4d5d01
+Content-Length: 2
+Content-Type: */*; charset=UTF-8
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{}
+
+<> 2023-05-19T173320.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Authorization: bearer fcf13dd1-6f06-40ae-a36e-22b4df4d5d01
+Content-Length: 0
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T173307.200.json
+
+###
+
+GET http://127.0.0.1:9001/imLiveBroadcastRoom/joinRoom?roomUid=LIVE-2248336-1684474334299&userId=2248380&microphoneFlag=false
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T173156.200.json
+
+###
+
+POST http://localhost:9001/user/update
+Authorization: bearer b4d5c0d2-3faf-48f3-a5d6-6301cc1e1af6
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 45
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+username=ces&currentClass=1&currentGradeNum=3
+
+<> 2023-05-19T172903.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T172200.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T172138.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T172025.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T171911.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T171355.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T171229.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T171144.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 111
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=1
+
+<> 2023-05-19T171124.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 114
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+clientId=student&clientSecret=student&phone=19900990088&smsCode=666666&deviceNum=190e35f7e15650ef33e&isLessee=true
+
+<> 2023-05-19T171047.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin?clientId=student&clientSecret=student&phone=19900880088&smsCode=666666&isLessee=true
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 0
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-05-19T170945.200.json
+
+###
+
+POST http://127.0.0.1:8001/smsLogin?clientId=student&clientSecret=student&phone=19900880088&smsCode=666666&isLessee=true
+Content-Type: application/json
+Content-Length: 0
 Connection: Keep-Alive
 User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
 Accept-Encoding: br,deflate,gzip,x-gzip

+ 14 - 27
audio-analysis/src/main/java/com/yonge/netty/server/service/AudioCompareHandler.java

@@ -1,32 +1,8 @@
 package com.yonge.netty.server.service;
 
-import io.netty.channel.Channel;
-
-import java.io.File;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import javax.sound.sampled.AudioFormat;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONPath;
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.SysMusicCompareRecord;
 import com.ym.mec.biz.dal.enums.DeviceTypeEnum;
 import com.ym.mec.biz.dal.enums.FeatureType;
@@ -45,6 +21,20 @@ import com.yonge.netty.entity.MusicXmlNote;
 import com.yonge.netty.server.handler.NettyChannelManager;
 import com.yonge.netty.server.handler.message.MessageHandler;
 import com.yonge.netty.server.processor.WaveformWriter;
+import io.netty.channel.Channel;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.sound.sampled.AudioFormat;
+import java.io.File;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
 
 @Component
 public class AudioCompareHandler implements MessageHandler {
@@ -61,9 +51,6 @@ public class AudioCompareHandler implements MessageHandler {
 	private SysMusicCompareRecordService sysMusicCompareRecordService;
 	
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    @Autowired
     private StoragePluginContext storagePluginContext;
 
 	/**

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/PermissionCheckService.java

@@ -27,7 +27,7 @@ public class PermissionCheckService {
 
 		AuthUser authUser = SecurityUtils.getUser();
 		SysUser user = sysUserService.get(authUser.getUserId());
-		if (user.getTenantId() == -1) {
+		if (user.getTenantId() == -1 || user.getIsSuperAdmin()) {
 			return true;
 		}
 

+ 3 - 0
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java

@@ -146,6 +146,9 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
                     user.setUserType(user.getUserType() + "," + clientId);
                     user.setUpdateTime(new Date());
 
+                    if (userInfo.getSysUser().getUserType().contains("SCHOOL")) {
+                        throw new LockedException("用户已注册");
+                    }
                     // 添加userType以及附加信息
                     if (StringUtils.equals("STUDENT", clientId)) {
                         if (StringUtils.isBlank(loginEntity.getOrganId())) {

+ 7 - 7
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysMenuServiceImpl.java

@@ -1,11 +1,5 @@
 package com.ym.mec.auth.service.impl;
 
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.auth.api.dto.MenuQueryInfo;
 import com.ym.mec.auth.api.entity.SysMenu;
 import com.ym.mec.auth.api.entity.SysUser;
@@ -14,6 +8,11 @@ import com.ym.mec.auth.dal.dao.SysUserDao;
 import com.ym.mec.auth.service.SysMenuService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class SysMenuServiceImpl extends BaseServiceImpl<Integer, SysMenu>  implements SysMenuService {
@@ -33,12 +32,13 @@ public class SysMenuServiceImpl extends BaseServiceImpl<Integer, SysMenu>  imple
 		return sysMenuDao.getMenusByRoleId(roleId);
 	}
 
+	@Override
 	public List<SysMenu> findByUser(MenuQueryInfo menuQueryInfo) {
 		SysUser sysUser = sysUserDao.get(menuQueryInfo.getUserId());
 		List<SysMenu> sysMenus;
 		List<SysMenu> sysMenusAllList;
 
-		if(sysUser.getTenantId() == -1 && sysUser.getIsSuperAdmin()){
+		if(sysUser.getIsSuperAdmin()){
 			sysMenus = sysMenuDao.findList(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getHid());
 			sysMenusAllList = sysMenuDao.findList(null,menuQueryInfo.getDelFlag(),menuQueryInfo.getHid());
 		}else {

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CooperationOrganDao.java

@@ -88,4 +88,6 @@ public interface CooperationOrganDao extends BaseDAO<Integer, CooperationOrgan>
     * @date 2022/3/17 11:36
     */
     List<Map<Integer, String>> findFirstMusic();
+
+    List<CooperationOrgan> queryByOrganIdAndEnable(@Param("organId") String organId, @Param("enable") Boolean enable);
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MultiDataSourceHomeStatsDao.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MultiDataSourceHomeStatsDao {
+
+
+    List<MultiDataSourceHomeStatsWrapper.IncomeByDate> clsSummerIncome(@Param("queryDto") MultiDataSourceHomeStatsWrapper.QueryDto queryDto);
+
+    List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gytSummerIncome(@Param("queryDto") MultiDataSourceHomeStatsWrapper.QueryDto queryDto);
+
+    List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gymSummerIncome(@Param("queryDto") MultiDataSourceHomeStatsWrapper.QueryDto queryDto);
+}

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -10,10 +10,7 @@ import com.ym.mec.biz.dal.vo.TempCampUserTrainingSequenceVo;
 import com.ym.mec.biz.dal.wrapper.StudentWrapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Student> {
 
@@ -374,4 +371,11 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     List<StudentWrapper.StudentHomework> getStudentHomework(@Param("param") StudentWrapper.StudentAttendanceQuery studentAttendanceQuery);
 
     List<String> queryExistStuByPhone(@Param("phones") List<String> phones);
+
+    /**
+     * 统计学校在读学生数
+     * @param paramMap 查询条件
+     * @return 在读学生数
+     */
+    int countMusicGroupStudents(Map<String, Object> paramMap);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -457,5 +457,7 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
 
     List<StudentPaymentOrderExportDto> ExportQueryPage1(Map<String, Object> params);
 
+    List<StudentPaymentOrderExportDto> ExportQueryPage2(Map<String, Object> params);
+
     int queryCount1(Map<String, Object> params);
 }

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImGroupMemberDto.java

@@ -7,7 +7,17 @@ public class ImGroupMemberDto extends ImGroupMember {
 
 	private SysUser user = new SysUser();
 
-	public SysUser getUser() {
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public SysUser getUser() {
 		return user;
 	}
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SchoolStaff.java

@@ -47,7 +47,7 @@ public class SchoolStaff implements Serializable {
 	@TableField(value = "user_type_")
     private ESchoolStaffType userType;
 
-    @ApiModelProperty("帐号状态(注销 -1,冻结 9,激活 0)")
+    @ApiModelProperty("帐号状态(注销 -1,冻结 9,激活 1)")
 	@TableField(value = "status_")
     private String status;
 

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/EFriendRoleType.java

@@ -10,7 +10,7 @@ public enum EFriendRoleType implements BaseEnum<Integer, EFriendRoleType> {
     SCHOOL_LEADER(3,"分管领导"),
     SCHOOL_TEACHER(4,"负责老师"),
     ORCHESTRA_MANAGER(5,"乐团主管"),
-    MAINTENANCE_TECHNICIAN(6,"乐团主管"),
+    MAINTENANCE_TECHNICIAN(6,"维护技师"),
     ORCHESTRA_TEACHER(7,"指导老师"),
     STUDENT(8,"学生"),
 
@@ -39,6 +39,16 @@ public enum EFriendRoleType implements BaseEnum<Integer, EFriendRoleType> {
             case "指导老师":
                 return ORCHESTRA_TEACHER;
 
+            case "校长":
+                return SCHOOLMASTER;
+            case "乐团领队":
+                return ORCHESTRA_LEADER;
+            case "分管领导":
+                return SCHOOL_LEADER;
+            case "负责老师":
+                return SCHOOL_TEACHER;
+            case "维护技师":
+                return SCHOOL_TEACHER;
             default:
                 return STUDENT;
         }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/ImGroupWrapper.java

@@ -23,6 +23,9 @@ public class ImGroupWrapper {
 
         @ApiModelProperty("当前用户ID")
         private Integer userId;
+
+        @ApiModelProperty("用户状态 false :查询未锁定")
+        private Boolean lockFlag;
     }
 
 

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/MultiDataSourceHomeStatsWrapper.java

@@ -0,0 +1,41 @@
+package com.ym.mec.biz.dal.wrapper;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+public class MultiDataSourceHomeStatsWrapper {
+
+    @Data
+    public static class IncomeByDate{
+
+        private BigDecimal totalAmount;
+
+        private String date;
+    }
+
+    @Data
+    public static class summerIncome{
+
+        private String platform;
+
+        private BigDecimal totalAmount;
+
+        private List<IncomeByDate> incomeByDates;
+    }
+
+    @Data
+    public static class QueryDto{
+
+        private String startTime;
+
+        private String endTime;
+
+        private String organIds;
+
+        private String groupBy;
+
+        private String format;
+    }
+}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolStaffWrapper.java

@@ -313,7 +313,7 @@ public class SchoolStaffWrapper {
     @NoArgsConstructor
     @AllArgsConstructor
     @ApiModel("学校统计信息")
-    public static class SchoolStaffStat implements Serializable {
+    public static class  SchoolStaffStat implements Serializable {
 
         @ApiModelProperty("校长数")
         private Integer schoolmasterNums;

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CooperationOrganService.java

@@ -17,6 +17,7 @@ public interface CooperationOrganService extends BaseService<Integer, Cooperatio
      * @return
      */
     List<CooperationOrgan> queryByOrganId(String organId);
+    List<CooperationOrgan> queryByOrganId(String organId,Boolean enable);
 
 
     /**

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MultiDataSourceHomeStatsService.java

@@ -0,0 +1,14 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public interface MultiDataSourceHomeStatsService{
+
+    //收入汇总
+    List<MultiDataSourceHomeStatsWrapper.summerIncome> summerIncome(MultiDataSourceHomeStatsWrapper.QueryDto queryDto);
+
+}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java

@@ -473,7 +473,7 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
     /**
      * 获取乐团信息
      */
-    Map<Long,MusicGroup> getMapByIds(List<String> musicGroupIds);
+    Map<String,MusicGroup> getMapByIds(List<String> musicGroupIds);
 
     /**
      * 获取乐团信息

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CooperationOrganServiceImpl.java

@@ -9,7 +9,6 @@ import com.ym.mec.biz.dal.mapper.SchoolStaffMapper;
 import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.biz.service.ImGroupMemberService;
 import com.ym.mec.biz.service.ImGroupService;
-import com.ym.mec.biz.service.SchoolStaffService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.apache.commons.collections.CollectionUtils;
@@ -77,6 +76,15 @@ public class CooperationOrganServiceImpl extends BaseServiceImpl<Integer, Cooper
 		return cooperationOrganDao.queryByOrganId(organId);
 	}
 
+
+    @Override
+    public List<CooperationOrgan> queryByOrganId(String organId,Boolean enable) {
+        if (enable == null || enable) {
+            return cooperationOrganDao.queryByOrganId(organId);
+        }
+        return cooperationOrganDao.queryByOrganIdAndEnable(organId,enable);
+    }
+
     @Override
     public List<MusicGroupPaymentCalender> getCooperationOrganCalender4School(Integer id) {
 		return cooperationOrganDao.getCooperationOrganCalender4School(id);

+ 6 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -188,7 +188,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Autowired
     private LessonExaminationService lessonExaminationService;
 
-    private final Logger LOGGER = LoggerFactory
+    private final Logger businessLogger = LoggerFactory
             .getLogger(this.getClass());
 
     @Override
@@ -1523,18 +1523,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     	if(CollectionUtils.isEmpty(courseSchedules)){
     		throw new BizException("请指定课程");
 		}
+		businessLogger.info("courseAdjustOnlyWithClassDate: {}",JSON.toJSONString(courseSchedules));
 		Map<Long, CourseSchedule> idCourseMap = courseSchedules.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
 		List<Long> courseIds = courseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
 		List<CourseSchedule> existCourses = courseScheduleDao.findByCourseScheduleIds(courseIds);
 		Date now = new Date();
-
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (null == sysUser) {
-			throw new BizException("获取用户信息失败");
-		}
-
 		//获取操作日志
-		List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds,existCourses,sysUser.getId(),now);
+		List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds,existCourses,operatorId,now);
 
 		for (CourseSchedule existCours : existCourses) {
 			if(now.compareTo(existCours.getStartClassTime())>0){
@@ -4144,7 +4139,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			try {
 				tenantAssetsInfoService.deductAmount(updateList);
 			}catch (Exception e){
-				LOGGER.error("deductAmount  >>>>>>>>>",e.getCause());
+				businessLogger.info("deductAmount  >>>>>>>>>",e.getCause());
 			}
 			courseIds = updateList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
 			List<CourseSchedule> beMergeCourses = courseScheduleDao.getBeMergeCourseWithMainCourseIds(courseIds);
@@ -4956,7 +4951,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if(StringUtils.isEmpty(courseScheduleIds)){
             throw new BizException("参数校验失败");
         }
-        LOGGER.info("清空老师和学生考勤,user:{},参数:{}",user.getId(),courseScheduleIds);
+		businessLogger.info("清空老师和学生考勤,user:{},参数:{}",user.getId(),courseScheduleIds);
         List<Long> courseScheduleId = courseScheduleTeacherSalaryService.querySettlementScheduleId(courseScheduleIds);
         if(courseScheduleId == null || courseScheduleId.size() == 0){
             throw new BizException("课程已结算,无法清除考勤");
@@ -5313,7 +5308,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if(schedule == null){
 			throw new BizException("课程不存在");
 		}
-		LOGGER.warn("teacherCourseRates courseScheduleId:{},userId{}",courseScheduleId,user.getId());
+		businessLogger.info("teacherCourseRates courseScheduleId:{},userId{}",courseScheduleId,user.getId());
 		//如果是乐团课
 		List<CourseScheduleRateDto> courseScheduleRateDtos;
 		CourseSchedule courseSchedule;

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -423,7 +423,8 @@ public class ExportServiceImpl implements ExportService {
             throw new BizException("请选择服务周期");
         }
         SysUser sysUser = sysUserService.getUser();
-        String organId = organizationService.getEmployeeOrgan(sysUser.getId(), getParam(info, "organId", String.class), sysUser.getIsSuperAdmin());
+        String organId = organizationService.getEmployeeOrgan(sysUser.getId(),
+                getParam(info, "organId", String.class), sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
         return studentExtracurricularExercisesSituationDao.queryStudentServeInfo(monday,sunday,organId);
     }
 
@@ -984,7 +985,7 @@ public class ExportServiceImpl implements ExportService {
         String organIds = getParam(info, "organIds", String.class);
         Date date = DateUtil.stringToDate(getParam(info, "date", String.class), DateUtil.ISO_EXPANDED_DATE_FORMAT);
         SysUser sysUser = sysUserService.getUser();
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(), organIds, sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(), organIds, sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
         Date startTime = DateUtil.getFirstDayOfMonth(date);
         Date EndTime = DateUtil.getLastSecondWithDay(DateUtil.getLastDayOfMonth(date));
 
@@ -1089,7 +1090,7 @@ public class ExportServiceImpl implements ExportService {
         String organId = getParam(info, "organId", String.class);
         IndexErrorType errorType = getParam(info, "errorType", IndexErrorType.class);
         SysUser sysUser = sysUserService.getUser();
-        organId = organizationService.getEmployeeOrgan(sysUser.getId(), organId, sysUser.getIsSuperAdmin());
+        organId = organizationService.getEmployeeOrgan(sysUser.getId(), organId, sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
         List<IndexErrorDataExportDto> result = indexService.exportIndexErrData(organId, errorType);
         if (CollectionUtils.isEmpty(result)) {
             throw new BizException("没有可导出的记录");
@@ -1159,7 +1160,7 @@ public class ExportServiceImpl implements ExportService {
     public void musicGroupNormalStudentNum(HttpServletResponse response, ExportDto exportDto) throws IOException {
         String organIds = getParam(exportDto.getQueryInfo(), "organIds", String.class);
         SysUser sysUser = sysUserService.getUser();
-        organIds = organizationService.getEmployeeOrgan(sysUser.getId(), organIds, sysUser.getIsSuperAdmin());
+        organIds = organizationService.getEmployeeOrgan(sysUser.getId(), organIds, sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
 
         List<MusicGroupStatusEnum> musicGroupStatusList = new ArrayList<>();
         musicGroupStatusList.add(MusicGroupStatusEnum.PAY);

+ 12 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.google.common.collect.Lists;
 import com.microsvc.toolkit.middleware.im.ImPluginContext;
 import com.microsvc.toolkit.middleware.im.ImPluginService;
 import com.microsvc.toolkit.middleware.im.message.ImGroupMemberWrapper;
@@ -15,6 +16,7 @@ import com.ym.mec.biz.dal.dto.NameDto;
 import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.entity.ImGroup;
 import com.ym.mec.biz.dal.entity.ImGroupMember;
+import com.ym.mec.biz.dal.enums.EFriendRoleType;
 import com.ym.mec.biz.dal.enums.school.ESchoolStaffType;
 import com.ym.mec.biz.dal.wrapper.ImGroupWrapper;
 import com.ym.mec.biz.service.*;
@@ -181,7 +183,12 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
 
     @Override
     public List<ImGroupMemberDto> queryMemberById(String imGroupId) {
-        return imGroupDao.queryMemberById(imGroupId);
+        List<ImGroupMemberDto> imGroupMemberDtos = imGroupDao.queryMemberById(imGroupId);
+
+        for (ImGroupMemberDto imGroupMemberDto : imGroupMemberDtos) {
+            imGroupMemberDto.setType(EFriendRoleType.getByName(imGroupMemberDto.getRoleType()).name());
+        }
+        return imGroupMemberDtos;
     }
 
     @Override
@@ -383,8 +390,6 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
         if (schoolStaffType.equals(ESchoolStaffType.ORCHESTRA_LEADER)) {
             groupChangeOwner(userId, imGroup.getId());
         }
-        imGroup.setMemberNum(imGroup.getMemberNum() + 1);
-        imGroupDao.update(imGroup);
         ImGroupMember imGroupMember = new ImGroupMember();
         imGroupMember.setImGroupId(imGroup.getId());
         imGroupMember.setUserId(userId);
@@ -392,6 +397,10 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
         imGroupMember.setRoleType(schoolStaffType.getDescribe());
         imGroupMember.setTenantId(imGroup.getTenantId());
         imGroupMemberDao.insert(imGroupMember);
+
+
+        imGroup.setMemberNum(imGroupMemberDao.getByGroupId(Lists.newArrayList(imGroup.getId())).size());
+        imGroupDao.update(imGroup);
     }
 
     /**

+ 97 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MultiDataSourceHomeStatsServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.MultiDataSourceHomeStatsDao;
+import com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper;
+import com.ym.mec.biz.service.MultiDataSourceHomeStatsService;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class MultiDataSourceHomeStatsServiceImpl implements MultiDataSourceHomeStatsService {
+
+    @Resource
+    private MultiDataSourceHomeStatsDao multiDataSourceHomeStatsDao;
+
+    @Override
+    public List<MultiDataSourceHomeStatsWrapper.summerIncome> summerIncome(MultiDataSourceHomeStatsWrapper.QueryDto queryDto) {
+        Date startTime = DateUtil.stringToDate(queryDto.getStartTime(),DateUtil.DEFAULT_PATTERN);
+        Date endTime = DateUtil.stringToDate(queryDto.getEndTime(),DateUtil.DEFAULT_PATTERN);
+        List<String> dates;
+        if(DateUtil.daysBetween(startTime, endTime) <= 31){
+            queryDto.setGroupBy("%Y年-%m月-%d日");
+            queryDto.setFormat("%Y年%m月%d日");
+            dates = DateUtil.getDatesBetweenByDay(startTime, endTime);
+        } else if (DateUtil.monthsBetween(startTime, endTime) <= 12) {
+            queryDto.setGroupBy("%Y-%m");
+            queryDto.setFormat("%Y年%m月");
+            dates = DateUtil.getDatesBetweenByMonth(startTime, endTime);
+        }else {
+            queryDto.setGroupBy("%Y");
+            queryDto.setFormat("%Y年");
+            dates = DateUtil.getDatesBetweenByYear(startTime, endTime);
+        }
+        //获取酷乐秀收入
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> clsIncomeDateList = multiDataSourceHomeStatsDao.clsSummerIncome(queryDto);
+        //获取管乐团收入
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gytIncomeDateList = multiDataSourceHomeStatsDao.gytSummerIncome(queryDto);
+        //获取管乐迷收入
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gymIncomeDateList = multiDataSourceHomeStatsDao.gymSummerIncome(queryDto);
+
+        Map<String, MultiDataSourceHomeStatsWrapper.IncomeByDate> clsMap = clsIncomeDateList.stream().
+                collect(Collectors.groupingBy(e -> e.getDate(), Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
+        Set<String> clsKeySet = clsMap.keySet();
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> clsList = new ArrayList<>();
+
+        Map<String, MultiDataSourceHomeStatsWrapper.IncomeByDate> gytMap = gytIncomeDateList.stream().
+                collect(Collectors.groupingBy(e -> e.getDate(), Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
+        Set<String> gytKeySet = gytMap.keySet();
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gytList = new ArrayList<>();
+
+        Map<String, MultiDataSourceHomeStatsWrapper.IncomeByDate> gymMap = gymIncomeDateList.stream().
+                collect(Collectors.groupingBy(e -> e.getDate(), Collectors.collectingAndThen(Collectors.toList(), v -> v.get(0))));
+        Set<String> gymKeySet = gymMap.keySet();
+        List<MultiDataSourceHomeStatsWrapper.IncomeByDate> gymList = new ArrayList<>();
+
+        // 遍历日期列表,补全数据并添加到结果集中
+        for (String date : dates) {
+            this.addItem(clsKeySet,clsList,date,clsMap);
+            this.addItem(gytKeySet,gytList,date,gytMap);
+            this.addItem(gymKeySet,gymList,date,gymMap);
+        }
+        List<MultiDataSourceHomeStatsWrapper.summerIncome> result = new ArrayList<>();
+        result.add(this.init("cls",clsList));
+        result.add(this.init("gyt",gytList));
+        result.add(this.init("gym",gymList));
+        return result;
+    }
+
+    private MultiDataSourceHomeStatsWrapper.summerIncome init(String platForm,List<MultiDataSourceHomeStatsWrapper.IncomeByDate> itemList){
+        MultiDataSourceHomeStatsWrapper.summerIncome income = new MultiDataSourceHomeStatsWrapper.summerIncome();
+        income.setPlatform(platForm);
+        income.setTotalAmount(itemList.stream().map(e->e.getTotalAmount()).reduce(BigDecimal.ZERO,BigDecimal::add));
+        income.setIncomeByDates(itemList);
+        return income;
+    }
+
+    private void addItem(Set<String> keySet,List<MultiDataSourceHomeStatsWrapper.IncomeByDate> itemList,String date,
+                        Map<String, MultiDataSourceHomeStatsWrapper.IncomeByDate> itemMap){
+        if (keySet.contains(date)) {
+            // 如果存在对应日期的数据,则添加到结果集中
+            itemList.add(itemMap.get(date));
+        } else {
+            // 如果不存在对应日期的数据,则创建一个新的IncomeByDate对象,并设置totalAmount为0
+            MultiDataSourceHomeStatsWrapper.IncomeByDate newIncomeByDate = new MultiDataSourceHomeStatsWrapper.IncomeByDate();
+            newIncomeByDate.setDate(date);
+            newIncomeByDate.setTotalAmount(BigDecimal.ZERO);
+            itemList.add(newIncomeByDate);
+        }
+    }
+
+
+}

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -4228,7 +4228,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
      * 获取乐团信息
      */
     @Override
-    public Map<Long, MusicGroup> getMapByIds(List<String> musicGroupIds) {
+    public Map<String, MusicGroup> getMapByIds(List<String> musicGroupIds) {
         if(CollectionUtils.isEmpty(musicGroupIds)){
             return new HashMap<>();
         }
@@ -4236,7 +4236,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if(CollectionUtils.isEmpty(musicGroupByIds)){
             return new HashMap<>();
         }
-        return musicGroupByIds.stream().collect(Collectors.toMap(o -> Long.parseLong(o.getId()), Function.identity()));
+        return musicGroupByIds.stream().collect(Collectors.toMap(MusicGroup::getId, Function.identity()));
     }
 
 

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -64,7 +64,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	@Override
 	public List<Organization> queryEmployeeOrgan(){
 		SysUser sysUser = sysUserService.getUser();
-		String organIds = this.getEmployeeOrgan(sysUser.getId(), "", sysUser.getIsSuperAdmin());
+		String organIds = this.getEmployeeOrgan(sysUser.getId(), "", sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
 		return organizationDao.queryEmployeeOrgan(organIds);
 	}
 
@@ -134,7 +134,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	@Override
 	public String getEmployeeOrgan(Object organIds) {
 		SysUser sysUser = sysUserService.getUser();
-		return this.getEmployeeOrgan(sysUser.getId(),organIds == null?"":organIds.toString(),sysUser.getIsSuperAdmin());
+		return this.getEmployeeOrgan(sysUser.getId(),organIds == null?"":organIds.toString(),sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1);
 	}
 
 	@Override

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SchoolActivityDetailServiceImpl.java

@@ -124,7 +124,7 @@ public class SchoolActivityDetailServiceImpl extends ServiceImpl<SchoolActivityD
                 .map(SchoolActivityDetailWrapper.SchoolActivityDetail::getMusicGroupId)
                 .collect(Collectors.toList());
 
-        Map<Long, MusicGroup> groupMap = musicGroupService.getMapByIds(musicGroupIds);
+        Map<String, MusicGroup> groupMap = musicGroupService.getMapByIds(musicGroupIds);
 
         // 设置声部名
         List<Integer> subjectIds = schoolActivityDetails.stream()
@@ -139,7 +139,7 @@ public class SchoolActivityDetailServiceImpl extends ServiceImpl<SchoolActivityD
 
             // 设置声部 人员数据
             SchoolActivityWrapper.SchoolActivityStudentQuery query = new SchoolActivityWrapper.SchoolActivityStudentQuery();
-            query.setMusicGroupId(schoolActivityDetail.getMusicGroupId().toString());
+            query.setMusicGroupId(schoolActivityDetail.getMusicGroupId());
             query.setActivityDetailId(schoolActivityDetail.getId());
             List<SchoolActivityWrapper.SchoolActivitySubject> schoolActivitySubjects = schoolActivityDetailUserService.getUserList(query);
 

+ 41 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SchoolStaffServiceImpl.java

@@ -12,6 +12,7 @@ import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.school.ESchoolStaffType;
 import com.ym.mec.biz.dal.mapper.SchoolStaffMapper;
 import com.ym.mec.biz.dal.wrapper.SchoolStaffWrapper;
@@ -60,6 +61,10 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
     private CooperationOrganDao cooperationOrganDao;
     @Autowired
     private SmsCodeService smsCodeService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private StudentDao studentDao;
 
     @Autowired
     private ImUserFriendDao imUserFriendDao;
@@ -296,7 +301,7 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
         selfMap.put(user.getId(), user.getPhone());
 
 
-        SysMessageConfig sysMessageConfig = sysMessageConfigDao.queryByType(MessageTypeEnum.JIGUANG_TEACHER_SIGN_IN_EXCEPTION.getCode());
+        SysMessageConfig sysMessageConfig = sysMessageConfigDao.queryByType(MessageTypeEnum.SMS_SCHOOL_ACCOUNT_REGISTER.getCode());
         String url = sysMessageConfig.getUrl();
 
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_SCHOOL_ACCOUNT_REGISTER,
@@ -552,14 +557,30 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
         Map<String, Integer> collect = baseMapper.selectUserTypeNumsStat(schoolId).stream()
                 .collect(Collectors.toMap(StatGroupWrapper::getGid, StatGroupWrapper::getTotal, (o, n) -> n));
 
+        // 学校统计条件
+        HashMap<String, Object> paramMap = new HashMap<String, Object>() {{
+            put("schoolId", schoolId);
+            put("status", MusicGroupStatusEnum.PROGRESS);
+        }};
+
+        CooperationOrgan cooperationOrgan = cooperationOrganDao.get(schoolId);
+        if (Objects.nonNull(cooperationOrgan)) {
+            paramMap.put("tenantId", cooperationOrgan.getTenantId());
+        }
+        // 学校乐团统计
+        int orchestraNums = musicGroupDao.countMusicGroups(paramMap);
+
+        // 学校在读学生
+        int studentNums = studentDao.countMusicGroupStudents(paramMap);
+
         // 统计学校员工身份
         return SchoolStaffWrapper.SchoolStaffStat.builder()
                 .schoolmasterNums(collect.getOrDefault(ESchoolStaffType.SCHOOLMASTER.getCode(), 0))
                 .schoolLeaderNums(collect.getOrDefault(ESchoolStaffType.SCHOOL_LEADER.getCode(), 0))
                 .orchestraLeaderNums(collect.getOrDefault(ESchoolStaffType.ORCHESTRA_LEADER.getCode(), 0))
                 .teacherNums(collect.getOrDefault(ESchoolStaffType.TEACHER.getCode(), 0))
-                .orchestraNums(0)
-                .studentNums(0)
+                .orchestraNums(orchestraNums)
+                .studentNums(studentNums)
                 .build();
     }
 
@@ -731,5 +752,21 @@ public class SchoolStaffServiceImpl extends ServiceImpl<SchoolStaffMapper, Schoo
 
     }
 
-
+    @Override
+    public boolean updateById(SchoolStaff entity) {
+        SchoolStaff schoolStaff = getById(entity.getId());
+        if (schoolStaff == null) {
+            throw new BizException("用户信息不存在");
+        }
+        SysUser sysUser = sysUserService.queryUserById(schoolStaff.getUserId().intValue());
+        if (StringUtils.isNotBlank(entity.getStatus())) {
+            if (entity.getStatus().equals("1")) {
+                sysUser.setLockFlag(0);
+            } else if (entity.getStatus().equals("9")) {
+                sysUser.setLockFlag(9);
+            }
+            teacherDao.updateUser(sysUser);
+        }
+        return super.updateById(entity);
+    }
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1702,6 +1702,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     @Override
     public List<OperatingTotalIncomeDto> queryOperatingSummaryIncome(Map<String, Object> params) {
         List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderDao.ExportQueryPage1(params);
+        studentPaymentOrderExportDtos.addAll(studentPaymentOrderDao.ExportQueryPage2(params));
         long i = 1;
         //获取机构费率
         List<Long> otherOrderIds = studentPaymentOrderExportDtos.stream().filter(e -> e.getGroupType() != GroupType.GOODS_SELL

+ 12 - 2
mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml

@@ -51,10 +51,10 @@
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
         INSERT INTO cooperation_organ
         (id_, name_, linkman_, job_, mobile_no_, address_, organ_id_, create_time_, update_time_, ownership_type_,
-         is_enable_, full_job_resource_,education_user_id_,tenant_id_)
+         is_enable_, full_job_resource_,education_user_id_,tenant_id_,logo_)
         VALUES (#{id}, #{name}, #{linkman}, #{job}, #{mobileNo}, #{address}, #{organId}, now(), now(),
                 #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{isEnable},
-                #{fullJobResource},#{educationUserId},#{tenantId})
+                #{fullJobResource},#{educationUserId},#{tenantId},#{logo})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -217,4 +217,14 @@
         WHERE mg.create_time_ = co.create_time_
         ORDER BY mg.cooperation_organ_id_
     </select>
+
+    <select id="queryByOrganIdAndEnable" resultMap="CooperationOrgan">
+        SELECT *
+        FROM cooperation_organ
+        WHERE FIND_IN_SET(organ_id_, #{organId})
+          AND del_flag_ != 1
+        <if test="enable != null">
+            AND is_enable_ = #{enable}
+        </if>
+    </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ImUserFriendMapper.xml

@@ -184,5 +184,8 @@
         <if test="param.roleType != null and param.roleType != ''">
             and iuf.role_type_ = #{param.roleType}
         </if>
+        <if test="param.lockFlag != null and !param.lockFlag">
+            and u.lock_flag_ = 0
+        </if>
     </select>
 </mapper>

+ 34 - 0
mec-biz/src/main/resources/config/mybatis/MultiDataSourceHomeStatsMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.MultiDataSourceHomeStatsDao">
+
+    <select id="clsSummerIncome"
+            resultType="com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper$IncomeByDate">
+        select DATE_FORMAT(account_period_time_,#{queryDto.format}) `date`,SUM(trans_amount_) totalAmount
+        from cooleshow_pro.platform_cash_account_record where in_or_out_ = 'IN' AND post_status_ = 'RECORDED'
+        AND DATE_FORMAT(account_period_time_,'%Y-%m-%d') BETWEEN #{queryDto.startTime} AND #{queryDto.endTime}
+        group by DATE_FORMAT(account_period_time_,#{queryDto.groupBy});
+    </select>
+    <select id="gytSummerIncome"
+            resultType="com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper$IncomeByDate">
+        select DATE_FORMAT(create_time_,#{queryDto.format}) `date`,SUM(current_price_) totalAmount
+        from jmedu_pro.user_payment_order where status_ = 'PAID'
+        AND DATE_FORMAT(create_time_,'%Y-%m-%d') BETWEEN #{queryDto.startTime} AND #{queryDto.endTime}
+        group by DATE_FORMAT(create_time_,#{queryDto.groupBy})
+    </select>
+    <select id="gymSummerIncome"
+            resultType="com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper$IncomeByDate">
+        SELECT DATE_FORMAT(pay_time_,#{queryDto.format}) `date`,SUM(CASE WHEN actual_amount_ IS NULL THEN 0 ELSE actual_amount_ END +
+        CASE WHEN balance_payment_amount_ IS NULL THEN 0 ELSE balance_payment_amount_ END) totalAmount
+        FROM student_payment_order
+        where status_ = 'SUCCESS' AND DATE_FORMAT(pay_time_,'%Y-%m-%d') BETWEEN #{queryDto.startTime} AND #{queryDto.endTime}
+        <if test="queryDto.organIds != null and queryDto.organIds != ''">
+            AND FIND_IN_SET(organ_id_,#{queryDto.organIds})
+        </if>
+        GROUP BY DATE_FORMAT(pay_time_,#{queryDto.groupBy})
+    </select>
+</mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -655,6 +655,9 @@
             <if test="status!=null">
                 AND status_=#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="schoolId != null">
+                AND cooperation_organ_id_ = #{schoolId}
+            </if>
         </where>
     </sql>
     <select id="findMusicGroups" resultMap="MusicGroup">

+ 21 - 19
mec-biz/src/main/resources/config/mybatis/OperatingReportNewMapper.xml

@@ -210,16 +210,18 @@
 		where #{month} BETWEEN DATE_FORMAT(orc.start_date_,'%Y-%m') AND DATE_FORMAT(orc.end_date_,'%Y-%m') AND orc.cloud_price_ > 0 AND orc.start_date_  IS NOT NULL;
 	</select>
 	<select id="sumRefundAmount" resultType="java.util.Map">
-		select organ_id_ 'key',SUM(amount_) 'value' from financial_expenditure where process_id_ IN (19,20,23) AND fee_project_ != 25
-		AND DATE_FORMAT(create_time_,'%Y-%m') = #{month} AND amount_ > 0 group by organ_id_;
+		select organ_id_ 'key',SUM(amount_) 'value' from financial_expenditure where process_id_ IN (19,22,23,28,51) AND fee_project_ = 19
+		AND effective_time_ = #{month} AND amount_ > 0 and del_flag_ = 0 group by organ_id_;
 	</select>
 	<select id="sumVariableCosts" resultType="java.util.Map">
 		select fe.organ_id_ 'key',SUM(amount_) 'value' from financial_expenditure fe
-		where DATE_FORMAT(fe.create_time_,'%Y-%m') = #{month} AND fee_project_ BETWEEN 6 AND 21 AND process_id_ = 28 group by fe.organ_id_;
+		where effective_time_ = #{month} AND amount_ > 0 and del_flag_ = 0
+		AND fee_project_ BETWEEN 6 AND 21 AND process_id_ IN (19,22,23,28,51) group by fe.organ_id_;
 	</select>
 	<select id="sumFixedCosts" resultType="java.util.Map">
 		select fe.organ_id_ 'key',SUM(amount_) 'value' from financial_expenditure fe
-		where DATE_FORMAT(fe.create_time_,'%Y-%m') = #{month} AND fee_project_ IN (1,2,3,4,5) AND process_id_ = 28 group by fe.organ_id_;
+		where effective_time_ = #{month} AND amount_ > 0 and del_flag_ = 0
+		AND fee_project_ IN (1,2,3,4,5) AND process_id_ IN (19,22,23,28,51) group by fe.organ_id_;
 	</select>
 	<select id="sumCloudPreAmount" resultType="java.util.Map">
 		select cto.organ_id_ 'key',TRUNCATE(SUM(operating_amount_ / (TIMESTAMPDIFF(DAY,cto.start_time_,cto.end_time_) + 1) *
@@ -355,21 +357,21 @@
     <select id="queryOASummaryExpenses" resultType="com.ym.mec.biz.dal.dto.OASummaryExpensesDto">
 		SELECT
 			o.name_ AS organName,
-			SUM(CASE WHEN fee_project_ = 3 THEN fe.amount_ ELSE 0 END) AS house,
-			SUM(CASE WHEN fee_project_ = 4 THEN fe.amount_ ELSE 0 END) AS office,
-			SUM(CASE WHEN fee_project_ = 5 THEN fe.amount_ ELSE 0 END) AS mainsProperty,
-			SUM(CASE WHEN fee_project_ = 6 THEN fe.amount_ ELSE 0 END) AS travel,
-			SUM(CASE WHEN fee_project_ = 7 THEN fe.amount_ ELSE 0 END) AS services,
-			SUM(CASE WHEN fee_project_ = 8 THEN fe.amount_ ELSE 0 END) AS welfare,
-			SUM(CASE WHEN fee_project_ = 9 THEN fe.amount_ ELSE 0 END) AS activities,
-			SUM(CASE WHEN fee_project_ = 10 THEN fe.amount_ ELSE 0 END) AS traffic,
-			SUM(CASE WHEN fee_project_ = 11 THEN fe.amount_ ELSE 0 END) AS certificates,
-			SUM(CASE WHEN fee_project_ IN (12,20) THEN fe.amount_ ELSE 0 END) AS instrument,
-			SUM(CASE WHEN fee_project_ = 15 THEN fe.amount_ ELSE 0 END) AS communications,
-			SUM(CASE WHEN fee_project_ = 16 THEN fe.amount_ ELSE 0 END) AS postalTransport,
-			SUM(CASE WHEN fee_project_ = 17 THEN fe.amount_ ELSE 0 END) AS hospitality,
-			SUM(CASE WHEN fee_project_ = 19 THEN fe.amount_ ELSE 0 END) AS refund,
-			SUM(CASE WHEN fee_project_ = 26 THEN fe.amount_ ELSE 0 END) AS other,
+			SUM(CASE WHEN fee_project_ = 3 THEN fe.current_amount_ ELSE 0 END) AS house,
+			SUM(CASE WHEN fee_project_ = 4 THEN fe.current_amount_ ELSE 0 END) AS office,
+			SUM(CASE WHEN fee_project_ = 5 THEN fe.current_amount_ ELSE 0 END) AS mainsProperty,
+			SUM(CASE WHEN fee_project_ = 6 THEN fe.current_amount_ ELSE 0 END) AS travel,
+			SUM(CASE WHEN fee_project_ = 7 THEN fe.current_amount_ ELSE 0 END) AS services,
+			SUM(CASE WHEN fee_project_ = 8 THEN fe.current_amount_ ELSE 0 END) AS welfare,
+			SUM(CASE WHEN fee_project_ = 9 THEN fe.current_amount_ ELSE 0 END) AS activities,
+			SUM(CASE WHEN fee_project_ = 10 THEN fe.current_amount_ ELSE 0 END) AS traffic,
+			SUM(CASE WHEN fee_project_ = 11 THEN fe.current_amount_ ELSE 0 END) AS certificates,
+			SUM(CASE WHEN fee_project_ IN (12,20) THEN fe.current_amount_ ELSE 0 END) AS instrument,
+			SUM(CASE WHEN fee_project_ = 15 THEN fe.current_amount_ ELSE 0 END) AS communications,
+			SUM(CASE WHEN fee_project_ = 16 THEN fe.current_amount_ ELSE 0 END) AS postalTransport,
+			SUM(CASE WHEN fee_project_ = 17 THEN fe.current_amount_ ELSE 0 END) AS hospitality,
+			SUM(CASE WHEN fee_project_ = 19 THEN fe.current_amount_ ELSE 0 END) AS refund,
+			SUM(CASE WHEN fee_project_ = 26 THEN fe.current_amount_ ELSE 0 END) AS other,
 			SUM(CASE WHEN hc.human_cost_type_ = 'FIXED' THEN hc.amount_ ELSE 0 END) AS fixedHumanCost,
 			SUM(CASE WHEN hc.human_cost_type_ = 'VARIABLE' THEN hc.amount_ ELSE 0 END) AS variableHumanCost,
 			SUM(CASE WHEN hc.human_cost_type_ = 'NETWORK_CLASSROOM' THEN hc.amount_ ELSE 0 END) AS network,

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/SchoolStaffMapper.xml

@@ -11,7 +11,7 @@
              , t1.user_type_
              , t1.tenant_id_
              , t1.organ_id_list_
-             , IFNULL(t2.real_name_, t2.username_) AS username
+             ,  t2.username_ AS username
              , t2.avatar_
              , t2.phone_                           AS mobile
              , t1.status_
@@ -60,13 +60,13 @@
 
     <update id="updateStatusAndRecoveryStatus">
         update school_staff ss left join sys_user su on su.id_ = ss.user_id_
-        set ss.status_ = if(#{status},0,9),ss.recovery_status_ = if(#{status},0,1),su.lock_flag_ = if(#{status},0,9)
-        where ss.school_id_ = #{cooperationOrganId} and ss.status_ in (0,9)
+        set ss.status_ = if(#{status},1,9),ss.recovery_status_ = if(#{status},0,1),su.lock_flag_ = if(#{status},0,9)
+        where ss.school_id_ = #{cooperationOrganId} and ss.status_ in (1,9)
         <if test="status">
             and ss.recovery_status_ = 1
         </if>
         <if test="status == false ">
-            and (ss.status_ = 0  or ss.status_ is null)
+            and (ss.status_ = 1  or ss.status_ is null)
         </if>
     </update>
 

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -1390,4 +1390,16 @@
                  left join lesson_examination t2 on t2.id_ = t.lesson_examination_id_
         <include refid="homeworkSql"/>
     </select>
+
+    <select id="countMusicGroupStudents" resultType="java.lang.Integer">
+        SELECT COUNT(DISTINCT t2.user_id_) FROM music_group t1 JOIN student_registration t2 ON (t1.id_ = t2.music_group_id_)
+        <where>
+            <if test="status != null">
+                AND t1.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="schoolId != null">
+                AND t1.cooperation_organ_id_ = #{schoolId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 10 - 4
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -767,11 +767,17 @@
         FROM student_payment_order spo
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
         LEFT JOIN sporadic_charge_info sci on spo.music_group_id_ = sci.id_
-        left join music_group mg ON mg.id_ = spo.music_group_id_ AND spo.group_type_ = 'MUSIC' AND spo.type_ = 'APPLY'
-        where ((mg.musical_instruments_provide_status_ = 1 AND mg.musical_instruments_provide_time_ = #{month}) OR
-               (DATE_FORMAT(spo.pay_time_,'%Y-%m') = #{month} AND (mg.musical_instruments_provide_status_ IS NULL OR mg.musical_instruments_provide_status_ = 1)))
+        where DATE_FORMAT(spo.pay_time_,'%Y-%m') = #{month} AND spo.order_no_ NOT IN (select distinct order_no_ from sell_order where DATE_FORMAT(delivery_time_,'%Y-%m') = #{month})
         AND spo.tenant_id_ = 1 AND spo.status_ = 'SUCCESS'
-        ORDER BY spo.id_ ASC
+    </select>
+    <select id="ExportQueryPage2" resultMap="orderAndDetail" parameterType="map">
+        select spo.*,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_
+                              detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
+               sci.charge_type_ from (select distinct order_no_ from sell_order where DATE_FORMAT(delivery_time_,'%Y-%m') = #{month}) so
+                                         left join student_payment_order spo ON so.order_no_ = spo.order_no_
+                                         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
+                                         LEFT JOIN sporadic_charge_info sci on spo.music_group_id_ = sci.id_
+        where spo.tenant_id_ = 1 AND spo.status_ = 'SUCCESS'
     </select>
     <resultMap id="SporadicChargeInfoDtoMap" type="com.ym.mec.biz.dal.dto.SporadicChargeInfoDto">
         <result property="organName" column="organ_name_"/>

+ 5 - 1
mec-biz/src/main/resources/config/mybatis/StudentPlusMapper.xml

@@ -12,6 +12,10 @@
 
         left join sys_user su on su.id_ = s.user_id_
         left join student_registration sr on sr.user_id_ = s.user_id_
+
+        <if test="param.cooperationOrganId != null">
+            left join music_group mg on mg.id_ = sr.music_group_id_
+        </if>
         <where>
             sr.music_group_status_ in
             <foreach collection="param.statusList" close=")" item="status" open="(" separator=",">
@@ -27,7 +31,7 @@
                 and s.subject_id_list_ = #{param.subjectId}
             </if>
             <if test="param.cooperationOrganId != null">
-                and s.cooperation_organ_id_ = #{param.cooperationOrganId}
+                and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
             </if>
             <if test="param.studentId != null">
                 and s.user_id_ = #{param.studentId}

+ 43 - 43
mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java

@@ -75,49 +75,49 @@ public class BaseController {
         return obj;
     }
 
-    private static <T> HttpResponseResult<T> getResponseData(boolean status, int statusCode, T data, String message) {
-        HttpResponseResult<T> obj = new HttpResponseResult<T>();
-        obj.setStatus(status);
-        obj.setCode(statusCode);
-        obj.setData(data);
-        obj.setMsg(message);
-        return obj;
-    }
-
-    /**
-     * 处理一般异常
-     *
-     * @param ex
-     * @param request
-     * @return
-     */
-    @ExceptionHandler(Exception.class)
-    public HttpResponseResult<String> handleException(Exception ex, HttpServletRequest request) {
-        Throwable e = ExceptionUtils.getRootCause(ex);
-        if (e == null) {
-            e = ex;
-        }
-        logger.error("System Error", e);
-        // return failed(e.getMessage());
-        if (e instanceof BizException || e instanceof ThirdpartyException) {
-            if(e.getMessage().equals("205")){
-                return failed(HttpStatus.RESET_CONTENT,e.getMessage());
-            }
-
-            // 自定义错误码
-            if (e instanceof BizException) {
-                BizException bizException = (BizException) e;
-                return getResponseData(false, bizException.getCode(), null, bizException.getMessage());
-            }
-
-            // 默认返回错误码
-            return failed(e.getMessage());
-        } else if (e instanceof AccessDeniedException) {
-            return failed("禁止访问");
-        }else if(e instanceof BindException){
-            String errors = ((BindException) e).getFieldErrors().stream().map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining("\n"));
-            return failed(errors);
-        } else if(e instanceof MethodArgumentNotValidException){
+	private static <T> HttpResponseResult<T> getResponseData(boolean status, int statusCode, T data, String message) {
+		HttpResponseResult<T> obj = new HttpResponseResult<T>();
+		obj.setStatus(status);
+		obj.setCode(statusCode);
+		obj.setData(data);
+		obj.setMsg(message);
+		return obj;
+	}
+
+	/**
+	 * 处理一般异常
+	 *
+	 * @param ex
+	 * @param request
+	 * @return
+	 */
+	@ExceptionHandler(Exception.class)
+	public HttpResponseResult<String> handleException(Exception ex, HttpServletRequest request) {
+		Throwable e = ExceptionUtils.getRootCause(ex);
+		if (e == null) {
+			e = ex;
+		}
+		logger.error("System Error", e);
+		// return failed(e.getMessage());
+		if (e instanceof BizException || e instanceof ThirdpartyException) {
+			if(e.getMessage().equals("205")){
+				return failed(HttpStatus.RESET_CONTENT,e.getMessage());
+			}
+
+			// 自定义错误码
+			if (e instanceof BizException) {
+				BizException bizException = (BizException) e;
+				return getResponseData(false, bizException.getCode(), null, bizException.getMessage());
+			}
+
+			// 默认返回错误码
+			return failed(e.getMessage());
+		} else if (e instanceof AccessDeniedException) {
+			return failed("禁止访问");
+		}else if(e instanceof BindException){
+			String errors = ((BindException) e).getFieldErrors().stream().map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining("\n"));
+			return failed(errors);
+		} else if(e instanceof MethodArgumentNotValidException){
             MethodArgumentNotValidException validException = (MethodArgumentNotValidException) ex;
             String errorMsg = validException.getBindingResult()
                     .getFieldErrors()

+ 11 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java

@@ -5,6 +5,8 @@ import javax.servlet.Filter;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.logging.LogLevel;
+import org.springframework.boot.logging.LoggingSystem;
 import org.springframework.boot.web.servlet.FilterRegistrationBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
@@ -30,6 +32,8 @@ public class TeacherApplication {
 
 	public static void main(String[] args) {
 		SpringApplication.run(TeacherApplication.class, args);
+
+		configureGlobalLogger();
 	}
 
 	@Bean
@@ -55,4 +59,11 @@ public class TeacherApplication {
 		registration.setOrder(1);
 		return registration;
 	}
+
+
+	private static void configureGlobalLogger() {
+		LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
+		// 设置业务日志记录器的日志级别为INFO
+		loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
+	}
 }

+ 9 - 54
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.teacher.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
@@ -47,14 +46,13 @@ public class TeacherCourseScheduleController extends BaseController {
     @Autowired
     private StudentAttendanceService studentAttendanceService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private StudentAttendanceDao studentAttendanceDao;
     @Autowired
     private SysTenantConfigService sysTenantConfigService;
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-
     @Autowired
     private SubjectService subjectService;
 
@@ -75,10 +73,7 @@ public class TeacherCourseScheduleController extends BaseController {
         if(Objects.isNull(date)){
             return failed("请指定日期!");
         }
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null == user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
+        SysUser user = sysUserService.getUser();
         if(null == user.getTenantId()){
             return failed("用户机构信息异常,请联系管理员");
         }
@@ -103,27 +98,16 @@ public class TeacherCourseScheduleController extends BaseController {
     @ApiOperation(value = "根据月份获取该月历史有课的日期")
     @GetMapping("/getHistoryCourseScheduleDateByMonth")
     public Object getHistoryCourseScheduleDateByTeacher(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
         if(Objects.isNull(month)){
             return failed(HttpStatus.FORBIDDEN, "请指定日期!");
         }
-        return succeed(scheduleService.getHistoryCourseScheduleDateByTeacher(user.getId(),month));
+        return succeed(scheduleService.getHistoryCourseScheduleDateByTeacher(sysUserService.getUserId(),month));
     }
 
     @ApiOperation(value = "根据日期获取当日历史课程")
     @GetMapping("/getHistoryCourseSchedulesWithDate")
     public Object getHistoryCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date){
-        if(Objects.isNull(date)){
-            return failed("请指定日期!");
-        }
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
-        List<CourseScheduleDto> teacherCourseSchedulesWithDate = scheduleService.getTeacherHistoryCourseSchedulesWithDate(user.getId(),date);
+        List<CourseScheduleDto> teacherCourseSchedulesWithDate = scheduleService.getTeacherHistoryCourseSchedulesWithDate(sysUserService.getUserId(),date);
         Map<String,Object> result = new HashMap<>();
         result.put("rows",teacherCourseSchedulesWithDate);
         result.put("appealDaysRange",1);
@@ -143,11 +127,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @ApiOperation(value = "获取老师指定班级的排课")
     @GetMapping("/queryTeacherClassCourseSchedule")
     public Object queryTeacherClassCourseSchedule(CourseScheduleQueryInfo queryInfo){
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
-        queryInfo.setUserId(user.getId().longValue());
+        queryInfo.setUserId(sysUserService.getUserId().longValue());
         return succeed(scheduleService.queryTeacherClassCourseSchedule(queryInfo));
     }
 
@@ -155,11 +135,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @GetMapping("/queryTeacherVipClassCourseSchedule")
     public Object queryTeacherVipClassCourseSchedule(CourseScheduleQueryInfo queryInfo){
         Map<String,Object> result = new HashMap<>();
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
-        queryInfo.setUserId(user.getId().longValue());
+        queryInfo.setUserId(sysUserService.getUserId().longValue());
         result.put("rows",scheduleService.queryTeacherVipClassCourseSchedule(queryInfo));
         result.put("appealHoursRange",4);
         return succeed(result);
@@ -181,13 +157,6 @@ public class TeacherCourseScheduleController extends BaseController {
         return succeed(studentAttendanceService.getCurrentCourseStudents(queryInfo));
     }
 
-//    @ApiOperation(value = "课程批量调整")
-//    @PostMapping("/batchUpdateCourseSchedule")
-//    public Object batchUpdateCourseSchedule(@RequestBody BatchInsertCoursesDto batchInsertCoursesDto){
-//        scheduleService.batchUpdateCourseSchedule(batchInsertCoursesDto);
-//        return succeed();
-//    }
-
     @ApiOperation(value = "课时调整")
     @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @AuditLogAnnotation(operateName = "课时调整")
@@ -205,9 +174,6 @@ public class TeacherCourseScheduleController extends BaseController {
         if(Objects.isNull(oldCourseSchedule.getTenantId())){
             return failed("课程机构信息异常");
         }
-        /*if(oldCourseSchedule.getGroupType() != GroupType.VIP){
-        	return failed("客户端只能调整VIP课");
-        }*/
         Date now = new Date();
         if(now.compareTo(oldCourseSchedule.getStartClassTime())>0){
             throw new BizException("进行中或已结束课程不可调整");
@@ -356,11 +322,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @PostMapping("/courseAdjustOnlyWithClassDate")
     @AuditLogAnnotation(operateName = "课程批量调整")
     public HttpResponseResult courseAdjustOnlyWithClassDate(@RequestBody List<CourseSchedule> courseSchedules){
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
-        scheduleService.courseAdjustOnlyWithClassDate(courseSchedules,user.getId());
+        scheduleService.courseAdjustOnlyWithClassDate(courseSchedules,sysUserService.getUserId());
         return succeed();
     }
 
@@ -368,10 +330,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @PostMapping("/courseEvaluateList")
     @AuditLogAnnotation(operateName = "课程评价列表")
     public HttpResponseResult courseEvaluateList(@RequestBody EvaluateCourseQueryInfo queryInfo){
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
+        SysUser user = sysUserService.getUser();
         queryInfo.setTeacherId(user.getId());
         String offlineSignInEarlyForwardTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.OFFLINE_SIGN_IN_EARLY_FORWARD_TIME, user.getTenantId());
         String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP, user.getTenantId());
@@ -411,11 +370,7 @@ public class TeacherCourseScheduleController extends BaseController {
     @PostMapping("/queryStudyStandardWaitVisit")
     @AuditLogAnnotation(operateName = "学习标准待回访列表")
     public HttpResponseResult queryStudyStandardWaitVisit(EvaluateCourseQueryInfo queryInfo){
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if(null==user){
-            return failed(HttpStatus.FORBIDDEN, "请登录");
-        }
-        queryInfo.setTeacherId(user.getId());
+        queryInfo.setTeacherId(sysUserService.getUserId());
         return succeed(scheduleService.queryStudyStandardWaitVisit(queryInfo));
     }
 

+ 40 - 15
mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java

@@ -28,6 +28,10 @@ public class DateUtil {
 
 	public static final String DATE_FORMAT_MIN = "yyyy年MM月dd日";
 
+	public static final String DATE_FORMAT_MONTH = "yyyy年MM月";
+
+	public static final String DATE_FORMAT_YEAR = "yyyy年";
+
 	/**
 	 * 默认使用的Locale。默认Locale为 US
 	 */
@@ -969,6 +973,42 @@ public class DateUtil {
 		return df.format(date);
 	}
 
+	public static List<String> getDatesBetweenByDay(Date startTime, Date endTime) {
+		List<String> dates = new ArrayList<>();
+		// 循环遍历日期并格式化为字符串
+		Date currentDate = startTime;
+		while (!currentDate.after(endTime)) {
+			String dateString = DateUtil.format(currentDate,DATE_FORMAT_MIN);
+			dates.add(dateString);
+			currentDate = DateUtil.addDays(currentDate,1);
+		}
+		return dates;
+	}
+
+	public static List<String> getDatesBetweenByMonth(Date startTime, Date endTime) {
+		List<String> dates = new ArrayList<>();
+		// 循环遍历日期并格式化为字符串
+		Date currentDate = startTime;
+		while (!currentDate.after(endTime)) {
+			String dateString = DateUtil.format(currentDate,DATE_FORMAT_MONTH);
+			dates.add(dateString);
+			currentDate = DateUtil.addMonths(currentDate,1);
+		}
+		return dates;
+	}
+
+	public static List<String> getDatesBetweenByYear(Date startTime, Date endTime) {
+		List<String> dates = new ArrayList<>();
+		// 循环遍历日期并格式化为字符串
+		Date currentDate = startTime;
+		while (!currentDate.after(endTime)) {
+			String dateString = DateUtil.format(currentDate,DATE_FORMAT_YEAR);
+			dates.add(dateString);
+			currentDate = DateUtil.addYears(currentDate,1);
+		}
+		return dates;
+	}
+
 	/**
 	 * @describe 获取时间段内对应星期数的集合
 	 * @author Joburgess
@@ -1417,19 +1457,4 @@ public class DateUtil {
 		}
 		return false;
 	}
-
-	public static void main(String[] args) throws ParseException {
-		// DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
-//		DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//		 System.out.println(daysBetween(df.parse("2017-07-20 10:07:42"), df.parse(df.format(new Date()))));
-//		System.out.println(getWeekMondayWithDate(new Date()));
-//		System.out.println(getNextWeekMonday(new Date()));
-//		System.out.println(getNextWeekSunday(new Date()));
-//		System.out.println(dayEnd(new Date()));
-//		System.out.println(format(getLastDayOfMonth(new Date()),CHINESE_DATA_FORMAT));
-//		System.out.println(monthsBetween(df1.parse("2020-01-18 12:00:00"),df1.parse("2020-04-19 12:00:00")));
-//		System.out.println(getNextWeekMonday(new Date()));
-
-		contents("2022-10-25 10:11:11","2022-10-25 11:11:11",new Date());
-	}
 }

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -5,6 +5,8 @@ import javax.servlet.Filter;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.logging.LogLevel;
+import org.springframework.boot.logging.LoggingSystem;
 import org.springframework.boot.web.servlet.FilterRegistrationBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
@@ -30,6 +32,9 @@ public class WebApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(WebApplication.class, args);
+
+        // 配置全局的日志记录器
+        configureGlobalLogger();
     }
 
     @Bean
@@ -55,4 +60,10 @@ public class WebApplication {
         return registration;
     }
 
+    private static void configureGlobalLogger() {
+        LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
+        // 设置业务日志记录器的日志级别为INFO
+        loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
+    }
+
 }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/PermissionCheckService.java

@@ -27,7 +27,7 @@ public class PermissionCheckService {
 		}
 
 		SysUser user = sysUserFeignService.queryUserInfo();
-		if(user.getTenantId() == -1 && user.getIsSuperAdmin()){
+		if(user.getIsSuperAdmin()){
 			return true;
 		}
 

+ 5 - 17
mec-web/src/main/java/com/ym/mec/web/controller/AppRedemptionCodeController.java

@@ -1,21 +1,16 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.AppRedemptionCode;
+import com.ym.mec.biz.service.AppRedemptionCodeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.ApiOperation;
-
-import javax.annotation.Resource;
-
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.AppRedemptionCode;
-import com.ym.mec.biz.service.AppRedemptionCodeService;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
+import javax.annotation.Resource;
 
 /**
  * 兑换码分配表(RedemptionCode)表控制层
@@ -32,19 +27,12 @@ public class AppRedemptionCodeController extends BaseController {
     @Resource
     private AppRedemptionCodeService appRedemptionCodeService;
 
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
     @ApiOperation(value = "分配url")
     @GetMapping(value = "allocation")
     public HttpResponseResult<AppRedemptionCode> allocation(@RequestParam("userId")Integer userId) throws Exception {
         if (userId == null) {
             throw new Exception("用户Id必须填写");
         }
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         return succeed(appRedemptionCodeService.allocation(userId));
     }
 

+ 3 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -18,6 +18,7 @@ import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -46,7 +47,7 @@ public class ClassGroupController extends BaseController {
     @Autowired
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private OrganizationService organizationService;
 
@@ -348,7 +349,7 @@ public class ClassGroupController extends BaseController {
 
     @GetMapping("queryUserInfo")
     public HttpResponseResult queryUserInfo(Integer userId) {
-        SysUser sysUser = sysUserFeignService.queryUserById(userId);
+        SysUser sysUser = sysUserService.queryUserById(userId);
         return succeed(sysUser.getUsername());
     }
 

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/CloudCoachPaymentProgramController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.entity.CloudCoachPaymentProgram;
 import com.ym.mec.biz.dal.page.CloudCoachPaymentProgramQueryInfo;
 import com.ym.mec.biz.service.CloudCoachPaymentProgramService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -23,7 +24,7 @@ public class CloudCoachPaymentProgramController extends BaseController {
     @Autowired
     private CloudCoachPaymentProgramService cloudCoachPaymentProgramService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private OrganizationService organizationService;
 
@@ -31,8 +32,7 @@ public class CloudCoachPaymentProgramController extends BaseController {
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('cloudCoachPaymentProgram/add')")
     public Object add(@RequestBody CloudCoachPaymentProgram cloudCoachPaymentProgram){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        cloudCoachPaymentProgram.setOperator(sysUser.getId());
+        cloudCoachPaymentProgram.setOperator(sysUserService.getUserId());
         cloudCoachPaymentProgramService.add(cloudCoachPaymentProgram);
         return succeed();
     }

+ 0 - 7
mec-web/src/main/java/com/ym/mec/web/controller/CloudTeacherOrderController.java

@@ -1,16 +1,13 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.entity.CloudTeacherStudent;
-import com.ym.mec.biz.dal.entity.TenantOrderRecord;
 import com.ym.mec.biz.dal.page.CloudTeacherAddQueryInfo;
 import com.ym.mec.biz.dal.page.CloudTeacherOrderQueryInfo;
 import com.ym.mec.biz.service.CloudTeacherOrderService;
 import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.TenantOrderRecordService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -34,10 +31,6 @@ public class CloudTeacherOrderController extends BaseController {
 
     @Autowired
     private CloudTeacherOrderService cloudTeacherOrderService;
-
-    @Autowired
-    private TenantOrderRecordService tenantOrderRecordService;
-
     @Autowired
     private OrganizationService organizationService;
 

+ 7 - 26
mec-web/src/main/java/com/ym/mec/web/controller/ContractsController.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -23,7 +24,7 @@ import com.ym.mec.common.controller.BaseController;
 public class ContractsController extends BaseController {
 
 	@Autowired
-	private SysUserFeignService sysUserFeignService;
+	private SysUserService sysUserService;
 
 	@Autowired
 	private ContractService contractService;
@@ -31,51 +32,31 @@ public class ContractsController extends BaseController {
 	@ApiOperation("查询注册协议")
 	@GetMapping(value = "queryRegisterContract")
 	public Object queryRegisterContract() {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		return succeed(contractService.queryRegisterContract(sysUser.getId()));
+		return succeed(contractService.queryRegisterContract(sysUserService.getUserId()));
 	}
 
 	@ApiOperation("查询商品协议")
 	@GetMapping(value = "queryGoodsContract")
 	public Object queryGoodsContract(String musicGroupId, String goodsIds, KitGroupPurchaseTypeEnum kitGroupPurchaseTypeEnum) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		return succeed(contractService.queryGoodsContract(sysUser.getId(), musicGroupId, goodsIds, kitGroupPurchaseTypeEnum));
+		return succeed(contractService.queryGoodsContract(sysUserService.getUserId(), musicGroupId, goodsIds, kitGroupPurchaseTypeEnum));
 	}
 
 	@ApiOperation("查询乐团课程协议")
 	@GetMapping(value = "queryMusicGroupCoursesContract")
 	public Object queryMusicGroupCoursesContract(String musicGroupId) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		return succeed(contractService.queryMusicGroupCoursesContract(sysUser.getId(), musicGroupId));
+		return succeed(contractService.queryMusicGroupCoursesContract(sysUserService.getUserId(), musicGroupId));
 	}
 
 	@ApiOperation("查询VIP课程协议")
 	@GetMapping(value = "queryVipGroupCoursesContract")
 	public Object queryVipGroupCoursesContract(Long vipGroupId) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		return succeed(contractService.queryVipGroupCoursesContract(sysUser.getId(), vipGroupId));
+		return succeed(contractService.queryVipGroupCoursesContract(sysUserService.getUserId(), vipGroupId));
 	}
 
 	@ApiOperation("查询陪练课课程协议")
 	@GetMapping(value = "queryPracticeCoursesContract")
 	public Object queryPracticeCoursesContract(int courseSectionNum, Date startDate, Date endDate, BigDecimal fee) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			return failed("获取用户信息失败");
-		}
-		return succeed(contractService.queryPracticeCoursesContract(sysUser.getId(), courseSectionNum, startDate, endDate, fee));
+		return succeed(contractService.queryPracticeCoursesContract(sysUserService.getUserId(), courseSectionNum, startDate, endDate, fee));
 	}
 
 	@PostMapping("transferProduceContract")

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/CooperationOrganController.java

@@ -74,8 +74,8 @@ public class CooperationOrganController extends BaseController {
     @ApiOperation(value = "根据机构编号获取合作单位(教学点)列表")
     @GetMapping("/queryByOrganId")
     @PreAuthorize("@pcs.hasPermissions('cooperationOrgan/queryByOrganId')")
-    public Object queryByOrganId(String organId) {
-        return succeed(cooperationOrganService.queryByOrganId(organId));
+    public Object queryByOrganId(String organId,Boolean enable) {
+        return succeed(cooperationOrganService.queryByOrganId(organId,enable));
     }
 
     @ApiOperation(value = "根据合作单位id获取学校缴费")

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/CourseReviewController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.page.CourseReviewQueryInfo;
 import com.ym.mec.biz.service.CourseReviewService;
 import com.ym.mec.biz.service.OrganizationService;
@@ -21,8 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
 public class CourseReviewController extends BaseController {
 
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private CourseReviewService courseReviewService;

+ 6 - 19
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
@@ -51,7 +50,7 @@ public class CourseScheduleController extends BaseController {
     @Autowired
     private CourseScheduleComplaintsService courseScheduleComplaintsService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private MusicGroupService musicGroupService;
     @Autowired
@@ -201,11 +200,7 @@ public class CourseScheduleController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/courseMerge','system')")
     @PostMapping(value = "/courseMerge",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public HttpResponseResult courseMerge(CourseMergeDto courseMergeInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        courseMergeInfo.setOperatorId(sysUser.getId());
+        courseMergeInfo.setOperatorId(sysUserService.getUserId());
         return courseScheduleService.courseMerge(courseMergeInfo);
     }
 
@@ -213,11 +208,7 @@ public class CourseScheduleController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/mergeCourseSplit','system')")
     @PostMapping(value = "/mergeCourseSplit",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public HttpResponseResult mergeCourseSplit(Long mainCourseId){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        courseScheduleService.mergeCourseSplit(mainCourseId, sysUser.getId());
+        courseScheduleService.mergeCourseSplit(mainCourseId, sysUserService.getUserId());
         return succeed();
     }
 
@@ -304,11 +295,11 @@ public class CourseScheduleController extends BaseController {
     		return failed("对应课程已做出调整");
     	}
     	
-    	SysUser user = sysUserFeignService.queryUserById(complaints.getUserId());
+    	SysUser user = sysUserService.queryUserById(complaints.getUserId());
     	complaints.getUser().setUsername(user.getUsername());
     	
     	CourseSchedule courseSchedule = courseScheduleService.get(complaints.getCourseScheduleId());
-    	SysUser teacher = sysUserFeignService.queryUserById(courseSchedule.getActualTeacherId());
+    	SysUser teacher = sysUserService.queryUserById(courseSchedule.getActualTeacherId());
     	courseSchedule.getTeacher().setUsername(teacher.getUsername());
     	
     	ModelMap model = new ModelMap();
@@ -366,11 +357,7 @@ public class CourseScheduleController extends BaseController {
     @PostMapping("/batchCourseAdjust")
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/batchCourseAdjust')")
     public Object batchCourseAdjust(@RequestBody BatchCourseAdjustDto batchCourseAdjustInfo){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        batchCourseAdjustInfo.setOperatorId(sysUser.getId());
+        batchCourseAdjustInfo.setOperatorId(sysUserService.getUserId());
         return courseScheduleService.batchCourseAdjust(batchCourseAdjustInfo);
     }
 

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
 import com.ym.mec.biz.dal.dto.TeacherAttendancesDto;
 import com.ym.mec.biz.dal.enums.TeacherSalaryConfirmStatus;
@@ -35,8 +33,6 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     @Autowired
     private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "分页查询教师薪酬列表")

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/DegreeController.java

@@ -3,7 +3,6 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.page.DegreeQueryInfo;
 import com.ym.mec.biz.service.DegreeRegistrationService;
-import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -22,14 +21,11 @@ public class DegreeController extends BaseController { ;
 
     @Autowired
     private DegreeRegistrationService degreeRegistrationService;
-    @Autowired
-    private OrganizationService organizationService;
 
     @ApiOperation(value = "查询收费列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('degree/queryPage')")
     public HttpResponseResult queryPage(DegreeQueryInfo queryInfo) {
-//        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setSort("create_time_");
         queryInfo.setOrder("DESC");
         return succeed(degreeRegistrationService.getPageList(queryInfo));

+ 40 - 58
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.EmployeeLevelDto;
@@ -10,10 +9,7 @@ import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
 import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.biz.dal.page.UserBasicQueryInfo;
-import com.ym.mec.biz.service.EmployeeService;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.StudentManageService;
-import com.ym.mec.biz.service.SysEmployeePositionService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -43,7 +39,7 @@ public class EmployeeController extends BaseController {
     @Autowired
     private EmployeeService employeeService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private StudentManageService studentManageService;
     @Autowired
@@ -73,10 +69,6 @@ public class EmployeeController extends BaseController {
     @GetMapping("/queryPlatformEmploy")
     @PreAuthorize("@pcs.hasPermissions('employee/queryPlatformEmploy')")
     public Object queryPlatformEmploy(EmployeeQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         queryInfo.setOrganId(null);
         queryInfo.setTenantId(-1);
         return succeed(employeeService.queryEmployByOrganId(queryInfo));
@@ -152,15 +144,12 @@ public class EmployeeController extends BaseController {
     @ApiOperation(value = "修改用户")
     @PostMapping("/updateUser")
     public HttpResponseResult update(SysUser sysUser) {
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if (user != null) {
-            Date date = new Date();
-            sysUser.setId(user.getId());
-            sysUser.setUpdateTime(date);
-            studentManageService.updateUser(sysUser);
-            return succeed();
-        }
-        return failed("获取用户失败");
+        SysUser user = sysUserService.getUser();
+        Date date = new Date();
+        sysUser.setId(user.getId());
+        sysUser.setUpdateTime(date);
+        studentManageService.updateUser(sysUser);
+        return succeed();
     }
 
     @ApiOperation(value = "获取所有员工")
@@ -173,52 +162,45 @@ public class EmployeeController extends BaseController {
     @ApiOperation(value = "获取用户信息")
     @GetMapping("/queryUserInfo")
     public HttpResponseResult apiQueryUserInfo() {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser != null && sysUser.getId() != null){
-            Employee employee = employeeService.get(sysUser.getId());
-            sysUser.setOrganName(organizationService.getOrganName(employee.getOrganIdList()));
-            sysUser.setRoles(employeeDao.queryUserRole(sysUser.getId()));
-            sysUser.setContactAddress(employee.getContactAddress());
-            sysUser.setPostalCode(employee.getPostalCode());
-            sysUser.setDeptId(employee.getDeptId());
-            sysUser.setDeptIds(employee.getDeptIds());
-            sysUser.setPostIds(employee.getPostIds());
-            sysUser.setBankCard(employee.getBankCard());
-            sysUser.setOpenBankAddress(employee.getOpenBankAddress());
-            sysUser.setPostDeptIds(employee.getPostDeptIds());
-            sysUser.setOrganIdList(employee.getOrganIdList());
-
-            // 默认初始密钥
-            int phoneStrLen = sysUser.getPhone().length();
-            String defaultPassword = "gym" + sysUser.getPhone().substring(phoneStrLen - 4, phoneStrLen);
-            // 密码重置标识
-            sysUser.setResetFlag(false);
-
-            String password = sysUser.getPassword();
-            if (StringUtils.isNotBlank(password)
-                    && (new BCryptPasswordEncoder().matches(ParamEnum.INIT_PASSWORD.getCode().toString(), password)
-                    || new BCryptPasswordEncoder().matches(defaultPassword, password))) {
-                sysUser.setResetFlag(true);
-            }
-            
-            List<SysEmployeePositionDto> sysEmployeePositionDtoList = sysEmployeePositionService.queryByUserId(sysUser.getId());
-            if(sysEmployeePositionDtoList != null && sysEmployeePositionDtoList.size() > 0){
-                sysUser.setPositions(StringUtils.join(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getRoleId).collect(Collectors.toSet()),","));
-                sysUser.setPositionName(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getPositionName).collect(Collectors.joining(",")));
-            }
-            return succeed(sysUser);
+        SysUser sysUser = sysUserService.getUser();
+        Employee employee = employeeService.get(sysUser.getId());
+        sysUser.setOrganName(organizationService.getOrganName(employee.getOrganIdList()));
+        sysUser.setRoles(employeeDao.queryUserRole(sysUser.getId()));
+        sysUser.setContactAddress(employee.getContactAddress());
+        sysUser.setPostalCode(employee.getPostalCode());
+        sysUser.setDeptId(employee.getDeptId());
+        sysUser.setDeptIds(employee.getDeptIds());
+        sysUser.setPostIds(employee.getPostIds());
+        sysUser.setBankCard(employee.getBankCard());
+        sysUser.setOpenBankAddress(employee.getOpenBankAddress());
+        sysUser.setPostDeptIds(employee.getPostDeptIds());
+        sysUser.setOrganIdList(employee.getOrganIdList());
+
+        // 默认初始密钥
+        int phoneStrLen = sysUser.getPhone().length();
+        String defaultPassword = "gym" + sysUser.getPhone().substring(phoneStrLen - 4, phoneStrLen);
+        // 密码重置标识
+        sysUser.setResetFlag(false);
+
+        String password = sysUser.getPassword();
+        if (StringUtils.isNotBlank(password)
+                && (new BCryptPasswordEncoder().matches(ParamEnum.INIT_PASSWORD.getCode().toString(), password)
+                || new BCryptPasswordEncoder().matches(defaultPassword, password))) {
+            sysUser.setResetFlag(true);
         }
-        return failed("获取用户信息失败");
+
+        List<SysEmployeePositionDto> sysEmployeePositionDtoList = sysEmployeePositionService.queryByUserId(sysUser.getId());
+        if(sysEmployeePositionDtoList != null && sysEmployeePositionDtoList.size() > 0){
+            sysUser.setPositions(StringUtils.join(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getRoleId).collect(Collectors.toSet()),","));
+            sysUser.setPositionName(sysEmployeePositionDtoList.stream().map(SysEmployeePositionDto :: getPositionName).collect(Collectors.joining(",")));
+        }
+        return succeed(sysUser);
     }
 
     @ApiOperation(value = "获取所选用户离职所需交接信息")
     @GetMapping("/levelDetail")
     @PreAuthorize("@pcs.hasPermissions('employee/levelDetail')")
     public HttpResponseResult levelDetail(Integer userId){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         return succeed(employeeService.levelDetail(userId));
     }
 

+ 1 - 7
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -58,8 +58,6 @@ public class ExportController extends BaseController {
     @Autowired
     private OrganizationService organizationService;
     @Autowired
-    private VipGroupDao vipGroupDao;
-    @Autowired
     private MusicGroupDao musicGroupDao;
     @Autowired
     private VipGroupService vipGroupService;
@@ -94,10 +92,6 @@ public class ExportController extends BaseController {
     @Autowired
     private CooperationOrganService cooperationOrganService;
     @Autowired
-    private StudentPaymentOrderDao studentPaymentOrderDao;
-    @Autowired
-    private StudentDao studentDao;
-    @Autowired
     private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
     @Autowired
     private TeacherService teacherService;
@@ -199,7 +193,7 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/exportMusicGroupCourseList')")
     public HttpResponseResult exportMusicGroupCourseList(ExportUserAccountQueryInfo queryInfo) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getOrganId(), sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(), queryInfo.getOrganId(), sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1));
         Integer i = musicGroupDao.countMusicGroupCourseList(queryInfo);
         if (Objects.isNull(i) || i <= 0) {
             throw new BizException("没有可导出的记录");

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/FinancialExpenditureController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.page.FinancialExpenditureQueryInfo;
 import com.ym.mec.biz.service.FinancialExpenditureService;
 import com.ym.mec.biz.service.OrganizationService;
@@ -23,8 +21,6 @@ public class FinancialExpenditureController extends BaseController {
     @Autowired
     private FinancialExpenditureService financialExpenditureService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "删除财务支出")

+ 12 - 33
mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -1,36 +1,27 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.GoodsCategory;
 import com.ym.mec.biz.dal.entity.GoodsProcurement;
-import com.ym.mec.biz.dal.enums.AccountType;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.GoodsQuery;
+import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.service.GoodsCategoryService;
-import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.exception.BizException;
+import com.ym.mec.biz.service.GoodsService;
+import com.ym.mec.biz.service.SysUserService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-import com.ym.mec.biz.dal.page.GoodsQueryInfo;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
+import java.util.Objects;
 
 @RequestMapping("goods")
 @Api(tags = "商品(教材、辅件)服务")
@@ -42,7 +33,7 @@ public class GoodsController extends BaseController {
     @Autowired
     private GoodsCategoryService goodsCategoryService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private EmployeeDao employeeDao;
 
@@ -50,11 +41,7 @@ public class GoodsController extends BaseController {
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('goods/add')")
     public Object add(Goods goods){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        goodsService.addGoods(goods,sysUser.getId());
+        goodsService.addGoods(goods,sysUserService.getUserId());
         return succeed();
     }
 
@@ -62,11 +49,7 @@ public class GoodsController extends BaseController {
     @PostMapping("/addGoodsProcurement")
     @PreAuthorize("@pcs.hasPermissions('goods/addGoodsProcurement')")
     public Object addGoodsProcurement(GoodsProcurement goodsProcurement){
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        goodsProcurement.setOperatorId(sysUser.getId());
+        goodsProcurement.setOperatorId(sysUserService.getUserId());
         goodsService.addGoodsProcurement(goodsProcurement);
         return succeed();
     }
@@ -118,11 +101,7 @@ public class GoodsController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('goods/queryPage')")
     public Object queryPage(GoodsQueryInfo queryInfo){
         queryInfo.setOrganId(null);
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        Employee employee = employeeDao.get(sysUser.getId());
+        Employee employee = employeeDao.get(sysUserService.getUserId());
         if (queryInfo.getStudentShowOrganId() == null &&
                 queryInfo.getEducationShowOrganId() == null &&
                 queryInfo.getCourseFeeShowOrganId() == null &&

+ 5 - 12
mec-web/src/main/java/com/ym/mec/web/controller/ImSendGroupMessageController.java

@@ -1,13 +1,12 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.ImGroup;
 import com.ym.mec.biz.dal.entity.ImSendGroupMessage;
 import com.ym.mec.biz.dal.page.ImGroupQueryInfo;
 import com.ym.mec.biz.dal.page.ImSendGroupMessageQueryInfo;
 import com.ym.mec.biz.service.ImGroupService;
 import com.ym.mec.biz.service.ImSendGroupMessageService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -33,15 +32,13 @@ public class ImSendGroupMessageController extends BaseController {
     @Autowired
     private ImGroupService imGroupService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
 
     @ApiOperation("获取群消息列表")
     @PostMapping(value = "/queryPage")
     @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryPage')")
     public HttpResponseResult<PageInfo<ImSendGroupMessage>> queryPage(ImSendGroupMessageQueryInfo queryInfo) throws Exception {
-        SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
-                orElseThrow(() -> new Exception("请登录"));
-        queryInfo.setSenderId(sysUser.getId().toString());
+        queryInfo.setSenderId(sysUserService.getUserId().toString());
         return succeed(imSendGroupMessageService.queryPage(queryInfo));
     }
 
@@ -91,9 +88,7 @@ public class ImSendGroupMessageController extends BaseController {
     @PostMapping(value = "/queryGroupPage")
     @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryGroupPage')")
     public HttpResponseResult<PageInfo<ImGroup>> queryGroupPage(ImGroupQueryInfo imGroupQueryInfo) throws Exception {
-        SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
-                orElseThrow(() -> new Exception("请登录"));
-        imGroupQueryInfo.setUserId(sysUser.getId());
+        imGroupQueryInfo.setUserId(sysUserService.getUserId());
         if(imGroupQueryInfo.getImSendGroupMessageId() != null){
             ImSendGroupMessage imSendGroupMessage = Optional.ofNullable(imSendGroupMessageService.get(imGroupQueryInfo.getImSendGroupMessageId())).
                     orElseThrow(()->new BizException("消息不存在"));
@@ -130,9 +125,7 @@ public class ImSendGroupMessageController extends BaseController {
     @PostMapping(value = "/queryGroupPage1")
     @PreAuthorize("@pcs.hasPermissions('imSendGroupMessage/queryGroupPage1')")
     public HttpResponseResult<PageInfo<ImGroup>> queryGroupPage1(ImGroupQueryInfo imGroupQueryInfo) throws Exception {
-        SysUser sysUser = Optional.ofNullable(sysUserFeignService.queryUserInfo()).
-                orElseThrow(() -> new Exception("请登录"));
-        imGroupQueryInfo.setUserId(sysUser.getId());
+        imGroupQueryInfo.setUserId(sysUserService.getUserId());
         if(imGroupQueryInfo.getImSendGroupMessageId() != null){
             ImSendGroupMessage imSendGroupMessage = Optional.ofNullable(imSendGroupMessageService.get(imGroupQueryInfo.getImSendGroupMessageId())).
                     orElseThrow(()->new BizException("消息不存在"));

+ 8 - 10
mec-web/src/main/java/com/ym/mec/web/controller/ImUserFriendController.java

@@ -1,15 +1,16 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.service.ImUserFriendService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 @RequestMapping("imUserFriend")
 @Api(tags = "IM通讯录")
@@ -20,7 +21,7 @@ public class ImUserFriendController extends BaseController {
 	private ImUserFriendService imUserFriendService;
 
 	@Autowired
-	private SysUserFeignService sysUserFeignService;
+	private SysUserService sysUserService;
 
 	@ApiOperation("添加好友")
 	@PostMapping(value = "/add")
@@ -28,16 +29,14 @@ public class ImUserFriendController extends BaseController {
 			@ApiImplicitParam(name = "nickname", value = "昵称", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
 	public Object addFriend(Integer friendUserId, String nickname, String memo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		return succeed(imUserFriendService.addFriend(sysUser.getId(),friendUserId,nickname,memo));
+		return succeed(imUserFriendService.addFriend(sysUserService.getUserId(),friendUserId,nickname,memo));
 	}
 
 	@ApiOperation("删除好友")
 	@PostMapping(value = "/del")
 	@ApiImplicitParams({ @ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
 	public Object quitGroup(Integer friendUserId) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		return succeed(imUserFriendService.deleteFriend(sysUser.getId(),friendUserId));
+		return succeed(imUserFriendService.deleteFriend(sysUserService.getUserId(),friendUserId));
 	}
 
 	@ApiOperation("修改昵称,备注")
@@ -46,7 +45,6 @@ public class ImUserFriendController extends BaseController {
 			@ApiImplicitParam(name = "nickname", value = "昵称", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
 	public Object updateFriend(Integer friendUserId, String nickname, String memo) {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		return succeed(imUserFriendService.updateFriendNickname(sysUser.getId(),friendUserId,nickname,memo));
+		return succeed(imUserFriendService.updateFriendNickname(sysUserService.getUserId(),friendUserId,nickname,memo));
 	}
 }

+ 3 - 13
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -1,6 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.DecimalMapDto;
@@ -10,9 +9,9 @@ import com.ym.mec.biz.dal.page.IndexDataQueryInfo;
 import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
 import com.ym.mec.biz.service.IndexBaseMonthDataService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.Api;
@@ -20,7 +19,6 @@ import io.swagger.annotations.ApiOperation;
 import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -47,7 +45,7 @@ public class IndexController extends BaseController {
 	@Autowired
 	private DemoGroupDao demoGroupDao;
 	@Autowired
-	private SysUserFeignService sysUserFeignService;
+	private SysUserService sysUserService;
 	@Autowired
 	private OrganizationService organizationService;
 	@Autowired
@@ -62,11 +60,6 @@ public class IndexController extends BaseController {
 	@ApiOperation(value = "获取首页数据")
 	@GetMapping("/index")
 	public Object index() {
-
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null || sysUser.getId() == null) {
-			return failed(HttpStatus.FORBIDDEN, "请登录");
-		}
 		String organId = organizationService.getEmployeeOrgan("");
 
 		Integer tenantId = TenantContextHolder.getTenantId();
@@ -118,10 +111,7 @@ public class IndexController extends BaseController {
 
 	@GetMapping("/hasIndexErrData")
 	public HttpResponseResult hasIndexErrData(String organId){
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if (sysUser == null) {
-			throw new BizException("用户信息获取失败");
-		}
+		SysUser sysUser = sysUserService.getUser();
 		RBucket<Map<String, Boolean>> bucket = redissonClient.getBucket("index:hasIndexErrData " + sysUser.getId());
 		Map<String, Boolean> map = bucket.get();
 		if(map == null || map.size() == 0){

+ 0 - 7
mec-web/src/main/java/com/ym/mec/web/controller/IndexErrDataRecordController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
 import com.ym.mec.biz.dal.dto.IndexErrorDataExportDto;
 import com.ym.mec.biz.dal.entity.InspectionItem;
@@ -18,16 +16,13 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
 import java.util.Date;
-import java.util.Map;
 
 /**
  * @Author Joburgess
@@ -39,8 +34,6 @@ import java.util.Map;
 public class IndexErrDataRecordController extends BaseController {
 
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private IndexErrDataRecordService indexErrDataRecordService;

+ 5 - 14
mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java

@@ -1,12 +1,12 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.InspectionService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -16,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 @Api(tags = "巡查任务")
@@ -27,20 +26,16 @@ public class InspectionController extends BaseController {
     private InspectionService inspectionService;
     @Autowired
     private OrganizationService organizationService;
-    @Resource
-    private SysUserFeignService sysUserFeignService;
     @Autowired
     private MusicGroupDao musicGroupDao;
+    @Autowired
+    private SysUserService sysUserService;
 
     @ApiOperation(value = "添加巡查任务")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('inspection/add')")
     public HttpResponseResult<List<Inspection>> add(@RequestBody List<Inspection> inspections) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        return succeed(inspectionService.add(inspections, sysUser.getId()));
+        return succeed(inspectionService.add(inspections, sysUserService.getUserId()));
     }
 
     @ApiOperation(value = "删除巡查任务")
@@ -54,11 +49,7 @@ public class InspectionController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('inspection/update')")
     public HttpResponseResult<Inspection> update(@RequestBody Inspection inspection) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        return succeed(inspectionService.updateInspection(inspection, sysUser.getId()));
+        return succeed(inspectionService.updateInspection(inspection, sysUserService.getUserId()));
     }
 
     @ApiOperation(value = "巡查任务列表")

+ 4 - 17
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java

@@ -1,29 +1,22 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
 import com.ym.mec.biz.service.InspectionItemService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import com.ym.mec.common.entity.Mapper;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-import java.util.*;
+import java.util.Date;
 
 @Api(tags = "巡查任务事项")
 @RequestMapping("inspectionItem")
@@ -33,17 +26,11 @@ public class InspectionItemController extends BaseController {
     private InspectionItemService inspectionItemService;
     @Autowired
     private OrganizationService organizationService;
-    @Resource
-    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "修改巡查任务事项")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('inspectionItem/update')")
     public HttpResponseResult<InspectionItem> update(InspectionItem inspectionItem) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         inspectionItem.setUpdateTime(new Date());
         inspectionItemService.update(inspectionItem);
         return succeed(inspectionItem);

+ 9 - 24
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java

@@ -1,29 +1,26 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.InspectionItemPlanService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -34,7 +31,7 @@ public class InspectionItemPlanController extends BaseController {
     @Autowired
     private InspectionItemPlanService inspectionItemPlanService;
     @Resource
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private OrganizationService organizationService;
     @Autowired
@@ -44,11 +41,7 @@ public class InspectionItemPlanController extends BaseController {
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/add')")
     public HttpResponseResult<InspectionItemPlan> add(InspectionItemPlan inspectionItemPlan) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        inspectionItemPlan.setOperatorUserId(sysUser.getId());
+        inspectionItemPlan.setOperatorUserId(sysUserService.getUserId());
         return succeed(inspectionItemPlanService.add(inspectionItemPlan));
     }
 
@@ -56,11 +49,7 @@ public class InspectionItemPlanController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/update')")
     public HttpResponseResult<InspectionItemPlan> update(InspectionItemPlan inspectionItemPlan) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        inspectionItemPlan.setOperatorUserId(sysUser.getId());
+        inspectionItemPlan.setOperatorUserId(sysUserService.getUserId());
         inspectionItemPlanService.updatePlan(inspectionItemPlan);
         return succeed(inspectionItemPlan);
     }
@@ -86,14 +75,10 @@ public class InspectionItemPlanController extends BaseController {
     @PostMapping("/updateMemo")
     @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/updateMemo')")
     public HttpResponseResult<InspectionItemPlan> updateMemo(Long id, String memo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
         InspectionItemPlan inspectionItemPlan = inspectionItemPlanService.get(id);
         inspectionItemPlan.setMemo(memo);
         inspectionItemPlan.setUpdateTime(new Date());
-        inspectionItemPlan.setOperatorUserId(sysUser.getId());
+        inspectionItemPlan.setOperatorUserId(sysUserService.getUserId());
         inspectionItemPlanService.update(inspectionItemPlan);
         return succeed(inspectionItemPlan);
     }

+ 3 - 11
mec-web/src/main/java/com/ym/mec/web/controller/ManagerDownloadController.java

@@ -1,13 +1,9 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.page.ManagerDownloadQueryInfo;
-import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
 import com.ym.mec.biz.service.ManagerDownloadService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,17 +21,13 @@ public class ManagerDownloadController extends BaseController {
     @Autowired
     private ManagerDownloadService managerDownloadService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
 
     @ApiOperation(value = "分页查询列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('managerDownload/queryPage')")
     public Object queryPage(ManagerDownloadQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        queryInfo.setUserId(sysUser.getId());
+        queryInfo.setUserId(sysUserService.getUserId());
         return succeed(managerDownloadService.queryPage(queryInfo));
     }
 

+ 4 - 19
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java

@@ -1,27 +1,20 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper;
 import com.ym.mec.biz.dal.page.MemberRankFeeQueryInfo;
 import com.ym.mec.biz.service.MemberRankOrganizationFeeMapperService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.collection.MapUtil;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 @RequestMapping("memberRankOrganizationFeeMapper")
@@ -32,7 +25,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @Autowired
     private MemberRankOrganizationFeeMapperService memberRankOrganizationFeeMapperService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private OrganizationService organizationService;
 
@@ -41,11 +34,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/add')")
     @AuditLogAnnotation(operateName = "新增系统功能类型")
     public Object add(@RequestBody MemberRankOrganizationFeeMapper memberRankOrganizationFeeMapper) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        memberRankOrganizationFeeMapper.setOperatorId(sysUser.getId());
+        memberRankOrganizationFeeMapper.setOperatorId(sysUserService.getUserId());
         memberRankOrganizationFeeMapperService.add(memberRankOrganizationFeeMapper);
         return succeed();
     }
@@ -54,11 +43,7 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/update')")
     public Object update(@RequestBody MemberRankOrganizationFeeMapper memberRankOrganizationFeeMapper) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        memberRankOrganizationFeeMapper.setOperatorId(sysUser.getId());
+        memberRankOrganizationFeeMapper.setOperatorId(sysUserService.getUserId());
         memberRankOrganizationFeeMapperService.updateFee(memberRankOrganizationFeeMapper);
         return succeed();
     }

+ 4 - 11
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankSettingController.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.MemberRankSetting;
 import com.ym.mec.biz.service.MemberRankSettingService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.QueryInfo;
@@ -24,18 +25,14 @@ public class MemberRankSettingController extends BaseController {
     @Autowired
     private MemberRankSettingService memberRankSettingService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
 
     @ApiOperation(value = "新增")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('memberRankSetting/add')")
     @AuditLogAnnotation(operateName = "新增会员等级")
     public Object add(@RequestBody MemberRankSetting memberRankSetting) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            throw new BizException("请登录");
-        }
-        memberRankSetting.setOperator(sysUser.getId());
+        memberRankSetting.setOperator(sysUserService.getUserId());
         memberRankSettingService.add(memberRankSetting);
         return succeed();
     }
@@ -52,11 +49,7 @@ public class MemberRankSettingController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('memberRankSetting/update')")
     public Object update(@RequestBody MemberRankSetting memberRankSetting) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
-            throw new BizException("请登录");
-        }
-        memberRankSetting.setOperator(sysUser.getId());
+        memberRankSetting.setOperator(sysUserService.getUserId());
         memberRankSettingService.updateSetting(memberRankSetting);
         return succeed();
     }

+ 38 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MultiDataSourceHomeStatsController.java

@@ -0,0 +1,38 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.dto.ActivityPlanAddDto;
+import com.ym.mec.biz.dal.wrapper.MultiDataSourceHomeStatsWrapper;
+import com.ym.mec.biz.service.ActivityPlanService;
+import com.ym.mec.biz.service.MultiDataSourceHomeStatsService;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "首页多数据源统计")
+@RequestMapping("multiDataSourceHomeStats")
+@RestController
+public class MultiDataSourceHomeStatsController extends BaseController {
+
+    @Autowired
+    private MultiDataSourceHomeStatsService multiDataSourceHomeStatsService;
+    @Autowired
+    private OrganizationService organizationService;
+
+    @ApiOperation(value = "收入统计")
+    @PostMapping("/summerIncome")
+    @PreAuthorize("@pcs.hasPermissions('multiDataSourceHomeStats/summerIncome')")
+    public HttpResponseResult<List<MultiDataSourceHomeStatsWrapper.summerIncome>> summerIncome(@RequestBody MultiDataSourceHomeStatsWrapper.QueryDto queryDto){
+        queryDto.setOrganIds(organizationService.getEmployeeOrgan(queryDto.getOrganIds()));
+        return succeed(multiDataSourceHomeStatsService.summerIncome(queryDto));
+    }
+}

+ 3 - 9
mec-web/src/main/java/com/ym/mec/web/controller/MusicEnlightenmentQuestionnaireController.java

@@ -1,18 +1,16 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicEnlightenmentQuestionnaireStatDto;
 import com.ym.mec.biz.dal.entity.MusicEnlightenmentQuestionnaire;
 import com.ym.mec.biz.dal.page.MusicEnlightenmentQuestionnaireQueryInfo;
 import com.ym.mec.biz.service.MusicEnlightenmentQuestionnaireService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -34,7 +32,7 @@ public class MusicEnlightenmentQuestionnaireController extends BaseController {
     @Autowired
     private MusicEnlightenmentQuestionnaireService musicEnlightenmentQuestionnaireService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
 
     @ApiOperation(value = "启蒙课问卷列表")
     @GetMapping("queryPage")
@@ -47,11 +45,7 @@ public class MusicEnlightenmentQuestionnaireController extends BaseController {
     @PostMapping("sendParentMeetingNotice")
     @PreAuthorize("@pcs.hasPermissions('musicEnlightenmentQuestionnaire/sendParentMeetingNotice')")
     public HttpResponseResult<Boolean> sendParentMeetingNotice(String musicGroupId, Date meetingDate, String address) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed(HttpStatus.FORBIDDEN, "用户信息获取失败");
-        }
-        return musicEnlightenmentQuestionnaireService.sendParentMeetingNotice(sysUser.getId(), musicGroupId, meetingDate, address) ? succeed() : failed();
+        return musicEnlightenmentQuestionnaireService.sendParentMeetingNotice(sysUserService.getUserId(), musicGroupId, meetingDate, address) ? succeed() : failed();
     }
 
     @ApiOperation(value = "启蒙课问卷统计")

+ 3 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentInstrumentController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
@@ -31,6 +32,8 @@ import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -62,7 +65,6 @@ public class StudentInstrumentController extends BaseController {
     @Autowired
     private StudentInstrumentDao studentInstrumentDao;
 
-
     @ApiOperation(value = "乐器保养列表")
     @GetMapping("/getList")
     //@PreAuthorize("@pcs.hasPermissions('studentInstrument/getList')")

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentStatisticsController.java

@@ -106,7 +106,7 @@ public class StudentStatisticsController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('studentStatistics/exportStudentSmallClassStatisticsSum')")
     public HttpResponseResult exportStudentSmallClassStatisticsSum(StudentStatisticsQueryInfo queryInfo) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()&&sysUser.getTenantId() == -1));
         int countStatistics = studentStatisticsService.countStatistics(queryInfo);
         if (countStatistics <= 0) {
             throw new BizException("没有可导出的记录");

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/school/SchoolMusicGroupQuitController.java

@@ -19,7 +19,7 @@ import java.util.List;
 @Slf4j
 @Validated
 @RestController
-@RequestMapping("/musicGroupQuit")
+@RequestMapping("/schoolMusicGroupQuit")
 @Api(tags = "学校学员退团服务")
 public class SchoolMusicGroupQuitController extends BaseController {