wuheng 1 year ago
commit
624c3ade17
100 changed files with 7035 additions and 0 deletions
  1. 6 0
      .gitignore
  2. 201 0
      LICENSE
  3. 89 0
      README.md
  4. 200 0
      pom.xml
  5. 173 0
      sfcc-admin/pom.xml
  6. 16 0
      sfcc-admin/src/main/java/com/sifu/sfcc/SfccAdminApplication.java
  7. 132 0
      sfcc-admin/src/main/java/com/sifu/sfcc/aspect/LogAspect.java
  8. 67 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/AdminUserDetails.java
  9. 8 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/BodyDto.java
  10. 8 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/DataDto.java
  11. 77 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/Lxfs.java
  12. 9 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/ResponseDto.java
  13. 78 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/SaveSMS.java
  14. 31 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/SendUrl.java
  15. 144 0
      sfcc-admin/src/main/java/com/sifu/sfcc/bo/WebLog.java
  16. 91 0
      sfcc-admin/src/main/java/com/sifu/sfcc/client/MyWebSocketClient.java
  17. 91 0
      sfcc-admin/src/main/java/com/sifu/sfcc/client/WebSocketLoginConfig.java
  18. 32 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/AdminExceptionHandler.java
  19. 34 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/GlobalCorsConfig.java
  20. 32 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/ImgConfig.java
  21. 15 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/MyBatisConfig.java
  22. 23 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/OssConfig.java
  23. 79 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/RabbitMqConfig.java
  24. 17 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/RestTemplateConfig.java
  25. 55 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/SfccSecurityConfig.java
  26. 80 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/Swagger2Config.java
  27. 14 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/WebSocketConfig.java
  28. 26 0
      sfcc-admin/src/main/java/com/sifu/sfcc/config/XmkScheduleConfig.java
  29. 139 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcArchivesController.java
  30. 84 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcCallTaskController.java
  31. 70 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcEnterpriseController.java
  32. 77 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcIVRController.java
  33. 171 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcKnowledgeController.java
  34. 109 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcLabelController.java
  35. 248 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDController.java
  36. 50 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDCoreQueryController.java
  37. 56 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDRSWebHookController.java
  38. 78 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDWebHookController.java
  39. 179 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNaireController.java
  40. 29 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcScoreController.java
  41. 66 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcSessionController.java
  42. 211 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcWorkOrderController.java
  43. 61 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/IndexController.java
  44. 253 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsAdminController.java
  45. 134 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsDeptController.java
  46. 134 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMemberController.java
  47. 69 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMemberLevelController.java
  48. 102 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMenuController.java
  49. 73 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsPermissionController.java
  50. 69 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsResourceCategoryController.java
  51. 97 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsResourceController.java
  52. 156 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsRoleController.java
  53. 62 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/XmkPolicyController.java
  54. 62 0
      sfcc-admin/src/main/java/com/sifu/sfcc/controller/XmkProjectController.java
  55. 14 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcArchivesContentDao.java
  56. 16 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcArchivesDao.java
  57. 10 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcCallTaskDao.java
  58. 12 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcKnowledgeDao.java
  59. 17 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNGDXmzxDao.java
  60. 18 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNGDZczxDao.java
  61. 21 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNaireDao.java
  62. 17 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcWorkOrderDao.java
  63. 21 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminDao.java
  64. 17 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminPermissionRelationDao.java
  65. 45 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminRoleRelationDao.java
  66. 61 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsDeptDao.java
  67. 14 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsMemberDao.java
  68. 30 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsRoleDao.java
  69. 23 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsRolePermissionRelationDao.java
  70. 18 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkKeywordDao.java
  71. 16 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkPolicyDao.java
  72. 26 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkProjectDao.java
  73. 21 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/AdminParam.java
  74. 55 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcApproveParam.java
  75. 202 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcArchivesExport.java
  76. 215 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcArchivesParam.java
  77. 183 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcCallTaskParam.java
  78. 32 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcDealerParam.java
  79. 133 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcNaireQuestionParam.java
  80. 57 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcScoreParam.java
  81. 32 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorderLabelParam.java
  82. 78 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorkOrderCount.java
  83. 196 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorkOrderParam.java
  84. 31 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/IndexParam.java
  85. 34 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/MinioUploadDto.java
  86. 29 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/PolicyParam.java
  87. 62 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/ProjectParam.java
  88. 43 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/SmsHomeAdvertiseParam.java
  89. 34 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsAdminLoginParam.java
  90. 34 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsAdminParam.java
  91. 40 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsCustomerServiceParam.java
  92. 17 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsMenuNode.java
  93. 20 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsPermissionNode.java
  94. 37 0
      sfcc-admin/src/main/java/com/sifu/sfcc/dto/UpdateAdminPasswordParam.java
  95. 70 0
      sfcc-admin/src/main/java/com/sifu/sfcc/entity/ws/MsgPackage.java
  96. 35 0
      sfcc-admin/src/main/java/com/sifu/sfcc/enums/ApproveStatusEnum.java
  97. 40 0
      sfcc-admin/src/main/java/com/sifu/sfcc/enums/QueueEnum.java
  98. 44 0
      sfcc-admin/src/main/java/com/sifu/sfcc/enums/WorderStatusEnum.java
  99. 35 0
      sfcc-admin/src/main/java/com/sifu/sfcc/enums/ws/MsgTypeEnum.java
  100. 163 0
      sfcc-admin/src/main/java/com/sifu/sfcc/service/CCWebSocket.java

+ 6 - 0
.gitignore

@@ -0,0 +1,6 @@
+*.idea
+*.iws
+*.iml
+*.ipr
+target
+*.class

+ 201 - 0
LICENSE

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [2018-2020] [commercezheng]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 89 - 0
README.md

@@ -0,0 +1,89 @@
+### 四福科技
+后端服务源码
+
+### 组织结构
+
+``` lua
+mall
+├── mall-common -- 工具类及通用代码
+├── mall-mbg -- MyBatisGenerator生成的数据库操作代码
+├── mall-security -- SpringSecurity封装公用模块
+├── mall-admin -- 后台人社管理系统接口
+├── mall-middle -- 中台人社管理系统接口
+├── mall-search -- 基于Elasticsearch的商品搜索系统
+├── mall-portal -- 前台人社系统接口
+└── mall-demo -- 框架搭建时的测试代码
+```
+
+### 技术选型
+
+#### 后端技术
+
+| 技术                 | 说明                | 官网                                                 |
+| -------------------- | ------------------- | ---------------------------------------------------- |
+| SpringBoot           | 容器+MVC框架        | https://spring.io/projects/spring-boot               |
+| SpringSecurity       | 认证和授权框架      | https://spring.io/projects/spring-security           |
+| MyBatis              | ORM框架             | http://www.mybatis.org/mybatis-3/zh/index.html       |
+| MyBatisGenerator     | 数据层代码生成      | http://www.mybatis.org/generator/index.html          |
+| PageHelper           | MyBatis物理分页插件 | http://git.oschina.net/free/Mybatis_PageHelper       |
+| Swagger-UI           | 文档生产工具        | https://github.com/swagger-api/swagger-ui            |
+| Hibernator-Validator | 验证框架            | http://hibernate.org/validator                       |
+| Elasticsearch        | 搜索引擎            | https://github.com/elastic/elasticsearch             |
+| RabbitMq             | 消息队列            | https://www.rabbitmq.com/                            |
+| Redis                | 分布式缓存          | https://redis.io/                                    |
+| MongoDb              | NoSql数据库         | https://www.mongodb.com                              |
+| Docker               | 应用容器引擎        | https://www.docker.com                               |
+| Druid                | 数据库连接池        | https://github.com/alibaba/druid                     |
+| OSS                  | 对象存储            | https://github.com/aliyun/aliyun-oss-java-sdk        |
+| MinIO                | 对象存储            | https://github.com/minio/minio                       |
+| JWT                  | JWT登录支持         | https://github.com/jwtk/jjwt                         |
+| LogStash             | 日志收集工具        | https://github.com/logstash/logstash-logback-encoder |
+| Lombok               | 简化对象封装工具    | https://github.com/rzwitserloot/lombok               |
+| Jenkins              | 自动化部署工具      | https://github.com/jenkinsci/jenkins                 |
+
+#### 前端技术
+
+| 技术       | 说明                  | 官网                                   |
+| ---------- | --------------------- | -------------------------------------- |
+| Vue        | 前端框架              | https://vuejs.org/                     |
+| Vue-router | 路由框架              | https://router.vuejs.org/              |
+| Vuex       | 全局状态管理框架      | https://vuex.vuejs.org/                |
+| Element    | 前端UI框架            | https://element.eleme.io               |
+| Axios      | 前端HTTP框架          | https://github.com/axios/axios         |
+| v-charts   | 基于Echarts的图表框架 | https://v-charts.js.org/               |
+| Js-cookie  | cookie管理工具        | https://github.com/js-cookie/js-cookie |
+| nprogress  | 进度条控件            | https://github.com/rstacruz/nprogress  |
+
+## 环境搭建
+
+### 开发工具
+
+| 工具          | 说明                | 官网                                            |
+| ------------- | ------------------- | ----------------------------------------------- |
+| IDEA          | 开发IDE             | https://www.jetbrains.com/idea/download         |
+| RedisDesktop  | redis客户端连接工具 | https://redisdesktop.com/download               |
+| Robomongo     | mongo客户端连接工具 | https://robomongo.org/download                  |
+| SwitchHosts   | 本地host管理        | https://oldj.github.io/SwitchHosts/             |
+| X-shell       | Linux远程连接工具   | http://www.netsarang.com/download/software.html |
+| Navicat       | 数据库连接工具      | http://www.formysql.com/xiazai.html             |
+| PowerDesigner | 数据库设计工具      | http://powerdesigner.de/                        |
+| Axure         | 原型设计工具        | https://www.axure.com/                          |
+| MindMaster    | 思维导图设计工具    | http://www.edrawsoft.cn/mindmaster              |
+| ScreenToGif   | gif录制工具         | https://www.screentogif.com/                    |
+| ProcessOn     | 流程图绘制工具      | https://www.processon.com/                      |
+| PicPick       | 图片处理工具        | https://picpick.app/zh/                         |
+| Snipaste      | 屏幕截图工具        | https://www.snipaste.com/                       |
+| Postman       | API接口调试工具      | https://www.postman.com/                        |
+| Typora        | Markdown编辑器      | https://typora.io/                              |
+
+### 开发环境
+
+| 工具          | 版本号 | 下载                                                         |
+| ------------- | ------ | ------------------------------------------------------------ |
+| JDK           | 1.8    | https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html |
+| Mysql         | 5.7    | https://www.mysql.com/                                       |
+| Redis         | 3.2    | https://redis.io/download                                    |
+| Elasticsearch | 6.2.2  | https://www.elastic.co/downloads                             |
+| MongoDb       | 3.2    | https://www.mongodb.com/download-center                      |
+| RabbitMq      | 3.7.14 | http://www.rabbitmq.com/download.html                        |
+| Nginx         | 1.10   | http://nginx.org/en/download.html                            |

+ 200 - 0
pom.xml

@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.sifu.sfcc</groupId>
+    <artifactId>sfcc</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>sfcc-common</module>
+        <module>sfcc-mbg</module>
+        <module>sfcc-security</module>
+        <module>sfcc-admin</module>
+        <module>sfcc-search</module>
+        <module>sfcc-fileupload</module>
+        <module>sfcc-task</module>
+    </modules>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.7.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <skipTests>true</skipTests>
+        <docker.host>http://39.105.160.25:2375</docker.host>
+        <docker.maven.plugin.version>1.1.0</docker.maven.plugin.version>
+        <pagehelper-starter.version>1.2.10</pagehelper-starter.version>
+        <pagehelper.version>5.1.8</pagehelper.version>
+        <druid.version>1.1.10</druid.version>
+        <hutool.version>4.5.7</hutool.version>
+        <swagger2.version>2.7.0</swagger2.version>
+        <mybatis-generator.version>1.3.7</mybatis-generator.version>
+        <mybatis.version>3.4.6</mybatis.version>
+        <mysql-connector.version>8.0.15</mysql-connector.version>
+        <spring-data-commons.version>2.1.5.RELEASE</spring-data-commons.version>
+        <jjwt.version>0.9.0</jjwt.version>
+        <aliyun-oss.version>2.5.0</aliyun-oss.version>
+        <logstash-logback.version>4.8</logstash-logback.version>
+        <minio.version>3.0.10</minio.version>
+        <sfcc-common.version>1.0-SNAPSHOT</sfcc-common.version>
+        <sfcc-mbg.version>1.0-SNAPSHOT</sfcc-mbg.version>
+        <sfcc-security.version>1.0-SNAPSHOT</sfcc-security.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.alipay.sdk/alipay-sdk-java -->
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>4.10.97.ALL</version>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.tencent.mm.opensdk</groupId>-->
+<!--            <artifactId>wechat-sdk-android-with-mta</artifactId>-->
+<!--            <version>5.4.0</version>-->
+<!--            <type>pom</type>-->
+<!--        </dependency>-->
+    </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <!--hrss通用模块-->
+            <dependency>
+                <groupId>com.sifu.sfcc</groupId>
+                <artifactId>sfcc-common</artifactId>
+                <version>${sfcc-common.version}</version>
+            </dependency>
+            <!--hrss中MBG生成模块-->
+            <dependency>
+                <groupId>com.sifu.sfcc</groupId>
+                <artifactId>sfcc-mbg</artifactId>
+                <version>${sfcc-mbg.version}</version>
+            </dependency>
+            <!--hrss安全模块-->
+            <dependency>
+                <groupId>com.sifu.sfcc</groupId>
+                <artifactId>sfcc-security</artifactId>
+                <version>${sfcc-security.version}</version>
+            </dependency>
+            <!--MyBatis分页插件starter-->
+            <dependency>
+                <groupId>com.github.pagehelper</groupId>
+                <artifactId>pagehelper-spring-boot-starter</artifactId>
+                <version>${pagehelper-starter.version}</version>
+            </dependency>
+            <!--MyBatis分页插件-->
+            <dependency>
+                <groupId>com.github.pagehelper</groupId>
+                <artifactId>pagehelper</artifactId>
+                <version>${pagehelper.version}</version>
+            </dependency>
+            <!--集成druid连接池-->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+            <!--Hutool Java工具包-->
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-all</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+            <!--Swagger-UI API文档生产工具-->
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger2</artifactId>
+                <version>${swagger2.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger-ui</artifactId>
+                <version>${swagger2.version}</version>
+            </dependency>
+            <!-- MyBatis 生成器 -->
+            <dependency>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-core</artifactId>
+                <version>${mybatis-generator.version}</version>
+            </dependency>
+            <!-- MyBatis-->
+            <dependency>
+                <groupId>org.mybatis</groupId>
+                <artifactId>mybatis</artifactId>
+                <version>${mybatis.version}</version>
+            </dependency>
+            <!--Mysql数据库驱动-->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql-connector.version}</version>
+            </dependency>
+            <!--SpringData工具包-->
+            <dependency>
+                <groupId>org.springframework.data</groupId>
+                <artifactId>spring-data-commons</artifactId>
+                <version>${spring-data-commons.version}</version>
+            </dependency>
+            <!--JWT(Json Web Token)登录支持-->
+            <dependency>
+                <groupId>io.jsonwebtoken</groupId>
+                <artifactId>jjwt</artifactId>
+                <version>${jjwt.version}</version>
+            </dependency>
+            <!-- 阿里云OSS -->
+            <dependency>
+                <groupId>com.aliyun.oss</groupId>
+                <artifactId>aliyun-sdk-oss</artifactId>
+                <version>${aliyun-oss.version}</version>
+            </dependency>
+            <!--集成logstash-->
+            <dependency>
+                <groupId>net.logstash.logback</groupId>
+                <artifactId>logstash-logback-encoder</artifactId>
+                <version>${logstash-logback.version}</version>
+            </dependency>
+            <!--MinIO JAVA SDK-->
+            <dependency>
+                <groupId>io.minio</groupId>
+                <artifactId>minio</artifactId>
+                <version>${minio.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>

+ 173 - 0
sfcc-admin/pom.xml

@@ -0,0 +1,173 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.sifu.sfcc</groupId>
+    <artifactId>sfcc-admin</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>sfcc-admin</name>
+    <description>sfcc-admin project for sfcc</description>
+
+    <parent>
+        <groupId>com.sifu.sfcc</groupId>
+        <artifactId>sfcc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.sifu.sfcc</groupId>
+            <artifactId>sfcc-mbg</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sifu.sfcc</groupId>
+            <artifactId>sfcc-common</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sifu.sfcc</groupId>
+            <artifactId>sfcc-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
+
+        <!--分页依赖包-->
+        <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>1.2.12</version>
+        </dependency>
+        <!--集成消息队列-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.minio</groupId>
+            <artifactId>minio</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>redis.clients</groupId>
+                    <artifactId>jedis</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>lettuce-core</artifactId>
+                    <groupId>io.lettuce</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+       </dependency>
+        <dependency>
+            <!-- websocket -->
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+        <dependency>
+            <!-- fastjson -->
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.47</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
+
+    </dependencies>
+    <build>
+
+        <resources>
+            <resource>
+                <directory>${project.basedir}/lib</directory>
+                <targetPath>BOOT-INF/lib/</targetPath>
+                <includes>
+                    <include>*.jar</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <targetPath>BOOT-INF/classes/</targetPath>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.*</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*.*</include>
+                </includes>
+            </resource>
+
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
+
+            </plugin>
+            <!--<plugin>-->
+            <!--<groupId>com.spotify</groupId>-->
+            <!--<artifactId>docker-maven-plugin</artifactId>-->
+            <!--<version>${docker.maven.plugin.version}</version>-->
+            <!--<executions>-->
+            <!--<execution>-->
+            <!--<id>build-image</id>-->
+            <!--<phase>package</phase>-->
+            <!--<goals>-->
+            <!--<goal>build</goal>-->
+            <!--</goals>-->
+            <!--</execution>-->
+            <!--</executions>-->
+            <!--<configuration>-->
+            <!--<imageName>sfcc/${project.artifactId}:${project.version}</imageName>-->
+            <!--<dockerHost>${docker.host}</dockerHost>-->
+            <!--<baseImage>java:8</baseImage>-->
+            <!--<entryPoint>["java", "-jar", "-Dspring.profiles.active=prod","/${project.build.finalName}.jar"]-->
+            <!--</entryPoint>-->
+            <!--<resources>-->
+            <!--<resource>-->
+            <!--<targetPath>/</targetPath>-->
+            <!--<directory>${project.build.directory}</directory>-->
+            <!--<include>${project.build.finalName}.jar</include>-->
+            <!--</resource>-->
+            <!--</resources>-->
+            <!--</configuration>-->
+            <!--</plugin>-->
+        </plugins>
+
+    </build>
+</project>

+ 16 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/SfccAdminApplication.java

@@ -0,0 +1,16 @@
+package com.sifu.sfcc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * 应用启动入口
+ * Created by commerce on 2018/4/26.
+ */
+@SpringBootApplication(scanBasePackages = "com.sifu.sfcc")
+public class SfccAdminApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(SfccAdminApplication.class, args);
+        
+    }
+}

+ 132 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/aspect/LogAspect.java

@@ -0,0 +1,132 @@
+package com.sifu.sfcc.aspect;
+
+import com.sifu.sfcc.common.annotation.CcOperateLog;
+import com.sifu.sfcc.common.exception.ApiException;
+import com.sifu.sfcc.mapper.CcOperateLogMapper;
+import com.sifu.sfcc.model.UmsAdmin;
+import com.sifu.sfcc.service.UmsAdminService;
+import io.swagger.annotations.ApiModelProperty;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.After;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Date;
+
+@Aspect
+@Component
+public class LogAspect {
+    @Autowired
+    private CcOperateLogMapper ccOperateLogMapper;
+
+    @Autowired
+    private UmsAdminService umsAdminService;
+
+    @Pointcut("@annotation(com.sifu.sfcc.common.annotation.CcOperateLog)")
+    public void pointcut() {
+    }
+
+    @Around("pointcut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
+        Object result = null;
+        long beginTime = System.currentTimeMillis();
+        try {
+            // 执行方法
+            result = point.proceed();
+        } catch (Throwable e) {
+            e.printStackTrace();
+            if(e instanceof ApiException){
+                throw  e;
+            }
+        } finally {
+            // 执行时长(毫秒)
+            long time = System.currentTimeMillis() - beginTime;
+
+            //保存日志
+            saveLog(point, time);
+        }
+
+        return result;
+    }
+
+    public void saveLog(ProceedingJoinPoint joinPoint, long time) throws IllegalAccessException {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        com.sifu.sfcc.model.CcOperateLog ccOperateLog = new com.sifu.sfcc.model.CcOperateLog();
+        //SysLog sysLog = new SysLog();
+        CcOperateLog logAnnotation = method.getAnnotation(CcOperateLog.class);
+
+        if (logAnnotation != null) {
+            // 注解上的描述
+            ccOperateLog.setModule(logAnnotation.moudule());
+            ccOperateLog.setOperateType(logAnnotation.type());
+            //ccOperateLog.setOperation(logAnnotation.value());
+        }
+        // 请求的方法名
+        //String className = joinPoint.getTarget().getClass().getName();
+        //String methodName = signature.getName();
+        UmsAdmin umsAdmin = umsAdminService.getCurrentUserAdmin();
+
+        ccOperateLog.setMemberId(umsAdmin.getId());
+        ccOperateLog.setMemberName(umsAdmin.getUsername());
+
+
+        // 请求的方法参数值
+
+        Object[] args = joinPoint.getArgs();
+        for (int j = 0; j < args.length; j++) {
+            if (!(args[j] instanceof HttpServletRequest) && !(args[j] instanceof HttpServletResponse)) {
+                Field[] fields = args[j].getClass().getDeclaredFields();
+                for (Field field : fields) {
+                    field.setAccessible(true);
+                    Object obj = field.get(args[j]);
+                    if (!ObjectUtils.isEmpty(obj)) {
+                        if (field.getName().equals("code")) {
+                            ccOperateLog.setRecordId((String) field.get(args[j]));
+                        }
+                        ApiModelProperty apiModelProperty = field.getAnnotation(ApiModelProperty.class);
+                        if (ObjectUtils.isEmpty(apiModelProperty)) {
+                            continue;
+                        }
+                        String old = StringUtils.isEmpty(ccOperateLog.getOperateContent()) ? "" : ccOperateLog.getOperateContent();
+                        ccOperateLog.setOperateContent(old.concat(apiModelProperty.value().concat(":").concat(obj.toString())));
+                    }
+
+                }
+            }
+        }
+
+        // 请求的方法参数名称
+//        LocalVariableTableParameterNameDiscoverer u = new LocalVariableTableParameterNameDiscoverer();
+//        String[] paramNames = u.getParameterNames(method);
+//        if (args != null && paramNames != null) {
+//            String params = "";
+//            for (int i = 0; i < args.length; i++) {
+//                params += "  " + paramNames[i] + ": " + args[i];
+//            }
+//            sysLog.setParams(params);
+//        }
+        // 获取request
+        //HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
+
+        // 设置IP地址
+        //sysLog.setIp(AddressUtils.getIpAddr(request));
+        //sysLog.setLocation(AddressUtils.getCityInfo(sysLog.getIp()));
+
+        //模拟一个用户名
+        ccOperateLog.setCreateTime(new Date());
+        ccOperateLogMapper.insertSelective(ccOperateLog);
+        //sysLogRepo.save(sysLog);
+    }
+
+}

+ 67 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/AdminUserDetails.java

@@ -0,0 +1,67 @@
+package com.sifu.sfcc.bo;
+
+import com.sifu.sfcc.model.UmsAdmin;
+import com.sifu.sfcc.model.UmsResource;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * SpringSecurity需要的用户详情
+ * Created by sifu on 2018/4/26.
+ */
+public class AdminUserDetails implements UserDetails {
+    private UmsAdmin umsAdmin;
+    private List<UmsResource> resourceList;
+
+    public AdminUserDetails(UmsAdmin umsAdmin, List<UmsResource> resourceList) {
+        this.umsAdmin = umsAdmin;
+        this.resourceList = resourceList;
+    }
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        //返回当前用户的角色
+        return resourceList.stream()
+                .map(role -> new SimpleGrantedAuthority(role.getId() + ":" + role.getName()))
+                .collect(Collectors.toList());
+    }
+
+    @Override
+    public String getPassword() {
+        return umsAdmin.getPassword();
+    }
+
+    @Override
+    public String getUsername() {
+        return umsAdmin.getUsername();
+    }
+
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isAccountNonLocked() {
+        return true;
+    }
+
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return umsAdmin.getStatus().equals(1);
+    }
+
+    public UmsAdmin getUmsAdmin() {
+        return umsAdmin;
+    }
+}

+ 8 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/BodyDto.java

@@ -0,0 +1,8 @@
+package com.sifu.sfcc.bo;
+
+import lombok.Data;
+
+@Data
+public class BodyDto {
+    private DataDto data;
+}

+ 8 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/DataDto.java

@@ -0,0 +1,8 @@
+package com.sifu.sfcc.bo;
+
+import lombok.Data;
+
+@Data
+public class DataDto {
+    private String sessionId;
+}

+ 77 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/Lxfs.java

@@ -0,0 +1,77 @@
+package com.sifu.sfcc.bo;
+
+public class Lxfs {
+    //责任单位联系人
+    private String xm_zrdwlxr;
+    //责任单位名称
+    private String xm_zrdwmc;
+    //项目编码
+    private String xm_xmbm;
+    //责任单位邮箱
+    private String xm_xmzrdwyx;
+    //项目名称
+    private String xm_xmmc;
+    //项目责任单位联系人电话
+    private String  xm_xmzrdwlxdh;
+
+
+    public String getXm_zrdwlxr() {
+        return xm_zrdwlxr;
+    }
+
+    public void setXm_zrdwlxr(String xm_zrdwlxr) {
+        this.xm_zrdwlxr = xm_zrdwlxr;
+    }
+
+    public String getXm_zrdwmc() {
+        return xm_zrdwmc;
+    }
+
+    public void setXm_zrdwmc(String xm_zrdwmc) {
+        this.xm_zrdwmc = xm_zrdwmc;
+    }
+
+    public String getXm_xmbm() {
+        return xm_xmbm;
+    }
+
+    public void setXm_xmbm(String xm_xmbm) {
+        this.xm_xmbm = xm_xmbm;
+    }
+
+    public String getXm_xmzrdwyx() {
+        return xm_xmzrdwyx;
+    }
+
+    public void setXm_xmzrdwyx(String xm_xmzrdwyx) {
+        this.xm_xmzrdwyx = xm_xmzrdwyx;
+    }
+
+    public String getXm_xmmc() {
+        return xm_xmmc;
+    }
+
+    public void setXm_xmmc(String xm_xmmc) {
+        this.xm_xmmc = xm_xmmc;
+    }
+
+    public String getXm_xmzrdwlxdh() {
+        return xm_xmzrdwlxdh;
+    }
+
+    public void setXm_xmzrdwlxdh(String xm_xmzrdwlxdh) {
+        this.xm_xmzrdwlxdh = xm_xmzrdwlxdh;
+    }
+
+    @Override
+    public String toString() {
+        return "Lxfs{" +
+                "xm_zrdwlxr='" + xm_zrdwlxr + '\'' +
+                ", xm_zrdwmc='" + xm_zrdwmc + '\'' +
+                ", xm_xmbm='" + xm_xmbm + '\'' +
+                ", xm_xmzrdwyx='" + xm_xmzrdwyx + '\'' +
+                ", xm_xmmc='" + xm_xmmc + '\'' +
+                ", xm_xmzrdwlxdh='" + xm_xmzrdwlxdh + '\'' +
+                '}';
+    }
+}

+ 9 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/ResponseDto.java

@@ -0,0 +1,9 @@
+package com.sifu.sfcc.bo;
+
+import lombok.Data;
+
+@Data
+public class ResponseDto {
+    private BodyDto body;
+
+}

+ 78 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/SaveSMS.java

@@ -0,0 +1,78 @@
+package com.sifu.sfcc.bo;
+
+import org.joda.time.DateTime;
+
+public class SaveSMS {
+    private Long id;
+
+    private String keyword;
+
+    private String type;
+
+    private String phone;
+
+    private String callId;
+
+    private DateTime createTime;
+
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getCallId() {
+        return callId;
+    }
+
+    public void setCallId(String callId) {
+        this.callId = callId;
+    }
+
+    public DateTime getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(DateTime createTime) {
+        this.createTime = createTime;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Override
+    public String toString() {
+        return "SaveSMS{" +
+                "id=" + id +
+                ", keyword='" + keyword + '\'' +
+                ", type='" + type + '\'' +
+                ", phone='" + phone + '\'' +
+                ", callId='" + callId + '\'' +
+                ", createTime=" + createTime +
+                '}';
+    }
+}

+ 31 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/SendUrl.java

@@ -0,0 +1,31 @@
+package com.sifu.sfcc.bo;
+
+public class SendUrl {
+
+    private String type;
+    private String keyword;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    @Override
+    public String toString() {
+        return "SendUrl{" +
+                "type='" + type + '\'' +
+                ", keyword='" + keyword + '\'' +
+                '}';
+    }
+}

+ 144 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/bo/WebLog.java

@@ -0,0 +1,144 @@
+package com.sifu.sfcc.bo;
+
+/**
+ * Controller层的日志封装类
+ * Created by commerce on 2018/4/26.
+ */
+public class WebLog {
+    /**
+     * 操作描述
+     */
+    private String description;
+
+    /**
+     * 操作用户
+     */
+    private String username;
+
+    /**
+     * 操作时间
+     */
+    private Long startTime;
+
+    /**
+     * 消耗时间
+     */
+    private Integer spendTime;
+
+    /**
+     * 根路径
+     */
+    private String basePath;
+
+    /**
+     * URI
+     */
+    private String uri;
+
+    /**
+     * URL
+     */
+    private String url;
+
+    /**
+     * 请求类型
+     */
+    private String method;
+
+    /**
+     * IP地址
+     */
+    private String ip;
+
+    private Object parameter;
+
+    private Object result;
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public Long getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Long startTime) {
+        this.startTime = startTime;
+    }
+
+    public Integer getSpendTime() {
+        return spendTime;
+    }
+
+    public void setSpendTime(Integer spendTime) {
+        this.spendTime = spendTime;
+    }
+
+    public String getBasePath() {
+        return basePath;
+    }
+
+    public void setBasePath(String basePath) {
+        this.basePath = basePath;
+    }
+
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public Object getParameter() {
+        return parameter;
+    }
+
+    public void setParameter(Object parameter) {
+        this.parameter = parameter;
+    }
+
+    public Object getResult() {
+        return result;
+    }
+
+    public void setResult(Object result) {
+        this.result = result;
+    }
+}

+ 91 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/client/MyWebSocketClient.java

@@ -0,0 +1,91 @@
+package com.sifu.sfcc.client;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.java_websocket.client.WebSocketClient;
+import org.java_websocket.enums.ReadyState;
+import org.java_websocket.handshake.ServerHandshake;
+
+import javax.annotation.PostConstruct;
+import java.net.URI;
+
+/**
+ * @author zhouyunfei
+ * @date 2022/12/14 11:11
+ */
+@Slf4j
+public class MyWebSocketClient extends WebSocketClient {
+    public MyWebSocketClient(URI uri) {
+        super(uri);
+    }
+
+    @PostConstruct
+    private void init() {
+        try {
+            log.info("进入初始化方法");
+            this.connectBlocking();
+            //开启心跳重连线程
+            new Thread(() -> {
+                while (true) {
+                    try {
+                        //当连接状态不为open时每5秒重连一次
+                        if (getReadyState() != ReadyState.OPEN) {
+                            log.info("发起重新连接请求");
+                            reconnectBlocking();
+                            Thread.sleep(5 * 1000);
+                        }
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }).start();
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public void onOpen(ServerHandshake serverHandshake) {
+        heartCheck();
+        log.info("与云服务器成功建立WS连接");
+        if (getReadyState() == ReadyState.OPEN) {
+            log.info("....发送一个心跳.....");
+            JSONObject json = new JSONObject();
+            json.put("thisDN", "10000_5007");
+            json.put("type","login");
+            JSONObject message = new JSONObject();
+            message.put("messageId", 100);
+            message.put("thisDN", "10000_5007");
+            message.put("extension", "1004");
+            message.put("thisQueues", "[\"10000_8002\"]");
+            message.put("attachDatas", "{\"typeCode\":\"20\"}");
+            json.put("message", message);
+            log.info("入参" + json);
+            send(json.toString());
+        }
+    }
+
+    @Override
+    public void onMessage(String s) {
+        heartCheck();
+        log.info("-------- 接收到服务端数据: " + s + "--------");
+        //send("....发送一个心跳.....");
+    }
+
+    @Override
+    public void onClose(int code, String reason, boolean remote) {
+        log.warn("readyState:" + getReadyState() + "," + code + "-reason:" + reason + ",与云服务器断开了连接,尝试重连...");
+    }
+
+    @Override
+    public void onError(Exception e) {
+        log.error("webSocket发生异常: {}:{}", e.getClass().getName(), e.getMessage());
+        close();
+    }
+
+    public void heartCheck() {
+        if (getReadyState() == ReadyState.OPEN) {
+            log.info("....发送一个心跳.....");
+        }
+    }
+}

+ 91 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/client/WebSocketLoginConfig.java

@@ -0,0 +1,91 @@
+package com.sifu.sfcc.client;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.java_websocket.client.WebSocketClient;
+import org.java_websocket.enums.ReadyState;
+import org.java_websocket.handshake.ServerHandshake;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.net.URI;
+
+/**
+ * @author zhouyunfei
+ * @date 2022/12/14 11:14
+ */
+//暂时关闭
+//@Configuration
+@Slf4j
+public class WebSocketLoginConfig {
+    /**
+     * 后端模拟websocket客户端
+     *
+     * @return MyWebSocketClient
+     */
+    @Bean
+    public static MyWebSocketClient myWebSocketClient() {
+        String wsUrl = "ws://192.168.38.11:8097/websocket";
+        URI uri = URI.create(wsUrl);
+        return new MyWebSocketClient(uri);
+    }
+
+    public static void main(String[] args) {
+        //myWebSocketClient();
+        try {
+            String url = "ws://111.40.37.223:8097/websocket";
+            URI uri = new URI(url);
+            WebSocketClient mWs = new WebSocketClient(uri){
+                @Override
+                public void onOpen(ServerHandshake serverHandshake) {
+                    heartCheck();
+                    log.info("与云服务器成功建立WS连接");
+                }
+
+                @Override
+                public void onMessage(String s) {
+                    heartCheck();
+                    log.info("-------- 接收到服务端数据: " + s + "--------");
+                    send("发送一个心跳成功");
+                }
+
+                @Override
+                public void onClose(int code, String reason, boolean remote) {
+                    log.warn("readyState:" + getReadyState() + "," + code + "-reason:" + reason + ",与云服务器断开了连接,尝试重连...");
+                }
+
+                @Override
+                public void onError(Exception e) {
+                    log.error("webSocket发生异常: {}:{}", e.getClass().getName(), e.getMessage());
+                    close();
+                }
+
+                public void heartCheck() {
+                    if (getReadyState() == ReadyState.OPEN) {
+                        send("....发送一个心跳.....");
+                    }
+                }
+            };
+            mWs.connect();
+            while (!mWs.getReadyState().equals(ReadyState.OPEN)) {
+                log.info("连接中...");
+            }
+            JSONObject json = new JSONObject();
+            json.put("thisDN", "10000_5007");
+            json.put("type","login");
+            JSONObject message = new JSONObject();
+            message.put("messageId", 100);
+            message.put("thisDN", "10000_5007");
+            message.put("extension", "1004");
+            message.put("thisQueues", "10000_8002");
+            message.put("attachDatas", "{\"typeCode\":\"20\"}");
+            json.put("message", message);
+            log.info("入参" + json);
+            mWs.send(json.toString());
+            System.out.println("haha");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 32 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/AdminExceptionHandler.java

@@ -0,0 +1,32 @@
+package com.sifu.sfcc.config;
+
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.common.exception.ApiException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * 全局异常处理
+ * Created by commerce on 2020/2/27.
+ */
+@RestControllerAdvice
+public class AdminExceptionHandler {
+    AdminExceptionHandler(){
+        System.out.println("xxx");
+    }
+
+
+    @ResponseBody
+    @ExceptionHandler(value = ApiException.class)
+    public CommonResult handle(ApiException e) {
+        if (e.getErrorCode() != null) {
+            return CommonResult.failed(e.getErrorCode());
+        }
+        return CommonResult.failed(e.getMessage());
+    }
+    @ExceptionHandler(value = Exception.class)
+    public CommonResult  handleException(Exception e){
+        return CommonResult.failed(e.getMessage());
+    }
+}

+ 34 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/GlobalCorsConfig.java

@@ -0,0 +1,34 @@
+package com.sifu.sfcc.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+ * 全局跨域配置
+ * Created by cc on 2019/7/27.
+ */
+@Configuration
+public class GlobalCorsConfig {
+
+    /**
+     * 允许跨域调用的过滤器
+     */
+    @Bean
+    public CorsFilter corsFilter() {
+        CorsConfiguration config = new CorsConfiguration();
+        //允许所有域名进行跨域调用
+        config.addAllowedOrigin("*");
+        //允许跨越发送cookie
+        config.setAllowCredentials(true);
+        //放行全部原始头信息
+        config.addAllowedHeader("*");
+        //允许所有请求方法跨域调用
+        config.addAllowedMethod("*");
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        source.registerCorsConfiguration("/**", config);
+        return new CorsFilter(source);
+    }
+}

+ 32 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/ImgConfig.java

@@ -0,0 +1,32 @@
+package com.sifu.sfcc.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+/**
+ * @date 2020.06.06
+ */
+@Configuration
+public class ImgConfig extends WebMvcConfigurerAdapter {
+
+    /**
+     * hostname:/image/AA/BB/abc.abc 可以访问此module的 classpath:/images/upload/AA/BBabc.abc
+     * hostname:/upload/AA/BB/abc.abc 可以访问此project主目录的 /upload/AA/BB/abc.abc
+     * <p>
+     * 这里采用第二种方式
+     *
+     * @param registry
+     */
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+//            registry.addResourceHandler("/image/**").
+//                    addResourceLocations(ResourceUtils.FILE_URL_PREFIX + ResourceUtils.getURL("classpath:")
+//                            .getPath() + "images" + File.separator + "upload" + File.separator);
+        registry.addResourceHandler("/uploads/**").
+                addResourceLocations(ResourceUtils.FILE_URL_PREFIX + System.getProperty("user.dir") + "/"
+                        + "uploads" + "/");
+
+    }
+}

+ 15 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/MyBatisConfig.java

@@ -0,0 +1,15 @@
+package com.sifu.sfcc.config;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * MyBatis配置类
+ * Created by cc on 2019/4/8.
+ */
+@Configuration
+@EnableTransactionManagement
+@MapperScan({"com.sifu.sfcc.mapper","com.sifu.sfcc.dao"})
+public class MyBatisConfig {
+}

+ 23 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/OssConfig.java

@@ -0,0 +1,23 @@
+package com.sifu.sfcc.config;
+
+import com.aliyun.oss.OSSClient;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * Created by cc on 2018/5/17.
+ */
+@Configuration
+public class OssConfig {
+    @Value("${aliyun.oss.endpoint}")
+    private String ALIYUN_OSS_ENDPOINT;
+    @Value("${aliyun.oss.accessKeyId}")
+    private String ALIYUN_OSS_ACCESSKEYID;
+    @Value("${aliyun.oss.accessKeySecret}")
+    private String ALIYUN_OSS_ACCESSKEYSECRET;
+    @Bean
+    public OSSClient ossClient(){
+        return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
+    }
+}

+ 79 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/RabbitMqConfig.java

@@ -0,0 +1,79 @@
+package com.sifu.sfcc.config;
+
+import com.sifu.sfcc.enums.QueueEnum;
+import org.springframework.amqp.core.*;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 消息队列配置
+ * Created by cc on 2018/9/14.
+ */
+@Configuration
+public class RabbitMqConfig {
+
+    /**
+     * 商品拼团时间实际消费队列所绑定的交换机
+     */
+    @Bean
+    DirectExchange groupDirect() {
+        return (DirectExchange) ExchangeBuilder
+                .directExchange(QueueEnum.QUEUE_GROUP_CLOSE.getExchange())
+                .durable(true)
+                .build();
+    }
+
+    /**
+     * 商品拼团时间延迟队列所绑定的交换机
+     */
+    @Bean
+    DirectExchange groupTtlDirect() {
+        return (DirectExchange) ExchangeBuilder
+                .directExchange(QueueEnum.QUEUE_TTL_GROUP_CLOSE.getExchange())
+                .durable(true)
+                .build();
+    }
+
+    /**
+     * 商品拼团时间实际消费队列
+     */
+    @Bean
+    public Queue groupQueue() {
+        return new Queue(QueueEnum.QUEUE_GROUP_CLOSE.getName());
+    }
+
+    /**
+     * 商品拼团时间延迟队列(死信队列)
+     */
+    @Bean
+    public Queue groupTtlQueue() {
+        return QueueBuilder
+                .durable(QueueEnum.QUEUE_TTL_GROUP_CLOSE.getName())
+                .withArgument("x-dead-letter-exchange", QueueEnum.QUEUE_GROUP_CLOSE.getExchange())//到期后转发的交换机
+                .withArgument("x-dead-letter-routing-key", QueueEnum.QUEUE_GROUP_CLOSE.getRouteKey())//到期后转发的路由键
+                .build();
+    }
+
+    /**
+     * 将商品拼团时间队列绑定到交换机
+     */
+    @Bean
+    Binding groupBinding(DirectExchange groupDirect, Queue groupQueue){
+        return BindingBuilder
+                .bind(groupQueue)
+                .to(groupDirect)
+                .with(QueueEnum.QUEUE_GROUP_CLOSE.getRouteKey());
+    }
+
+    /**
+     * 将商品拼团时间延迟队列绑定到交换机
+     */
+    @Bean
+    Binding groupTtlBinding(DirectExchange groupTtlDirect,Queue groupTtlQueue){
+        return BindingBuilder
+                .bind(groupTtlQueue)
+                .to(groupTtlDirect)
+                .with(QueueEnum.QUEUE_TTL_GROUP_CLOSE.getRouteKey());
+    }
+
+}

+ 17 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/RestTemplateConfig.java

@@ -0,0 +1,17 @@
+package com.sifu.sfcc.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * RestTemplate的配置
+ * Created by cc
+ */
+@Configuration
+public class RestTemplateConfig {
+    @Bean
+    public RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+}

+ 55 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/SfccSecurityConfig.java

@@ -0,0 +1,55 @@
+package com.sifu.sfcc.config;
+
+
+import com.sifu.sfcc.model.UmsResource;
+import com.sifu.sfcc.security.component.DynamicSecurityService;
+import com.sifu.sfcc.security.config.SecurityConfig;
+import com.sifu.sfcc.service.UmsAdminService;
+import com.sifu.sfcc.service.UmsResourceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.core.userdetails.UserDetailsService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * sfcc-security模块相关配置
+ * Created by sifu on 2019/11/9.
+ */
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class SfccSecurityConfig extends SecurityConfig {
+
+    @Autowired
+    private UmsAdminService adminService;
+    @Autowired
+    private UmsResourceService resourceService;
+
+    @Bean
+    public UserDetailsService userDetailsService() {
+        //获取登录用户信息
+        return username -> adminService.loadUserByUsername(username);
+    }
+
+    @Bean
+    public DynamicSecurityService dynamicSecurityService() {
+        return new DynamicSecurityService() {
+            @Override
+            public Map<String, ConfigAttribute> loadDataSource() {
+                Map<String, ConfigAttribute> map = new ConcurrentHashMap<>();
+                List<UmsResource> resourceList = resourceService.listAll();
+                for (UmsResource resource : resourceList) {
+                    map.put(resource.getUrl(), new org.springframework.security.access.SecurityConfig(resource.getId() + ":" + resource.getName()));
+                }
+                return map;
+            }
+        };
+    }
+}

+ 80 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/Swagger2Config.java

@@ -0,0 +1,80 @@
+package com.sifu.sfcc.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Swagger2API文档的配置
+ * Created by sifu on 2018/4/26.
+ */
+@Configuration
+@EnableSwagger2
+public class Swagger2Config {
+    @Bean
+    public Docket createRestApi(){
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.sifu.sfcc.controller"))
+                .paths(PathSelectors.any())
+                .build()
+                .securitySchemes(securitySchemes())
+                .securityContexts(securityContexts());
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("sfcc后台系统")
+                .description("sfcc后台模块")
+                .contact("sifu")
+                .version("1.0")
+                .build();
+    }
+
+    private List<ApiKey> securitySchemes() {
+        //设置请求头信息
+        List<ApiKey> result = new ArrayList<>();
+        ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
+        result.add(apiKey);
+        return result;
+    }
+
+    private List<SecurityContext> securityContexts() {
+        //设置需要登录认证的路径
+        List<SecurityContext> result = new ArrayList<>();
+        result.add(getContextByPath("/brand/.*"));
+        result.add(getContextByPath("/product/.*"));
+        result.add(getContextByPath("/productCategory/.*"));
+        return result;
+    }
+
+    private SecurityContext getContextByPath(String pathRegex){
+        return SecurityContext.builder()
+                .securityReferences(defaultAuth())
+                .forPaths(PathSelectors.regex(pathRegex))
+                .build();
+    }
+
+    private List<SecurityReference> defaultAuth() {
+        List<SecurityReference> result = new ArrayList<>();
+        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
+        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+        authorizationScopes[0] = authorizationScope;
+        result.add(new SecurityReference("Authorization", authorizationScopes));
+        return result;
+    }
+}

+ 14 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/WebSocketConfig.java

@@ -0,0 +1,14 @@
+package com.sifu.sfcc.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.socket.server.standard.ServerEndpointExporter;
+
+@Configuration
+public class WebSocketConfig {
+
+    @Bean
+    public ServerEndpointExporter serverEndpointExporter() {
+        return new ServerEndpointExporter();
+    }
+}

+ 26 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/config/XmkScheduleConfig.java

@@ -0,0 +1,26 @@
+package com.sifu.sfcc.config;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import java.util.*;
+
+@Configuration //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling // 2.开启定时任务
+public class XmkScheduleConfig {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(XmkScheduleConfig.class);
+
+    //3.添加定时任务(每七天定时执行一次)
+    @Scheduled(cron = "0 1 */7 * * ?")
+    private void configureTasks() {
+        LOGGER.info("----configureTasks----" );
+
+
+    }
+
+
+}

+ 139 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcArchivesController.java

@@ -0,0 +1,139 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcArchives;
+import com.sifu.sfcc.model.CcArchivesContent;
+import com.sifu.sfcc.service.CcArchivesContentService;
+import com.sifu.sfcc.service.CcArchivesService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcArchivesController", description = "档案")
+@RequestMapping("/archives")
+public class CcArchivesController  {
+
+    @Autowired
+    CcArchivesService archivesService;
+    
+    @Autowired
+    CcArchivesContentService contentService;
+    
+    @ApiOperation(value = "添加档案")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcArchives archives){
+        int rows = archivesService.add(archives);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改档案")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody CcArchives archives){
+        int rows = archivesService.update(archives);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "删除档案")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = archivesService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "合并档案内容")
+    @PostMapping(value = "/updateBatch")
+    public CommonResult updateBatch(@RequestBody List<CcArchivesContent> content){
+        int rows = contentService.updateBatch(content);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个档案")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(archivesService.get(id));
+    }
+    
+    @ApiOperation(value = "根据code获取某个档案")
+    @GetMapping(value = "/getArchives/{code}")
+    public CommonResult getArchives(@PathVariable String code){
+        return CommonResult.success(archivesService.getArchives(code));
+    }
+    
+    @ApiOperation(value = "获取档案")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+    						@ApiParam("编号") @RequestParam(value = "code" , required = false) String code ,
+    						@ApiParam("紧迫性") @RequestParam(value = "urgency" , required = false) String urgency ,
+    						@ApiParam("名称或编号") @RequestParam(value = "nameOrUrgency" , required = false) String nameOrUrgency ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(archivesService.list(name ,code,urgency, nameOrUrgency,pageSize ,pageNum)));
+    }
+    
+    @ApiOperation(value = "根据客户电话查询档案")
+    @GetMapping(value = "/getArchivesByPhone")
+    public CommonResult getArchivesByPhone(@ApiParam("客户电话") @RequestParam(value = "phone") String phone){
+        return CommonResult.success(archivesService.getArchivesByPhone(phone));
+    }
+    
+    @ApiOperation(value = "添加档案内容")
+    @PostMapping(value = "/addContent")
+    public CommonResult addContent(@RequestBody CcArchivesContent content){
+        int rows = contentService.add(content);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation("档案导出")
+  	@PostMapping("/export")
+      public CommonResult export(@ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+				@ApiParam("编号") @RequestParam(value = "code" , required = false) String code ,
+				@ApiParam("紧迫性") @RequestParam(value = "urgency" , required = false) String urgency ,
+				@ApiParam("名称或编号") @RequestParam(value = "nameOrUrgency" , required = false) String nameOrUrgency ) {
+    	
+          return CommonResult.success(archivesService.export(name,code,urgency,nameOrUrgency) , "成功");
+
+      }
+    
+    @ApiOperation(value = "获取档案总量")
+    @RequestMapping(value = "/total", method = RequestMethod.POST)
+    public CommonResult list() {
+    	return CommonResult.success(archivesService.total());
+    }
+    
+    @ApiOperation(value = "通过固定标签筛选档案,返回每天的档案数量")
+    @RequestMapping(value = "/getArchivesCount", method = RequestMethod.POST)
+    public CommonResult getArchivesCount(
+    		@ApiParam("标签") @RequestParam(value = "label") String label ,
+			@ApiParam("开始时间") @RequestParam(value = "startTime") String startTime ,
+			@ApiParam("结束时间") @RequestParam(value = "endTime") String endTime) {
+    	return CommonResult.success(archivesService.getArchivesCount(label,startTime,endTime));
+    }
+    
+    
+
+}

+ 84 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcCallTaskController.java

@@ -0,0 +1,84 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcCallTask;
+import com.sifu.sfcc.service.CcCallTaskService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcCallTaskController", description = "外呼任务")
+@RequestMapping("/task")
+public class CcCallTaskController  {
+
+    @Autowired
+    CcCallTaskService taskService;
+    
+    @ApiOperation(value = "添加外呼任务")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcCallTask naire){
+        int rows = taskService.add(naire);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改外呼任务")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody CcCallTask naire){
+        int rows = taskService.update(naire);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "修改外呼任务状态")
+    @PostMapping(value = "/updateStatus")
+    public CommonResult updateStatus(@RequestBody CcCallTask naire){
+        int rows = taskService.updateStatus(naire);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed("有其他正在进行的任务,请先关闭任务");
+        }
+    }
+
+    @ApiOperation(value = "删除外呼任务")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = taskService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个外呼任务")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(taskService.get(id));
+    }
+    
+    @ApiOperation(value = "获取外呼任务列表")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("title") @RequestParam(value = "title" , required = false) String title ,
+    						@ApiParam("状态") @RequestParam(value = "status",required = false) String status ,
+    						@ApiParam("开始时间") @RequestParam(value = "startTime",required = false) String startTime ,
+    						@ApiParam("结束时间") @RequestParam(value = "endTime",required = false) String endTime ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(taskService.list(title ,status,startTime, endTime, pageSize ,pageNum)));
+    }
+}

+ 70 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcEnterpriseController.java

@@ -0,0 +1,70 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcEnterprise;
+import com.sifu.sfcc.service.CcEnterpriseService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcEnterpriseController", description = "企业信息")
+@RequestMapping("/enterprise")
+public class CcEnterpriseController  {
+
+    @Autowired
+    CcEnterpriseService enterpriseService;
+
+    @ApiOperation(value = "添加企业信息")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcEnterprise enterprise){
+        int rows = enterpriseService.add(enterprise);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改企业信息")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody CcEnterprise enterprise){
+        int rows = enterpriseService.update(enterprise);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除企业信息")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = enterpriseService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个企业信息")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(enterpriseService.get(id));
+    }
+    
+    @ApiOperation(value = "获取企业信息")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(enterpriseService.list(name , pageSize ,pageNum)));
+    }
+
+
+}

+ 77 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcIVRController.java

@@ -0,0 +1,77 @@
+package com.sifu.sfcc.controller;
+
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.api.client.json.Json;
+import com.sifu.sfcc.bo.ResponseDto;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.service.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.xml.soap.Text;
+
+/**
+ * @Author 逄博
+ * @Function  webHook接口
+ * @Date 2022.01.07
+ */
+
+@RestController
+@Api(tags = "CcIVRController", description = "IVR相关接口应用")
+@CrossOrigin
+@RequestMapping(value = "/ngd/ivr")
+public class CcIVRController {
+    Logger log = LoggerFactory.getLogger(CcIVRController.class);
+
+    @Autowired
+    private CcNGDService ccNGDService;
+
+    @ApiOperation(value = "注册挂机事件")
+    @PostMapping(value = "/hangUp")
+    public CommonResult hangUp(@RequestBody String ivr){
+        JSONObject jsonObject = JSONObject.parseObject(ivr);
+
+        //JSONObject attachDatas = JSON.parseObject(jsonObject.get("attachDatas").toString()).getJSONObject("ivr_dtmf_digit").getJSONObject("response").getJSONObject("body").getJSONObject("data");
+        JSONObject attachDatasJson = JSON.parseObject(jsonObject.get("attachDatas").toString());
+
+
+//        System.out.println("挂机事件进入");
+        System.out.println("ivr==========="+ivr+"===============");
+
+
+//        String campaignId = ivr.substring(ivr.indexOf("\\\\\\\"campaign_id\\\\\\\":\\\\\\\"")+24, ivr.indexOf("\\\\\\\"}"));
+        String ivr_dtmf_digit = attachDatasJson.get("ivr_dtmf_digit").toString();
+//        System.out.println("ivr_dtmf_digit = " + ivr_dtmf_digit);
+
+        int startIndex = ivr_dtmf_digit.indexOf("\"sessionid\":\"");
+
+//        System.out.println("startIndex = " + startIndex);
+
+        String substring = ivr_dtmf_digit.substring(startIndex);
+
+        String s2 = substring.substring(0, substring.indexOf(","));
+
+//        System.out.println(s2);
+
+
+        JSONObject j2 = JSONObject.parseObject("{" + s2 + "}");
+
+//        System.out.println(j2.toString());
+        String sessionId = j2.getString("sessionid");//ivr_dtmf_digit.substring(ivr_dtmf_digit.indexOf("\"sessionid\":\""), ivr_dtmf_digit.indexOf("\""));
+        System.out.println("挂机事件进入:"+sessionId);
+//        log.info("ivr:{}", JSON.toJSONString(ivr));
+//        log.info("ivr:{}", JSON.toJSONString(ivr));
+//
+        String result = ccNGDService.NGDSendSms(sessionId);
+        System.out.println("挂机事件发送短信:");
+        if("OK".equals(result)) return CommonResult.success("存储成功");
+        else return CommonResult.failed();
+
+    }
+}

+ 171 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcKnowledgeController.java

@@ -0,0 +1,171 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.read.metadata.ReadSheet;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcKnowledge;
+import com.sifu.sfcc.service.CcKnowledgeService;
+import com.sifu.sfcc.util.KnowledgeDataListener;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcKnowledgeController", description = "知识库")
+@RequestMapping("/knowledge")
+public class CcKnowledgeController  {
+
+	private static final String template = "template.xlsx";
+	
+    @Autowired
+    CcKnowledgeService knowledgeService;
+    
+    @Autowired
+    KnowledgeDataListener kdl;
+
+    @ApiOperation(value = "添加知识库")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcKnowledge knowledge){
+        int rows = knowledgeService.add(knowledge);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改知识库")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody CcKnowledge knowledge){
+        int rows = knowledgeService.update(knowledge);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除知识库")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = knowledgeService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个知识库")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(knowledgeService.get(id));
+    }
+    
+    @ApiOperation(value = "获取知识库")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("问题") @RequestParam(value = "question" , required = false) String question ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(knowledgeService.list(question , pageSize ,pageNum)));
+    }
+
+
+    
+    @ApiOperation("批量导出")
+	@PostMapping("/export")
+    public CommonResult export(@RequestBody CcKnowledge param) {
+
+		String templateFileName = "/uploads/sfcc/template.xlsx";
+		
+//		String templateFileName = FileUtil.getUploadResource(template);
+		
+//    	String templateFileName = this.getClass().getResource("").getPath()+"/template.xlsx";
+    
+		String fileName = "/uploads/sfcc/知识库.xlsx";
+		ExcelWriter excelWriter = EasyExcel.write(fileName).withTemplate(templateFileName).build();
+	    WriteSheet writeSheet = EasyExcel.writerSheet().build();
+//        //获取表格内容
+        List<CcKnowledge> kl=knowledgeService.list(param.getQuestion());
+        
+        excelWriter.fill(kl, writeSheet);
+        // 千万别忘记关闭流
+        excelWriter.finish();
+        
+        return CommonResult.success(fileName , "成功");
+
+    }
+    
+    @ApiOperation("下载导入模板")
+   	@PostMapping("/exportTemplate")
+    public CommonResult exportTemplate() {
+//        String templateFileName = FileUtil.getUploadResource(template);
+        String templateFileName = "uploads/sfcc/知识库模板.xlsx";
+		//String templateFileName = "uploads/sfcc/template.xlsx";
+	    return CommonResult.success(templateFileName , "成功");
+    }
+    
+
+    @ApiOperation("批量导入")
+   	@PostMapping("/import")
+    public CommonResult simpleRead(@RequestParam("fileName")String fileName) {
+//    	 String fileName ="/Users/wuying/work/water/demo.xlsx";
+    	
+    	//解决老版本excel格式问题,复制一份新的xlsx文件
+    	String fix = fileName.substring(fileName.lastIndexOf("."));
+    	if(fix.equals(".xls")) {
+    		File source = new File(fileName);
+        	File dest = new File(fileName + "x");
+        	try {
+				FileUtils.copyFile(source, dest);
+				fileName = fileName + "x";
+			} catch (IOException e) {
+				return CommonResult.failed("请根据模板上传数据");
+			}
+    	}  	
+    	
+    	if(fileName.lastIndexOf(".") == -1 || (!fix.equals(".xlsx") && !fix.equals(".xls"))){
+           return CommonResult.failed("请根据模板上传数据");
+        }
+         // 一个文件一个reader
+         ExcelReader excelReader = null;
+         try{
+             excelReader = EasyExcel.read(fileName, CcKnowledge.class, kdl).build();
+             // 构建一个sheet 这里可以指定名字或者no
+             ReadSheet readSheet = EasyExcel.readSheet(0).build();
+             // 读取一个sheet
+             excelReader.read(readSheet);
+         }catch(Exception e){
+        	 return CommonResult.failed("请根据模板上传数据");
+         }finally {
+        	 
+             if (excelReader != null) {
+                 // 这里千万别忘记关闭,读的时候会创建临时文件,到时磁盘会崩的
+                 excelReader.finish();
+                 
+             }
+         }
+         return CommonResult.success(null , "成功");
+    }
+    
+    @ApiOperation(value = "获取知识库总量")
+    @RequestMapping(value = "/total", method = RequestMethod.POST)
+    public CommonResult list() {
+    	return CommonResult.success(knowledgeService.total());
+    }
+    
+
+}

+ 109 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcLabelController.java

@@ -0,0 +1,109 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcLabel;
+import com.sifu.sfcc.service.CcLabelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcLabelController", description = "标签")
+@RequestMapping("/label")
+public class CcLabelController  {
+
+    @Autowired
+    CcLabelService labelService;
+
+    @ApiOperation(value = "添加标签")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcLabel label){
+    	
+    	if("".equals(label.getName()) || null == label.getName()) {
+    		return CommonResult.failed("标签名称不能为空");
+    	}
+    	
+    	if(null != label.getName() && label.getName().length() > 255) {
+    		return CommonResult.failed("标签名称字数不超过255个字符");
+    	}
+    	if(null != label.getPos() && label.getPos().length() > 255) {
+    		return CommonResult.failed("标签位置字数不超过255个字符");
+    	}
+        int rows = labelService.add(label);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改标签")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody CcLabel label){
+        int rows = labelService.update(label);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除标签")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = labelService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "批量删除标签")
+    @RequestMapping(value = "/batchDelete", method = RequestMethod.POST)
+    public CommonResult batchDelete(@RequestParam("ids") List<Long> ids){
+    
+        int rows = labelService.batchDelete(ids);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "关闭和显示用户")
+    @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
+    public CommonResult updateStatus(@PathVariable Long id , @ApiParam("是否显示 : 0 - 显示  1 - 不显示 ") @RequestParam Integer status){
+    
+        int rows = labelService.updateStatus(id,status);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个标签")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(labelService.get(id));
+    }
+    
+    @ApiOperation(value = "获取标签")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+    						@ApiParam("是否显示 : 0 - 显示  1 - 不显示 ") @RequestParam(value = "status" , defaultValue = "2") Integer status ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(labelService.list(name ,status, pageSize ,pageNum)));
+    }
+
+
+}

+ 248 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDController.java

@@ -0,0 +1,248 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.mapper.CcCallTaskMapper;
+import com.sifu.sfcc.model.CcCallTask;
+import com.sifu.sfcc.model.CcCallTaskExample;
+import com.sifu.sfcc.model.CcNaireAnswer;
+import com.sifu.sfcc.security.service.RedisService;
+import com.sifu.sfcc.service.CcCallTaskService;
+import com.sifu.sfcc.service.CcNGDService;
+import com.sifu.sfcc.service.CcNaireService;
+import com.sifu.sfcc.service.XmkPolicyService;
+import com.sifu.sfcc.service.XmkProjectService;
+import com.sifu.sfcc.service.XmkTelsService;
+import com.sifu.sfcc.util.HttpClientUtil;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcNGDController", description = "NGD相关接口应用")
+@RequestMapping("/ngd")
+public class CcNGDController {
+    Logger log = LoggerFactory.getLogger(CcNGDController.class);
+
+
+    @Autowired
+    CcNGDService ccNGDService;
+    
+    @Autowired
+    XmkProjectService projectService;
+    
+    @Autowired
+    XmkTelsService telService;
+    
+    @Autowired
+    XmkPolicyService policyService;
+    
+    @Autowired
+    CcNaireService naireService;
+    
+    @Autowired
+    CcCallTaskService taskService;
+    
+    @Autowired
+    CcCallTaskMapper taskMapper;
+
+    @ApiOperation(value = "处理字符串接口")
+    @PostMapping(value = "/dealMobile")
+    public CommonResult dealMobile(@ApiParam("要处理的字符串") @RequestParam(value = "ngdStr") String ngdStr,
+                            @ApiParam("电话号重复次数,默认不重复") @RequestParam(value = "count" , required = false , defaultValue = "1") Integer count){
+        return CommonResult.success(ccNGDService.dealMobile(ngdStr , count));
+    }
+    
+    @ApiOperation(value = "发送短信接口")
+    @PostMapping(value = "/sendUrl")
+    public CommonResult sendUrl(@ApiParam("电话号") @RequestParam(value = "mobile") String mobile,
+    		                    @ApiParam("类型") @RequestParam(value = "type") String type,
+    		                    @ApiParam("关键字") @RequestParam(value = "keyword") String keyword){
+    	String result = ccNGDService.sendSms(mobile,type, keyword);
+    	if("OK".equals(result)) {
+    		return CommonResult.success(result);
+    	}else {
+    		return CommonResult.failed(result);
+    	}
+    }
+
+    @ApiOperation(value = "存储当前会话问提内容")
+    @PostMapping(value = "/saveQ")
+    public CommonResult saveQ(@ApiParam("电话号") @RequestParam(value = "mobile") String mobile,
+                                @ApiParam("类型") @RequestParam(value = "type") String type,
+                                @ApiParam("关键字") @RequestParam(value = "keyword") String keyword,
+                                @ApiParam("campaignId") @RequestParam(value = "campaignId") String campaignId){
+
+        int result = ccNGDService.saveQ(mobile,type, keyword,campaignId);
+        if(result > 0) {
+            return CommonResult.success("存储成功");
+        } else {
+            return CommonResult.failed();
+        }
+
+    }
+
+    @ApiOperation(value = "前端搜索接口发短信")
+    @PostMapping(value = "/getSendInfo")
+    public CommonResult getSendInfo(@ApiParam("类型") @RequestParam(value = "type" , required = false , defaultValue = "4") String type){
+
+        List list = ccNGDService.getSendInfo(type);
+        if(list.size() >= 0) {
+            return CommonResult.success(list,"查询成功");
+        } else {
+            return CommonResult.failed();
+        }
+
+    }
+
+
+    @ApiOperation(value = "NGD批量发送短信接口")
+    @PostMapping(value = "/NGDSendSms")
+    public CommonResult NGDSendSms(@RequestBody String ivr){
+        log.info("ivr参数:{}",JSON.toJSONString(ivr));
+        System.out.println(ivr);
+        String sessionId = "8888888";
+        String result = ccNGDService.NGDSendSms(sessionId);
+        if("OK".equals(result)) return CommonResult.success("存储成功");
+        else return CommonResult.failed();
+
+    }
+    
+    @ApiOperation(value = "查询某地有多少个项目信息")
+    @PostMapping(value = "/getCountByLocation")
+    public CommonResult getCountByLocation(@ApiParam("地区") @RequestParam(value = "location") String location){
+    	return CommonResult.success(projectService.getCountByLocation(location));
+    }
+    
+    @ApiOperation(value = "根据地区查询推荐项目类型")
+    @PostMapping(value = "/getRecommendType")
+    public CommonResult getRecommendType(@ApiParam("地区") @RequestParam(value = "location") String location,
+    		 @ApiParam("返回个数默认5") @RequestParam(value = "pageNum" , required = false , defaultValue = "5") Integer pageNum){
+    	
+    	return CommonResult.success(projectService.getRecommendType(location,pageNum));
+    }
+    
+    @ApiOperation(value = "根据某地和项目类型,查询出项目总数")
+    @PostMapping(value = "/getTotal")
+    public CommonResult getTotal(@ApiParam("地区") @RequestParam(value = "location") String location){
+    	
+    	return CommonResult.success(projectService.getTotal(location));
+    }
+
+    @ApiOperation(value = "根据地点查询推荐项目名称。")
+    @PostMapping(value = "/getRecommend")
+    public CommonResult getRecommend(@ApiParam("地区") @RequestParam(value = "location") String location,
+    		@ApiParam("返回个数默认2") @RequestParam(value = "pageNum" , required = false , defaultValue = "2") Integer pageNum){
+    	
+    	return CommonResult.success(projectService.getRecommend(location,pageNum));
+    }
+    
+    @ApiOperation(value = "根据项目名称查地区")
+    @PostMapping(value = "/getLocation")
+    public CommonResult getLocation(@ApiParam("name") @RequestParam(value = "name") String name,
+    		@ApiParam("返回个数默认2") @RequestParam(value = "pageNum" , required = false , defaultValue = "5") Integer pageNum){
+    	
+    	return CommonResult.success(projectService.getLocation(name,pageNum));
+    }
+    
+    @ApiOperation(value = "根据某地,查询出电话")
+    @PostMapping(value = "/getTel")
+    public CommonResult getTel(@ApiParam("地区") @RequestParam(value = "location") String location){
+    	return CommonResult.success(telService.getTels(location));
+    }
+
+    @ApiOperation(value = "根据某地市局,查询出信息")
+    @PostMapping(value = "/getTelsByCompany")
+    public CommonResult getTelsByCompany(@ApiParam("地市局") @RequestParam(value = "company") String company){
+        return CommonResult.success(telService.getTelsByCompany(company));
+    }
+    
+    @ApiOperation(value = "查询某地有多少个政策信息")
+    @PostMapping(value = "/getPolicyCount")
+    public CommonResult getPolicyCount(@ApiParam("地区") @RequestParam(value = "location") String location){
+    	return CommonResult.success(policyService.getPolicyCount(location));
+    }
+    
+    @ApiOperation(value = "根据地区查询推荐政策")
+    @PostMapping(value = "/getPolicyRecommend")
+    public CommonResult getPolicyRecommend(@ApiParam("地区") @RequestParam(value = "location") String location,
+    		 @ApiParam("返回个数默认5") @RequestParam(value = "pageNum" , required = false , defaultValue = "5") Integer pageNum){
+    	
+    	return CommonResult.success(policyService.getPolicyRecommend(location,pageNum));
+    }
+    
+    //获取欢迎语 和  第一个问题
+    @ApiOperation(value = "问卷系统,返回开头语和第一个问题")
+    @PostMapping(value = "/getQuestion")
+    public CommonResult getQuestion(@ApiParam("phone") @RequestParam(value = "phone") String phone){
+    	return CommonResult.success(naireService.getQuestion(phone));
+    }
+    
+    
+    //获取问题,如果是最后一个问题,给出标识和结束语
+    @ApiOperation(value = "问卷系统,返回问题和结束语")
+    @PostMapping(value = "/getNextQuestion")
+    public CommonResult getNextQuestion(@ApiParam("phone") @RequestParam(value = "phone") String phone,
+    		@ApiParam("问题id") @RequestParam(value = "id") String id,
+    		@ApiParam("问题type") @RequestParam(value = "type") String type,
+    		@ApiParam("回答答案") @RequestParam(value = "answer") String answer,
+    		@ApiParam("是否") @RequestParam(value = "isNo") String isNo){
+    	return CommonResult.success(naireService.getNextQuestion(phone,id,type,answer,isNo));
+    }
+    
+    //获取问题,如果是最后一个问题,给出标识和结束语
+    @ApiOperation(value = "发布任务测试接口")
+    @PostMapping(value = "/test")
+    public CommonResult test(@ApiParam("phone") @RequestParam(value = "phone") String phone){	
+    		
+    		CcCallTaskExample example = new CcCallTaskExample();
+    		taskMapper.deleteByExample(example);
+    		
+    		CcCallTask task = new CcCallTask();
+    		task.setIvrId(4);
+    		task.setTitle("测试");
+    		task.setNaireId(16L);
+    		task.setMaxRingTime("60");
+    		task.setFilter(phone);
+    		task.setStatus(1);
+    		task.setCreatedBy(13L);
+    		task.setAgent("10000_50000");
+    		task.setCreatedTime(new Date());
+    		taskMapper.insertSelective(task);
+    		
+	    	String filter = phone;
+			String str = "{\"name\":\"测试\",\"agent\":\"10000_50000\",\"tenantId\":\"10000\",\"isVgc\":\"1\",\"maxRingTime\":\"60\",\"callType\":1,\"ivrId\":\"4\",\"actionID\":\"\"}";
+	    	String result = HttpClientUtil.postX("http://123.56.85.102:8098/6.0.x/config/addOutboundInstance", str);
+	    	JSONObject res= JSON.parseObject(result);
+	    	int code = res.getIntValue("code");
+	    	String id = "";
+	    	if(code == 200) {
+	    		JSONObject data = res.getJSONObject("data");
+	        	id = data.getString("id");
+	        	
+	        	String append = "{\"outboundId\":\""+ id +"  \",\"filter\":\""+ filter +"\",\"actionID\":\"\"}";
+	        	String appendResult = HttpClientUtil.postX("http://123.56.85.102:8098/6.0.x/config/appendOutboundInstance", append);
+	        	JSONObject appRes= JSON.parseObject(appendResult);
+	        	int appCode = appRes.getIntValue("code");
+	        	if(appCode == 200) {
+	        		 String start = "{\"outboundId\":\""+ id +"\",\"tenantId\":\"10000\",\"dialMode\":\"1\"}";
+	                 HttpClientUtil.httpPostHeadWithJSON("http://123.56.85.102:8099/config/StartOutbound", start,null);
+	        	}
+    	}
+    	return CommonResult.success("1");
+    }
+    
+    
+    
+}

+ 50 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDCoreQueryController.java

@@ -0,0 +1,50 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sifu.sfcc.service.*;
+import com.sifu.sfcc.util.SendHttpNLP;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author 逄博
+ * @Function  webHook接口
+ * @Date 2022.01.07
+ */
+@RestController
+@Api(tags = "CcCoreQueryController", description = "NGD会话中控")
+@CrossOrigin
+@RequestMapping(value = "/ngd")
+public class CcNGDCoreQueryController {
+
+    @Autowired
+    private CcNGDXmzxService xmService;
+
+    private String sessionId;
+
+    @ApiOperation(value = "会话中控")
+    @PostMapping(value = "/query")
+    public Object coreQuery(@RequestParam("queryText") String queryText) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("queryText",queryText);
+        jsonObject.put("sessionId",sessionId);
+        String post = SendHttpNLP.sendHttpQuery(String.valueOf(jsonObject));
+        return post;
+    }
+
+    @ApiOperation(value = "开始")
+    @PostMapping(value = "/start")
+    public Object start() {
+        Map<String, String> startParams = new HashMap<>();
+        startParams.put("type","welcome");
+        String startRes = SendHttpNLP.sendHttpStart(startParams);
+        JSONObject start = JSONObject.parseObject(startRes);
+        sessionId = start.getJSONObject("data").getString("sessionId");
+        return startRes;
+    }
+
+}

+ 56 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDRSWebHookController.java

@@ -0,0 +1,56 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.sifu.sfcc.config.XmkScheduleConfig;
+import com.sifu.sfcc.util.NGDObjectToJson;
+import com.sifu.sfcc.util.WebHookResult;
+import io.swagger.annotations.Api;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @Author 逄博
+ * @Function  人社一体机webHook接口
+ * @Date 2022.01.07
+ */
+@RestController
+@Api(tags = "CcNGDRSWebHookController", description = "人社一体机webHook相关接口应用")
+@CrossOrigin
+@RequestMapping(value = "/ngd/rsWebHook")
+public class CcNGDRSWebHookController {
+
+    private static final Logger log = LoggerFactory.getLogger(CcNGDRSWebHookController.class);
+
+    @PostMapping("/webHook")
+    public Object webHook(@RequestBody String webHook) {
+        log.info("webHook传入参数:{}", JSON.toJSONString(webHook));
+        //获取出入的context和action名称跟据action名称判断进入哪个条件分支决策树
+        JSONObject webHookJson = JSONObject.parseObject(webHook);
+        JSONObject context = webHookJson.getJSONObject("context");
+        String action = webHookJson.getString("action");
+        String session_id = webHookJson.getString("session_id");
+
+        //识别人社业务的标识 1-银行卡 2-社保卡
+        if ("tag".equals(action)) {
+            System.out.println(context);
+            int res = 1;
+            if(res > 0){
+                return WebHookResult.success(new JSONObject(), "办理成功!");
+            } else{
+                return WebHookResult.error(new JSONObject(), "办理失败,此业务系统正在维护,请联webhook开发人员!");
+
+            }
+
+        }
+
+
+
+
+
+
+
+        return null;
+    }
+}

+ 78 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNGDWebHookController.java

@@ -0,0 +1,78 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Multimap;
+import com.sifu.sfcc.bo.SendUrl;
+import com.sifu.sfcc.service.*;
+import com.sifu.sfcc.util.NGDObjectToJson;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
+import java.util.*;
+
+/**
+ * @Author 逄博
+ * @Function  webHook接口
+ * @Date 2022.01.07
+ */
+@RestController
+@Api(tags = "CcNGDWebHookController", description = "webHook相关接口应用")
+@CrossOrigin
+@RequestMapping(value = "/ngd/webHook")
+public class CcNGDWebHookController {
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Autowired
+    CcHandleTheBusinessService handleTheBusinessService;
+
+    @Autowired
+    CcCulturalBusinessService culturalBusinessService;
+
+
+    @PostMapping("/webHook")
+    public Object webHook(@RequestBody String webHook) {
+        System.out.println("================== 输入参数:" + webHook + "===================");
+        //获取出入的context和action名称跟据action名称判断进入哪个条件分支
+        JSONObject webHookJson = JSONObject.parseObject(webHook);
+        JSONObject context = webHookJson.getJSONObject("context");
+        String action = webHookJson.getString("action");
+        String session_id = webHookJson.getString("session_id");
+        //发送短信接口
+        SendUrl sendUrl = new SendUrl();
+        //根据session_id获取电话号
+        String phone = NGDObjectToJson.getPhone(restTemplate, session_id);
+        //1.1 旅游业务
+        if ("TourismBusiness".equals(action)) {
+            Map tourismBusiness = handleTheBusinessService.tourismBusiness(context, session_id,phone);
+            return NGDObjectToJson.returnJson(new JSONObject(), 200, "", tourismBusiness.get("res").toString());
+        }
+        //1.2 导游考试
+        else if ("TourGuideExaminati".equals(action)) {
+            Map tourGuideExaminati = handleTheBusinessService.tourGuideExaminati(context, session_id);
+            return NGDObjectToJson.returnJson(new JSONObject(), 200, "", tourGuideExaminati.get("res").toString());
+        }
+        //1.3 导游证
+        else if ("TourGuideCertifica".equals(action)) {
+            Map tourGuideCertifica = handleTheBusinessService.tourGuideCertifica(context, session_id,phone);
+            return NGDObjectToJson.returnJson(new JSONObject(), 200, "", tourGuideCertifica.get("res").toString());
+        }
+        //2.1 文化业务
+        if ("CulturalBusiness".equals(action)) {
+            Map culturalBusiness = culturalBusinessService.culturalBusiness(context, session_id,phone);
+            return NGDObjectToJson.returnJson(new JSONObject(), 200, "", culturalBusiness.get("res").toString());
+        }
+        //2.2 证件办理
+        else if ("CertificateHandling".equals(action)) {
+            Map certificateHandling = culturalBusinessService.certificateHandling(context, session_id,phone);
+            return NGDObjectToJson.returnJson(new JSONObject(), 200, "", certificateHandling.get("res").toString());
+        }
+
+
+        return null;
+    }
+}

+ 179 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcNaireController.java

@@ -0,0 +1,179 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.CcNaire;
+import com.sifu.sfcc.model.CcNaireAnswer;
+import com.sifu.sfcc.model.CcNaireQuestion;
+import com.sifu.sfcc.service.CcNaireService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcNaireController", description = "问卷系统")
+@RequestMapping("/naire")
+public class CcNaireController  {
+
+    @Autowired
+    CcNaireService naireService;
+    
+    @ApiOperation(value = "添加问卷")
+    @PostMapping(value = "/addNaire")
+    public CommonResult addNaire(@RequestBody CcNaire naire){
+        int rows = naireService.addNaire(naire);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改问卷")
+    @PostMapping(value = "/updateNaire")
+    public CommonResult updateNaire(@RequestBody CcNaire naire){
+        int rows = naireService.updateNaire(naire);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "删除问卷")
+    @PostMapping(value = "/deleteNaire/{id}")
+    public CommonResult deleteNaire(@PathVariable Long id){
+        int rows = naireService.deleteNaire(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed("存在已关联的任务,请先删除任务");
+        }
+    }
+
+    @ApiOperation(value = "获取某个问卷")
+    @GetMapping(value = "/getNaire/{id}")
+    public CommonResult getNaire(@PathVariable Long id){
+        return CommonResult.success(naireService.getNaire(id));
+    }
+    
+    @ApiOperation(value = "获取问卷")
+    @GetMapping(value = "/listNaire")
+    public CommonResult listNaire(@ApiParam("问题") @RequestParam(value = "question" , required = false) String question ,
+    		@ApiParam("状态") @RequestParam(value = "status" , required = false) String status,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(naireService.listNaire(question ,status, pageSize ,pageNum)));
+    }
+    
+    
+    @ApiOperation(value = "添加问卷问题")
+    @PostMapping(value = "/addQuestion")
+    public CommonResult addQuestion(@RequestBody CcNaireQuestion question){
+        int rows = naireService.addQuestion(question);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改问卷问题")
+    @PostMapping(value = "/updateQuestion")
+    public CommonResult updateQuestion(@RequestBody CcNaireQuestion question){
+        int rows = naireService.updateQuestion(question);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else if(rows == 0){
+            return CommonResult.failed("当前问卷已经存在第一个问题");
+        }else {
+        	return CommonResult.failed("当前问题已经被其他问题选择为下一个");
+        }
+    }
+
+
+    @ApiOperation(value = "删除问卷问题")
+    @PostMapping(value = "/deleteQuestion/{id}")
+    public CommonResult deleteQuestion(@PathVariable Long id){
+        int rows = naireService.deleteQuestion(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed("当前问题已经被其他问题选择为下一个");
+        }
+    }
+
+    @ApiOperation(value = "获取某个问题")
+    @GetMapping(value = "/getQuestion/{id}")
+    public CommonResult getQuestion(@PathVariable Long id){
+        return CommonResult.success(naireService.getQuestion(id));
+    }
+    
+
+    @ApiOperation(value = "获取未被选择的问题")
+    @GetMapping(value = "/listNoQuestion")
+    public CommonResult listNoQuestion(@ApiParam("naireId") @RequestParam(value = "naireId" , required = false) Long naireId,
+    		@ApiParam("questionId") @RequestParam(value = "questionId" , required = false) Long questionId){
+        return CommonResult.success(naireService.listNoQuestion(naireId,questionId));
+    }
+    
+    @ApiOperation(value = "获取问题")
+    @GetMapping(value = "/listQuestion")
+    public CommonResult listQuestion(@ApiParam("naireId") @RequestParam(value = "naireId" , required = false) Long naireId ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(naireService.listQuestion(naireId , pageSize ,pageNum)));
+    }
+
+
+    @ApiOperation(value = "添加回答信息")
+    @PostMapping(value = "/addAnswer")
+    public CommonResult addAnswer(@RequestBody CcNaireAnswer answer){
+        int rows = naireService.addAnswer(answer);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改回答信息")
+    @PostMapping(value = "/updateAnswer")
+    public CommonResult updateAnswer(@RequestBody CcNaireAnswer answer){
+        int rows = naireService.updateAnswer(answer);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除回答信息")
+    @PostMapping(value = "/deleteAnswer/{id}")
+    public CommonResult deleteAnswer(@PathVariable Long id){
+        int rows = naireService.deleteAnswer(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个回答信息")
+    @GetMapping(value = "/getAnswer/{id}")
+    public CommonResult getAnswer(@PathVariable Long id){
+        return CommonResult.success(naireService.getNaire(id));
+    }
+    
+    
+    @ApiOperation(value = "获取回答信息")
+    @GetMapping(value = "/listAnswer")
+    public CommonResult listAnswer(@ApiParam("questionId") @RequestParam(value = "questionId" , required = false) Long questionId ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(naireService.listAnswer(questionId , pageSize ,pageNum)));
+    }
+}

+ 29 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcScoreController.java

@@ -0,0 +1,29 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.service.CcScoreService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcScoreController")
+@RequestMapping("/score")
+public class CcScoreController  {
+
+  
+    @Autowired
+    CcScoreService scoreService;
+
+    @ApiOperation(value = "返回1-5分各多少人评价 ")
+    @PostMapping(value = "/getScore")
+    public CommonResult index(@ApiParam("开始时间") @RequestParam(value = "startTime",required = false ) String startTime,
+    		@ApiParam("结束时间") @RequestParam(value = "endTime",required = false ) String endTime,
+    		@ApiParam("坐席号") @RequestParam(value = "code",required = false ) String code){
+    	
+        return CommonResult.success(scoreService.count(startTime, endTime, code), "成功");
+    }
+
+}

+ 66 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcSessionController.java

@@ -0,0 +1,66 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.dto.CcScoreParam;
+import com.sifu.sfcc.model.CcSessionRecord;
+import com.sifu.sfcc.service.CcSessionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "CcSessionController", description = "会话")
+@RequestMapping("/session")
+public class CcSessionController  {
+
+    @Autowired
+    CcSessionService sessionService;
+    
+
+    @ApiOperation(value = "添加")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody CcSessionRecord record){
+        int rows = sessionService.add(record);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "人工未接电话,自动生成档案,工单")
+    @GetMapping(value = "/createWorkOrder")
+    public CommonResult createWorkOrder(
+    		@ApiParam("电话") @RequestParam(value = "phone") String phone,
+    		@ApiParam("sessionId") @RequestParam(value = "sessionId" ) String sessionId){
+        int rows = sessionService.createWorkOrder(phone,sessionId);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "挂机评分")
+    @PostMapping(value = "/createScore")
+    public CommonResult createScore(@RequestBody CcScoreParam param){
+        int rows = sessionService.createScore(param);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "获取列表")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("电话") @RequestParam(value = "phone" , required = false) String phone ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(sessionService.list(phone , pageSize ,pageNum)));
+    } 
+    
+}

+ 211 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/CcWorkOrderController.java

@@ -0,0 +1,211 @@
+package com.sifu.sfcc.controller;
+
+import com.alibaba.excel.util.CollectionUtils;
+import com.alibaba.excel.util.StringUtils;
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.common.exception.ApiException;
+import com.sifu.sfcc.common.annotation.CcOperateLog;
+import com.sifu.sfcc.dto.CcApproveParam;
+import com.sifu.sfcc.dto.CcDealerParam;
+import com.sifu.sfcc.dto.CcWorderLabelParam;
+import com.sifu.sfcc.dto.CcWorkOrderCount;
+import com.sifu.sfcc.dto.CcWorkOrderParam;
+import com.sifu.sfcc.enums.ApproveStatusEnum;
+import com.sifu.sfcc.enums.WorderStatusEnum;
+import com.sifu.sfcc.model.*;
+import com.sifu.sfcc.service.CcLabelService;
+import com.sifu.sfcc.service.CcWorkOrderService;
+import com.sifu.sfcc.service.UmsAdminService;
+import com.sifu.sfcc.service.UmsDeptService;
+import com.sifu.sfcc.util.ValidatorUtils;
+import com.sifu.sfcc.vo.workorder.WorkOrderVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Api(tags = "CcWorkOrderController", description = "工单接口")
+@RestController
+@RequestMapping("/worder")
+public class CcWorkOrderController {
+
+    public Logger logger = LoggerFactory.getLogger(CcWorkOrderController.class);
+
+    @Autowired
+    private CcWorkOrderService ccWorkOrderService;
+
+    @Autowired
+    private CcLabelService labelService;
+
+    @Autowired
+    private UmsAdminService umsAdminService;
+
+    @Autowired
+    private UmsDeptService deptService;
+
+    @ApiOperation(value = "创建工单")
+    @PostMapping(value = "/create")
+    @CcOperateLog(type = "创建", moudule = "工单")
+    public CommonResult<CcWorkOrder> create(@RequestBody CcWorkOrderParam ccWorkOrderParam) throws IllegalAccessException {
+        ValidatorUtils.validateEntity(ccWorkOrderParam);
+
+        CcWorkOrder ccWorkOrder = ccWorkOrderService.create(ccWorkOrderParam);
+        if (!ObjectUtils.isEmpty(ccWorkOrder) && !StringUtils.isEmpty(ccWorkOrder.getCode())) {
+            return CommonResult.success(ccWorkOrder);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+    @ApiOperation(value = "修改工单普通字段,不修改的字段设置 null ,工单编号必填|除 (工单负责人字段、工单状态)")
+    @PostMapping(value = "/makeLabel")
+    @CcOperateLog(moudule = "工单", type = "添加标签")
+    public CommonResult<CcWorkOrder> makeLabel(@RequestBody CcWorderLabelParam param) throws IllegalAccessException {
+        ValidatorUtils.validateEntity(param);
+        WorkOrderVO workOrderVO = null;
+        try{
+            workOrderVO = ccWorkOrderService.qryByOrderNo(param.getWorderNo());
+           // String oldLabel = workOrderVO.getLabel();
+            //String newLabel = StringUtils.isEmpty(oldLabel)?param.getLabel():oldLabel.concat(",").concat(param.getLabel());
+            workOrderVO.setLabel(param.getLabel());
+            CcWorkOrder ccWorkOrder = new CcWorkOrder();
+            ccWorkOrder.setLabel(param.getLabel());
+            ccWorkOrder.setCode(param.getWorderNo());
+            ccWorkOrderService.updWorder(ccWorkOrder);
+            //去掉标签插入
+//            CcLabel ccLabel = new CcLabel();
+//            ccLabel.setName(param.getLabel());
+//            ccLabel.setPos(workOrderVO.getId().toString());
+//            labelService.add(ccLabel);
+        }catch(Exception e){
+            throw new ApiException("创建工单 标签失败!");
+        }
+
+        return CommonResult.success(workOrderVO);
+    }
+
+    @ApiOperation(value = "修改工单普通字段,不修改的字段设置 null ,工单编号必填|除 (工单负责人字段、工单状态)")
+    @PostMapping(value = "/changeNormal")
+    @CcOperateLog(moudule = "工单", type = "修改")
+    public CommonResult changeNormal(@RequestBody CcWorkOrder workOrderParam) {
+        if (StringUtils.isEmpty(workOrderParam.getCode())) {
+            throw new ApiException("工单编号不能为空");
+        }
+        int row = ccWorkOrderService.updWorder(workOrderParam);
+        if (row > 0) {
+            return CommonResult.success(row);
+        }
+
+        return CommonResult.failed("修改记录不存在");
+    }
+
+    @Deprecated
+    @PostMapping("/changeDealeer")
+    @ApiOperation(value = "更改负责人")
+    @CcOperateLog(moudule = "工单", type = "修改负责人")
+    public CommonResult<String> changeDealer(@RequestBody CcDealerParam dealerParam) throws IllegalAccessException {
+        ValidatorUtils.validateEntity(dealerParam);
+        try {
+            ccWorkOrderService.transferWOrder(dealerParam.getWorderNo(), dealerParam.getDealerCode());
+        } catch (ApiException e) {
+            e.printStackTrace();
+            logger.error("系统内部错误:" + e.getMessage());
+            return CommonResult.failed("系统内部错误:" + e.getMessage());
+        } catch (Exception e) {
+            logger.error("未知错误{}", e);
+            return CommonResult.failed("未知错误");
+        }
+
+        return CommonResult.success("成功");
+    }
+
+    @PostMapping("/cancelOrder/{worderCode}")
+    @ApiOperation(value = "作废工单")
+    @CcOperateLog(moudule = "工单", type = "作废工单")
+    @Transactional(rollbackFor = Exception.class)
+    public CommonResult<String> cancelOrder(@PathVariable("worderCode") String worderCode) throws IllegalAccessException {
+        try {
+            ccWorkOrderService.cancelWorder(worderCode);
+        } catch (ApiException e) {
+            e.printStackTrace();
+            logger.error("系统内部错误:" + e.getMessage());
+            return CommonResult.failed("系统内部错误:" + e.getMessage());
+        } catch (Exception e) {
+            logger.error("未知错误{}", e);
+            return CommonResult.failed("未知错误");
+        }
+
+        return CommonResult.success("成功");
+    }
+
+
+    @ApiOperation(value = "通过工单编号查询工单")
+    @GetMapping(value = "/getByNO/{worderCode}")
+    public CommonResult<WorkOrderVO> getByNO(@PathVariable("worderCode") String wOrderNO) throws IllegalAccessException {
+        WorkOrderVO workOrderVO = ccWorkOrderService.qryByOrderNo(wOrderNO);
+        if (CollectionUtils.isEmpty(workOrderVO.getApproveList())) {
+            CommonResult.failed("当前工单编号对应的工单不存在!");
+        }
+        return CommonResult.success(workOrderVO);
+    }
+
+    @ApiOperation(value = "处理工单")
+    @PostMapping(value = "/process")
+    public CommonResult approveOrder(@RequestBody CcApproveParam approveParam) {
+        try {
+            ccWorkOrderService.processWorder(approveParam);
+        } catch (ApiException e) {
+            return CommonResult.failed(e.getMessage());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            return CommonResult.failed("处理工单异常,未知错误!");
+        }
+
+        return CommonResult.success("");
+        //ccWorkOrderService.
+
+    }
+
+    @ApiOperation(value = "分页获取工单")
+    @GetMapping(value = "/list")
+    public CommonResult list(
+            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+            @ApiParam("工单状态 0初始化 1:处理中 2结单 3 作废")
+            @RequestParam(value = "wstatus") Integer wstatus,
+            @ApiParam("工单待处理人")
+            @RequestParam(value = "toDoText") String toDoText
+            ) {
+        return CommonResult.success(CommonPage.restPage(ccWorkOrderService.list(pageSize, pageNum,wstatus,toDoText)));
+    }
+
+    @PostMapping(value = "/qryToDO")
+    @ApiOperation(value = "查询待办")
+    public CommonResult<List<CcWorkOrder>> qryToDO() {
+        return CommonResult.success(ccWorkOrderService.toDOList());
+
+    }
+    
+    @PostMapping(value = "/getCount")
+    @ApiOperation(value = "查询工单个数")
+    public CommonResult<List<CcWorkOrderCount>> getCount(
+    		@RequestParam(value = "startTime", required = false) String startTime,
+            @RequestParam(value = "endTime", required = false) String endTime,
+            @RequestParam(value = "dealerId", required = false) Long dealerId
+            ) {
+        return CommonResult.success(ccWorkOrderService.getCount(startTime,endTime,dealerId));
+
+    }
+
+
+}

+ 61 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/IndexController.java

@@ -0,0 +1,61 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.dto.IndexParam;
+import com.sifu.sfcc.model.CcLabel;
+import com.sifu.sfcc.service.CcArchivesService;
+import com.sifu.sfcc.service.CcKnowledgeService;
+import com.sifu.sfcc.service.CcScoreService;
+import com.sifu.sfcc.service.CcWorkOrderService;
+import com.sifu.sfcc.service.UmsDeptService;
+import com.sifu.sfcc.service.UmsMemberService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "IndexController", description = "首页")
+@RequestMapping("/index")
+public class IndexController  {
+
+    @Autowired
+    CcArchivesService archivesService;
+    
+    @Autowired
+    CcWorkOrderService workService;
+    
+    @Autowired
+    UmsMemberService memberService;
+    
+    @Autowired
+    UmsDeptService deptService;
+    
+    @Autowired
+    CcKnowledgeService knowService;
+    
+    @Autowired
+    CcScoreService scoreService;
+
+    @ApiOperation(value = "首页信息")
+    @PostMapping(value = "/")
+    public CommonResult index(@ApiParam("标签") @RequestParam(value = "label",required = false ) String label){
+    	IndexParam ip = new IndexParam();
+    	ip.setArchivesCount(archivesService.total());
+    	ip.setAiCount(50);
+    	ip.setDeptCount(deptService.total());
+    	ip.setMemberCount(memberService.total());
+    	ip.setKnowledgeCount(knowService.total());
+    	ip.setWorkOrderCount(workService.worderTotalNum());
+    	if(null != label && "" != label) {
+    		ip.setTotalCount(archivesService.labelCount(label));
+    	}
+    	ip.setScoreCount(scoreService.scoreCount());
+        return CommonResult.success(ip , "成功");
+    }
+
+
+
+}

+ 253 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsAdminController.java

@@ -0,0 +1,253 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.dto.UmsAdminLoginParam;
+import com.sifu.sfcc.dto.UpdateAdminPasswordParam;
+import com.sifu.sfcc.model.UmsAdmin;
+import com.sifu.sfcc.model.UmsPermission;
+import com.sifu.sfcc.model.UmsRole;
+import com.sifu.sfcc.service.UmsAdminService;
+import com.sifu.sfcc.service.UmsDeptService;
+import com.sifu.sfcc.service.UmsRoleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletRequest;
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 后台用户管理
+ * Created by cc on 2018/4/26.
+ */
+@RestController
+@Api(tags = "UmsAdminController", description = "后台用户管理")
+@RequestMapping("/admin")
+public class UmsAdminController {
+    @Value("${jwt.tokenHeader}")
+    private String tokenHeader;
+    @Value("${jwt.tokenHead}")
+    private String tokenHead;
+    @Autowired
+    private UmsAdminService adminService;
+    @Autowired
+    private UmsRoleService roleService;
+    @Autowired
+    private UmsDeptService deptService;
+
+    @ApiOperation(value = "用户注册")
+    @RequestMapping(value = "/register", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult<UmsAdmin> register(@RequestBody UmsAdmin ua, BindingResult result) {
+    	if("".equals(ua.getUsername()) || null == ua.getUsername()) {
+    		return CommonResult.failed("请正确填写用户名");
+    	}
+    	if("".equals(ua.getPassword()) || null == ua.getPassword()) {
+    		return CommonResult.failed("请正确填写密码");
+    	}
+        UmsAdmin umsAdmin = adminService.register(ua);
+        if (umsAdmin == null) {
+            CommonResult.failed();
+        }
+        return CommonResult.success(umsAdmin);
+    }
+
+    @ApiOperation(value = "登录以后返回token")
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult login(@RequestBody UmsAdminLoginParam umsAdminLoginParam, BindingResult result) {
+        String token = adminService.login(umsAdminLoginParam.getUsername(), umsAdminLoginParam.getPassword());
+        if (token == null) {
+            return CommonResult.failed("用户名或密码错误");
+        }
+        if (token == "enabled") {
+            return CommonResult.failed("该账号已经停用,请联系管理员");
+        }
+        Map<String, String> tokenMap = new HashMap<>();
+        tokenMap.put("token", token);
+        tokenMap.put("tokenHead", tokenHead);
+        return CommonResult.success(tokenMap);
+    }
+    @ApiOperation(value = "刷新token")
+    @RequestMapping(value = "/refreshToken", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult refreshToken(HttpServletRequest request) {
+        String token = request.getHeader(tokenHeader);
+        String refreshToken = adminService.refreshToken(token);
+        if (refreshToken == null) {
+            return CommonResult.failed("token已经过期!");
+        }
+        Map<String, String> tokenMap = new HashMap<>();
+        tokenMap.put("token", refreshToken);
+        tokenMap.put("tokenHead", tokenHead);
+        return CommonResult.success(tokenMap);
+    }
+
+    @ApiOperation(value = "获取当前登录用户信息")
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult getAdminInfo(Principal principal) {
+        if(principal==null){
+            return CommonResult.unauthorized(null);
+        }
+        String username = principal.getName();
+        UmsAdmin umsAdmin = adminService.getAdminByUsername(username);
+        Map<String, Object> data = new HashMap<>();
+        data.put("username", umsAdmin.getUsername());
+        data.put("id", umsAdmin.getId());
+        data.put("roles", new String[]{"TEST"});
+        data.put("code", umsAdmin.getCode());
+        data.put("exNum", umsAdmin.getExNum());
+        data.put("headImg",umsAdmin.getHeadImg());
+        data.put("deptName", deptService.selectDeptById(umsAdmin.getDeptId()).getDeptName());
+        data.put("menus", roleService.getMenuList(umsAdmin.getId()));
+        data.put("nickName", umsAdmin.getNickName());
+        return CommonResult.success(data);
+    }
+
+    @ApiOperation(value = "登出功能")
+    @RequestMapping(value = "/logout", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult logout() {
+        return CommonResult.success(null);
+    }
+
+    @ApiOperation("根据用户名或姓名分页获取用户列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<UmsAdmin>> list(
+    		 @ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+			 @ApiParam("电话") @RequestParam(value = "phone" , required = false) String phone ,
+			 @ApiParam("添加时间1") @RequestParam(value = "startTime" , required = false) String startTime ,
+			 @ApiParam("添加时间2") @RequestParam(value = "endTime" , required = false) String endTime ,
+			 @ApiParam("服务次数1") @RequestParam(value = "startCount" , required = false) String startCount ,
+			 @ApiParam("服务次数2") @RequestParam(value = "endCount" , required = false) String endCount ,
+			 @ApiParam("状态") @RequestParam(value = "status" , required = false) Integer status ,
+			 @ApiParam("部门id") @RequestParam(value = "deptId" , required = false) long deptId ,
+             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
+        List<UmsAdmin> adminList = adminService.list(name, phone,startTime,endTime,startCount,endCount,status,deptId,pageSize, pageNum);
+        return CommonResult.success(CommonPage.restPage(adminList));
+    }
+
+    @ApiOperation("获取指定用户信息")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<UmsAdmin> getItem(@PathVariable Long id) {
+        UmsAdmin admin = adminService.getItem(id);
+        return CommonResult.success(admin);
+    }
+
+    @ApiOperation("修改指定用户信息")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id, @RequestBody UmsAdmin admin) {
+        int count = adminService.update(id, admin);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("修改指定用户密码")
+    @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updatePassword(@RequestBody UpdateAdminPasswordParam updatePasswordParam) {
+        int status = adminService.updatePassword(updatePasswordParam);
+        if (status > 0) {
+            return CommonResult.success(status);
+        } else if (status == -1) {
+            return CommonResult.failed("提交参数不合法");
+        } else if (status == -2) {
+            return CommonResult.failed("找不到该用户");
+        } else if (status == -3) {
+            return CommonResult.failed("旧密码错误");
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("删除指定用户信息")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@PathVariable Long id) {
+        int count = adminService.delete(id);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("修改帐号状态")
+    @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updateStatus(@PathVariable Long id,@RequestParam(value = "status") Integer status) {
+        UmsAdmin umsAdmin = new UmsAdmin();
+        umsAdmin.setStatus(status);
+        int count = adminService.update(id,umsAdmin);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+    
+    @ApiOperation(value = "批量封禁")
+    @RequestMapping(value = "/batchBan", method = RequestMethod.POST)
+    public CommonResult batchBan(@RequestParam("ids") List<Long> ids){
+    
+        int rows = adminService.batchBan(ids);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+
+    @ApiOperation("给用户分配角色")
+    @RequestMapping(value = "/role/update", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updateRole(@RequestParam("adminId") Long adminId,
+                                   @RequestParam("roleIds") List<Long> roleIds) {
+        int count = adminService.updateRole(adminId, roleIds);
+        if (count >= 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("获取指定用户的角色")
+    @RequestMapping(value = "/role/{adminId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsRole>> getRoleList(@PathVariable Long adminId) {
+        List<UmsRole> roleList = adminService.getRoleList(adminId);
+        return CommonResult.success(roleList);
+    }
+
+    @ApiOperation("给用户分配+-权限")
+    @RequestMapping(value = "/permission/update", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updatePermission(@RequestParam Long adminId,
+                                         @RequestParam("permissionIds") List<Long> permissionIds) {
+        int count = adminService.updatePermission(adminId, permissionIds);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("获取用户所有权限(包括+-权限)")
+    @RequestMapping(value = "/permission/{adminId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsPermission>> getPermissionList(@PathVariable Long adminId) {
+        List<UmsPermission> permissionList = adminService.getPermissionList(adminId);
+        return CommonResult.success(permissionList);
+    }
+}

+ 134 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsDeptController.java

@@ -0,0 +1,134 @@
+package com.sifu.sfcc.controller;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsDept;
+import com.sifu.sfcc.service.UmsDeptService;
+
+//import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+@RestController
+@Api(tags = "UmsDeptController", description = "部门管理")
+@RequestMapping("/dept")
+public class UmsDeptController
+{
+    @Autowired
+    private UmsDeptService deptService;
+
+    /**
+     * 获取部门列表
+     */
+    //@PreAuthorize("@ss.hasPermi('system:dept:list')")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public CommonResult list(@ApiParam("部门名称") @RequestParam(value = "deptName" , required = false) String deptName ,
+			 @ApiParam("部门电话") @RequestParam(value = "deptPhone" , required = false) String deptPhone ,
+			 @ApiParam("负责人") @RequestParam(value = "leader" , required = false) String leader ,
+			 @ApiParam("负责人电话") @RequestParam(value = "phone" , required = false) String phone ,
+			 @ApiParam("城市") @RequestParam(value = "city" , required = false) String city ,
+			 @ApiParam("部门状态(0正常 1停用)") @RequestParam(value = "status" , defaultValue = "2") String status ,
+            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum)
+    {
+        List<UmsDept> depts = deptService.selectDeptList(deptName,deptPhone,leader,phone,city,status,pageSize,pageNum);
+        return CommonResult.success(CommonPage.restPage(depts));
+    }
+    
+
+    /**
+     * 根据部门编号获取详细信息
+     */
+    //@PreAuthorize("@ss.hasPermi('system:dept:query')")
+    @GetMapping(value = "getDept/{deptId}")
+    public CommonResult getInfo(@PathVariable Long deptId)
+    {
+        return CommonResult.success(deptService.selectDeptById(deptId));
+    }
+
+
+    /**
+     * 新增部门
+     */
+    //@PreAuthorize("@ss.hasPermi('system:dept:add')")
+    //@Log(title = "部门管理", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public CommonResult add(@Validated @RequestBody UmsDept dept)
+    {
+    	if("".equals(dept.getDeptName()) || null == dept.getDeptName()) {
+    		return CommonResult.failed("部门名称不能为空");
+    	}
+    	if("".equals(dept.getDeptPhone()) || null == dept.getDeptPhone()) {
+    		return CommonResult.failed("部门电话不能为空");
+    	}
+    	
+    	if(null != dept.getDeptName() && dept.getDeptName().length() > 30) {
+    		return CommonResult.failed("部门名称字数不超过30个字符");
+    	}
+    	
+        if ("1".equals(deptService.checkDeptNameUnique(dept)))
+        {
+            return CommonResult.failed("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+        }
+        return CommonResult.success(deptService.insertDept(dept), "成功");
+    }
+    
+    @RequestMapping(value = "/batchBan", method = RequestMethod.POST)
+    public CommonResult batchBan(@RequestParam("ids") List<Long> ids)
+    {
+    	 int rows = deptService.batchBan(ids);
+         if(rows > 0){
+             return CommonResult.success(null , "成功");
+         }else{
+             return CommonResult.failed();
+         }
+    }
+
+    /**
+     * 修改部门
+     */
+    //@PreAuthorize("@ss.hasPermi('system:dept:edit')")
+    //@Log(title = "部门管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateDept")
+    public CommonResult edit(@Validated @RequestBody UmsDept dept)
+    {
+        if ("1".equals(deptService.checkDeptNameUnique(dept)))
+        {
+            return CommonResult.failed("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+        }
+        return CommonResult.success(deptService.updateDept(dept), "成功");
+    }
+
+    /**
+     * 删除部门
+     */
+   // @PreAuthorize("@ss.hasPermi('system:dept:remove')")
+    //@Log(title = "部门管理", businessType = BusinessType.DELETE)
+    @PostMapping("delDept/{deptId}")
+    public CommonResult remove(@PathVariable Long deptId)
+    {
+        return CommonResult.success(deptService.deleteDeptById(deptId), "成功");
+    }
+    
+    @ApiOperation(value = "获取部门总量")
+    @RequestMapping(value = "/total", method = RequestMethod.POST)
+    public CommonResult list() {
+    	return CommonResult.success(deptService.total());
+    }
+}

+ 134 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMemberController.java

@@ -0,0 +1,134 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsMember;
+import com.sifu.sfcc.service.UmsMemberService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "UmsMemberController", description = "用户管理")
+@RequestMapping("/memberInfo")
+public class UmsMemberController  {
+
+    @Autowired
+    UmsMemberService memberService;
+
+    @ApiOperation(value = "添加用户")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody UmsMember member){
+        int rows = memberService.add(member);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "批量添加用户")
+    @PostMapping(value = "/addBatch")
+    public CommonResult addBatch(@RequestBody List<UmsMember> member){
+        int rows = memberService.addBatch(member);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改用户")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody UmsMember member){
+        int rows = memberService.update(member);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "合并档案用户")
+    @PostMapping(value = "/updateBatch")
+    public CommonResult updateBatch(@RequestBody List<UmsMember> member){
+        int rows = memberService.updateBatch(member);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "封禁和解封用户")
+    @RequestMapping(value = "/ban/{id}", method = RequestMethod.POST)
+    public CommonResult ban(@PathVariable Long id , @ApiParam("是否封禁 : 0 - 禁用  1 - 启用 ") @RequestParam Integer status){
+    
+        int rows = memberService.ban(id,status);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+    
+    @ApiOperation(value = "批量封禁")
+    @RequestMapping(value = "/batchBan", method = RequestMethod.POST)
+    public CommonResult batchBan(@RequestParam("ids") List<Long> ids){
+    
+        int rows = memberService.batchBan(ids);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除用户")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = memberService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个用户")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(memberService.get(id));
+    }
+    
+    
+    @ApiOperation(value = "获取用户")
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public CommonResult list(@ApiParam("名称") @RequestParam(value = "name" , required = false) String name ,
+    						 @ApiParam("电话") @RequestParam(value = "phone" , required = false) String phone ,
+    						 @ApiParam("添加时间1") @RequestParam(value = "startTime" , required = false) String startTime ,
+    						 @ApiParam("添加时间2") @RequestParam(value = "endTime" , required = false) String endTime ,
+    						 @ApiParam("标签") @RequestParam(value = "label" , required = false) long label ,
+    						 @ApiParam("会话次数1") @RequestParam(value = "startCount" , required = false) String startCount ,
+    						 @ApiParam("会话次数2") @RequestParam(value = "endCount" , required = false) String endCount ,
+    						 @ApiParam("业务员") @RequestParam(value = "salesman" , required = false) String salesman ,
+    						 @ApiParam("状态") @RequestParam(value = "status" , required = false) Integer status ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(memberService.list(name ,phone, startTime, endTime, label, startCount, endCount,salesman,status, pageSize ,pageNum)));
+    }
+    
+    @ApiOperation(value = "获取用户总量")
+    @RequestMapping(value = "/total", method = RequestMethod.POST)
+    public CommonResult list() {
+    	return CommonResult.success(memberService.total());
+    }
+
+}

+ 69 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMemberLevelController.java

@@ -0,0 +1,69 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsMemberLevel;
+import com.sifu.sfcc.service.UmsMemberLevelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "UmsMemberLevelController", description = "用户等级管理")
+@RequestMapping("/memberLevel")
+public class UmsMemberLevelController  {
+
+    @Autowired
+    UmsMemberLevelService memberLevelService;
+
+    @ApiOperation(value = "添加配置用户等级")
+    @PostMapping(value = "/add")
+    public CommonResult add(@RequestBody UmsMemberLevel memberLevel){
+        int rows = memberLevelService.add(memberLevel);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "修改用户等级")
+    @PostMapping(value = "/update")
+    public CommonResult update(@RequestBody UmsMemberLevel memberLevel){
+        int rows = memberLevelService.update(memberLevel);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+
+    @ApiOperation(value = "删除用户等级")
+    @PostMapping(value = "/delete/{id}")
+    public CommonResult delete(@PathVariable Long id){
+        int rows = memberLevelService.delete(id);
+        if(rows > 0){
+            return CommonResult.success(null , "成功");
+        }else{
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation(value = "获取某个用户等级")
+    @GetMapping(value = "/get/{id}")
+    public CommonResult get(@PathVariable Long id){
+        return CommonResult.success(memberLevelService.get(id));
+    }
+    @ApiOperation(value = "获取等级列表")
+    @GetMapping(value = "/list")
+    public CommonResult list(@ApiParam("等级名称") @RequestParam(value = "levelName" , required = false) String levelName ,
+                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
+        return CommonResult.success(CommonPage.restPage(memberLevelService.list( levelName , pageSize ,pageNum)));
+    }
+
+
+}

+ 102 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsMenuController.java

@@ -0,0 +1,102 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.dto.UmsMenuNode;
+import com.sifu.sfcc.model.UmsMenu;
+import com.sifu.sfcc.service.UmsMenuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台菜单管理Controller
+ * Created by commerce on 2020/2/4.
+ */
+@Controller
+@Api(tags = "UmsMenuController", description = "后台菜单管理")
+@RequestMapping("/menu")
+public class UmsMenuController {
+
+    @Autowired
+    private UmsMenuService menuService;
+
+    @ApiOperation("添加后台菜单")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsMenu umsMenu) {
+        int count = menuService.create(umsMenu);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("修改后台菜单")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id,
+                               @RequestBody UmsMenu umsMenu) {
+        int count = menuService.update(id, umsMenu);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("根据ID获取菜单详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<UmsMenu> getItem(@PathVariable Long id) {
+        UmsMenu umsMenu = menuService.getItem(id);
+        return CommonResult.success(umsMenu);
+    }
+
+    @ApiOperation("根据ID删除后台菜单")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@PathVariable Long id) {
+        int count = menuService.delete(id);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("分页查询后台菜单")
+    @RequestMapping(value = "/list/{parentId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<UmsMenu>> list(@PathVariable Long parentId,
+                                                  @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
+        List<UmsMenu> menuList = menuService.list(parentId, pageSize, pageNum);
+        return CommonResult.success(CommonPage.restPage(menuList));
+    }
+
+    @ApiOperation("树形结构返回所有菜单列表")
+    @RequestMapping(value = "/treeList", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsMenuNode>> treeList() {
+        List<UmsMenuNode> list = menuService.treeList();
+        return CommonResult.success(list);
+    }
+
+    @ApiOperation("修改菜单显示状态")
+    @RequestMapping(value = "/updateHidden/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updateHidden(@PathVariable Long id, @RequestParam("hidden") Integer hidden) {
+        int count = menuService.updateHidden(id, hidden);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+}

+ 73 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsPermissionController.java

@@ -0,0 +1,73 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.dto.UmsPermissionNode;
+import com.sifu.sfcc.model.UmsPermission;
+import com.sifu.sfcc.service.UmsPermissionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台用户权限管理
+ * Created by commerce on 2018/9/29.
+ */
+@Controller
+@Api(tags = "UmsPermissionController", description = "后台用户权限管理")
+@RequestMapping("/permission")
+public class UmsPermissionController {
+    @Autowired
+    private UmsPermissionService permissionService;
+    @ApiOperation("添加权限")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsPermission permission) {
+        int count = permissionService.create(permission);
+        if(count>0){
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("修改权限")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id, @RequestBody UmsPermission permission) {
+        int count = permissionService.update(id,permission);
+        if(count>0){
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("根据id批量删除权限")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@RequestParam("ids") List<Long> ids) {
+        int count = permissionService.delete(ids);
+        if(count>0){
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("以层级结构返回所有权限")
+    @RequestMapping(value = "/treeList", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsPermissionNode>> treeList() {
+        List<UmsPermissionNode> permissionNodeList = permissionService.treeList();
+        return CommonResult.success(permissionNodeList);
+    }
+
+    @ApiOperation("获取所有权限列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsPermission>> list() {
+        List<UmsPermission> permissionList = permissionService.list();
+        return CommonResult.success(permissionList);
+    }
+}

+ 69 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsResourceCategoryController.java

@@ -0,0 +1,69 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsResourceCategory;
+import com.sifu.sfcc.service.UmsResourceCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台资源分类管理Controller
+ * Created by commerce on 2020/2/5.
+ */
+@Controller
+@Api(tags = "UmsResourceCategoryController", description = "后台资源分类管理")
+@RequestMapping("/resourceCategory")
+public class UmsResourceCategoryController {
+    @Autowired
+    private UmsResourceCategoryService resourceCategoryService;
+
+    @ApiOperation("查询所有后台资源分类")
+    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsResourceCategory>> listAll() {
+        List<UmsResourceCategory> resourceList = resourceCategoryService.listAll();
+        return CommonResult.success(resourceList);
+    }
+
+    @ApiOperation("添加后台资源分类")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsResourceCategory umsResourceCategory) {
+        int count = resourceCategoryService.create(umsResourceCategory);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("修改后台资源分类")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id,
+                               @RequestBody UmsResourceCategory umsResourceCategory) {
+        int count = resourceCategoryService.update(id, umsResourceCategory);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("根据ID删除后台资源")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@PathVariable Long id) {
+        int count = resourceCategoryService.delete(id);
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+}

+ 97 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsResourceController.java

@@ -0,0 +1,97 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsResource;
+import com.sifu.sfcc.security.component.DynamicSecurityMetadataSource;
+import com.sifu.sfcc.service.UmsResourceService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台资源管理Controller
+ * Created by commerce on 2020/2/4.
+ */
+@Controller
+@Api(tags = "UmsResourceController", description = "后台资源管理")
+@RequestMapping("/resource")
+public class UmsResourceController {
+
+    @Autowired
+    private UmsResourceService resourceService;
+    @Autowired
+    private DynamicSecurityMetadataSource dynamicSecurityMetadataSource;
+
+    @ApiOperation("添加后台资源")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsResource umsResource) {
+        int count = resourceService.create(umsResource);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("修改后台资源")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id,
+                               @RequestBody UmsResource umsResource) {
+        int count = resourceService.update(id, umsResource);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("根据ID获取资源详情")
+    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<UmsResource> getItem(@PathVariable Long id) {
+        UmsResource umsResource = resourceService.getItem(id);
+        return CommonResult.success(umsResource);
+    }
+
+    @ApiOperation("根据ID删除后台资源")
+    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@PathVariable Long id) {
+        int count = resourceService.delete(id);
+        dynamicSecurityMetadataSource.clearDataSource();
+        if (count > 0) {
+            return CommonResult.success(count);
+        } else {
+            return CommonResult.failed();
+        }
+    }
+
+    @ApiOperation("分页模糊查询后台资源")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<UmsResource>> list(@RequestParam(required = false) Long categoryId,
+                                                      @RequestParam(required = false) String nameKeyword,
+                                                      @RequestParam(required = false) String urlKeyword,
+                                                      @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
+        List<UmsResource> resourceList = resourceService.list(categoryId,nameKeyword, urlKeyword, pageSize, pageNum);
+        return CommonResult.success(CommonPage.restPage(resourceList));
+    }
+
+    @ApiOperation("查询所有后台资源")
+    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsResource>> listAll() {
+        List<UmsResource> resourceList = resourceService.listAll();
+        return CommonResult.success(resourceList);
+    }
+}

+ 156 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/UmsRoleController.java

@@ -0,0 +1,156 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.UmsMenu;
+import com.sifu.sfcc.model.UmsPermission;
+import com.sifu.sfcc.model.UmsResource;
+import com.sifu.sfcc.model.UmsRole;
+import com.sifu.sfcc.service.UmsRoleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 后台用户角色管理
+ * Created by commerce on 2018/9/30.
+ */
+@Controller
+@Api(tags = "UmsRoleController", description = "后台用户角色管理")
+@RequestMapping("/role")
+public class UmsRoleController {
+    @Autowired
+    private UmsRoleService roleService;
+
+    @ApiOperation("添加角色")
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult create(@RequestBody UmsRole role) {
+    	
+    	if("".equals(role.getName()) || null == role.getName()) {
+    		return CommonResult.failed("角色名称不能为空");
+    	}
+    	
+    	if(null !=role.getName() && role.getName().length() > 100) {
+    		return CommonResult.failed("角色名称字数不超过100个字符");
+    	}
+    	if(null !=role.getDescription() && role.getDescription().length() > 500) {
+    		return CommonResult.failed("角色描述字数不超过500个字符");
+    	}
+        int count = roleService.create(role);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("修改角色")
+    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult update(@PathVariable Long id, @RequestBody UmsRole role) {
+        int count = roleService.update(id, role);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("批量删除角色")
+    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult delete(@RequestParam("ids") List<Long> ids) {
+        int count = roleService.delete(ids);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("获取相应角色权限")
+    @RequestMapping(value = "/permission/{roleId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsPermission>> getPermissionList(@PathVariable Long roleId) {
+        List<UmsPermission> permissionList = roleService.getPermissionList(roleId);
+        return CommonResult.success(permissionList);
+    }
+
+    @ApiOperation("修改角色权限")
+    @RequestMapping(value = "/permission/update", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updatePermission(@RequestParam Long roleId,
+                                         @RequestParam("permissionIds") List<Long> permissionIds) {
+        int count = roleService.updatePermission(roleId, permissionIds);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("获取所有角色")
+    @RequestMapping(value = "/listAll", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsRole>> listAll() {
+        List<UmsRole> roleList = roleService.list();
+        return CommonResult.success(roleList);
+    }
+
+    @ApiOperation("根据角色名称分页获取角色列表")
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<CommonPage<UmsRole>> list(@RequestParam(value = "keyword", required = false) String keyword,
+                                                  @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
+                                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
+        List<UmsRole> roleList = roleService.list(keyword, pageSize, pageNum);
+        return CommonResult.success(CommonPage.restPage(roleList));
+    }
+
+    @ApiOperation("修改角色状态")
+    @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult updateStatus(@PathVariable Long id, @RequestParam(value = "status") Integer status) {
+        UmsRole umsRole = new UmsRole();
+        umsRole.setStatus(status);
+        int count = roleService.update(id, umsRole);
+        if (count > 0) {
+            return CommonResult.success(count);
+        }
+        return CommonResult.failed();
+    }
+
+    @ApiOperation("获取角色相关菜单")
+    @RequestMapping(value = "/listMenu/{roleId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsMenu>> listMenu(@PathVariable Long roleId) {
+        List<UmsMenu> roleList = roleService.listMenu(roleId);
+        return CommonResult.success(roleList);
+    }
+
+    @ApiOperation("获取角色相关资源")
+    @RequestMapping(value = "/listResource/{roleId}", method = RequestMethod.GET)
+    @ResponseBody
+    public CommonResult<List<UmsResource>> listResource(@PathVariable Long roleId) {
+        List<UmsResource> roleList = roleService.listResource(roleId);
+        return CommonResult.success(roleList);
+    }
+
+    @ApiOperation("给角色分配菜单")
+    @RequestMapping(value = "/allocMenu", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult allocMenu(@RequestParam Long roleId, @RequestParam List<Long> menuIds) {
+        int count = roleService.allocMenu(roleId, menuIds);
+        return CommonResult.success(count);
+    }
+
+    @ApiOperation("给角色分配资源")
+    @RequestMapping(value = "/allocResource", method = RequestMethod.POST)
+    @ResponseBody
+    public CommonResult allocResource(@RequestParam Long roleId, @RequestParam List<Long> resourceIds) {
+        int count = roleService.allocResource(roleId, resourceIds);
+        return CommonResult.success(count);
+    }
+
+}

+ 62 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/XmkPolicyController.java

@@ -0,0 +1,62 @@
+package com.sifu.sfcc.controller;
+
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.model.XmkPolicy;
+import com.sifu.sfcc.service.XmkPolicyService;
+import com.sifu.sfcc.service.XmkProjectService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@Api(tags = "XmkPolicyController", description = "政策相关")
+@RequestMapping("/xmkPolicy")
+public class XmkPolicyController {
+
+    @Autowired
+    XmkPolicyService xmkPolicyService;
+    @ApiOperation(value = "同步所有政策")
+    @PostMapping(value = "/export")
+    public CommonResult exportPolicy(@RequestParam(value = "s_bm_type" , required = false , defaultValue = "3") Integer sBmType,
+                                     @RequestParam(value = "s_type" , required = false , defaultValue = "2") Integer sType ,
+                                     @RequestParam(value = "s_organ" , required = false , defaultValue = "23") Integer sOrgan){
+        boolean result = xmkPolicyService.exportPolicy(sBmType , sType , sOrgan);
+        if(result){
+            return CommonResult.success(null , "导入成功!");
+        }else{
+            return CommonResult.failed("导入失败!");
+        }
+    }
+
+    @ApiOperation(value = "清空政策数据")
+    @GetMapping(value = "/clearPolicy")
+    public CommonResult clearPolicy(){
+        boolean result = xmkPolicyService.clearPolicy();
+        if(result){
+            return CommonResult.success(null , "清空成功!");
+        }else{
+            return CommonResult.failed("清空失败!");
+        }
+    }
+
+    @ApiOperation(value = "根据名称查询项目政策库")
+    @PostMapping(value = "/getPolicyByTitle")
+    public CommonResult getPolicyByTitle(
+            @ApiParam("政策名称标题") @RequestParam(value = "title" , required = false) String title){
+        List<XmkPolicy> xmkPolicyList = xmkPolicyService.getPolicyByTitle(title);
+        return CommonResult.success(CommonPage.restPage(xmkPolicyList));
+    }
+
+    @ApiOperation(value = "导入数据生成.xsl文件")
+    @GetMapping(value = "/importXmkPolicy")
+    public CommonResult importXmkPolicy(){
+        String filePath = xmkPolicyService.importXmkPolicy();
+        return CommonResult.success(filePath);
+    }
+}

+ 62 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/controller/XmkProjectController.java

@@ -0,0 +1,62 @@
+package com.sifu.sfcc.controller;
+
+import com.sifu.sfcc.common.api.CommonPage;
+import com.sifu.sfcc.common.api.CommonResult;
+import com.sifu.sfcc.common.utils.FileUtil;
+import com.sifu.sfcc.model.XmkProject;
+import com.sifu.sfcc.service.XmkProjectService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@Api(tags = "XmkProjectController", description = "项目库")
+@RequestMapping("/xmkProject")
+public class XmkProjectController {
+
+    @Autowired
+    XmkProjectService xmkProjectService;
+    @ApiOperation(value = "同步项目库")
+    @PostMapping(value = "/export")
+    public CommonResult exportProject(){
+        boolean result = xmkProjectService.exportProject();
+        if(result){
+            return CommonResult.success(null , "导入成功!");
+        }else{
+            return CommonResult.failed("导入失败!");
+        }
+    }
+
+    @ApiOperation(value = "根据名称查询项目库")
+    @PostMapping(value = "/getProjectByName")
+    public CommonResult getProjectByName(
+            @RequestParam(value = "pageSize", defaultValue = "5" ) Integer pageSize,
+            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum ,
+            @ApiParam("项目名称") @RequestParam(value = "projectName" , required = false) String projectName){
+        List<XmkProject> xmkProjectList = xmkProjectService.getProjectByName(pageSize ,pageNum , projectName);
+        return CommonResult.success(CommonPage.restPage(xmkProjectList));
+    }
+
+    @ApiOperation(value = "增量同步项目库")
+    @PostMapping(value = "/zlExport")
+    public CommonResult zlExportProject(){
+        boolean result = xmkProjectService.zlExportProject();
+        if(result){
+            return CommonResult.success(null , "增量导入成功!");
+        }else{
+            return CommonResult.failed("增量导入失败!");
+        }
+    }
+
+    @ApiOperation(value = "导入数据生成.xsl文件")
+    @GetMapping(value = "/importXmkProject")
+    public CommonResult importXmkProject(){
+        String filePath = xmkProjectService.importXmkProject();
+        return CommonResult.success(filePath);
+    }
+
+}

+ 14 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcArchivesContentDao.java

@@ -0,0 +1,14 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.sifu.sfcc.model.CcArchivesContent;
+
+public interface CcArchivesContentDao {
+
+//	List<CcLabelParam> getLabel(@Param("contentId") long contentId);
+	int updateBatch(@Param("list") List<CcArchivesContent> list);
+	  
+}

+ 16 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcArchivesDao.java

@@ -0,0 +1,16 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.sifu.sfcc.dto.CcArchivesExport;
+import com.sifu.sfcc.dto.CcArchivesParam;
+
+public interface CcArchivesDao {
+
+	 List<CcArchivesParam> getArchives(@Param("name")String name ,@Param("code")String code,@Param("urgency")String urgency,@Param("nameOrUrgency")String nameOrUrgency);
+	 List<CcArchivesExport> getArchivesExport(@Param("name")String name ,@Param("code")String code,@Param("urgency")String urgency,@Param("nameOrUrgency")String nameOrUrgency);
+	 List<CcArchivesParam> getArchivesCount(@Param("label")String label ,@Param("startTime")String startTime,@Param("endTime")String endTime);
+	 long labelCount(@Param("label")String lable);
+}

+ 10 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcCallTaskDao.java

@@ -0,0 +1,10 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import com.sifu.sfcc.dto.CcCallTaskParam;
+
+public interface CcCallTaskDao {
+
+	List<CcCallTaskParam> list(@Param("title")String title, @Param("status")String status, @Param("startTime")String startTime, @Param("endTime")String endTime);
+}

+ 12 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcKnowledgeDao.java

@@ -0,0 +1,12 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.sifu.sfcc.model.CcKnowledge;
+
+public interface CcKnowledgeDao {
+
+	  int batchInsert(@Param("list") List<CcKnowledge> list);
+	  
+}

+ 17 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNGDXmzxDao.java

@@ -0,0 +1,17 @@
+package com.sifu.sfcc.dao;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CcNGDXmzxDao {
+
+
+    int xm_zx(@Param("sys_location_substr") String sys_location_substr, @Param("xm_tzfs") String xm_tzfs, @Param("xm_sshy") String xm_sshy, @Param("sys_money") String sys_money);
+
+    List<String> queryTzfs();
+
+    List<String> querySshy();
+}

+ 18 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNGDZczxDao.java

@@ -0,0 +1,18 @@
+package com.sifu.sfcc.dao;
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+
+@Repository
+public interface CcNGDZczxDao {
+
+
+    int queryZc_szc(@Param("bmlxmc") String bmlxmc);
+
+    int zc_szc_ds(@Param("bmlxmc") String bmlxmc, @Param("sys_location") String sys_location);
+
+    int zc_szc_ds_bt(@Param("bmlxmc") String bmlxmc, @Param("sys_location") String sys_location, @Param("bt") String bt);
+
+    int zc_zczx(@Param("sys_location") String sys_location, @Param("bt") String bt);
+}

+ 21 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcNaireDao.java

@@ -0,0 +1,21 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import com.sifu.sfcc.dto.CcNaireQuestionParam;
+import com.sifu.sfcc.model.CcNaireAnswer;
+import com.sifu.sfcc.model.CcNaireQuestion;
+
+public interface CcNaireDao {
+
+	List<CcNaireQuestion> getQuestion(String phone);
+	
+	List<CcNaireAnswer> getAnswer(String phone);
+	
+	List<CcNaireQuestionParam> listQuestion(@Param(value="naireId")Long naireId);
+	  
+	List<CcNaireQuestionParam> listNoQuestion(@Param(value="naireId")Long naireId,@Param(value="questionId") Long questionId);
+	
+	List<CcNaireQuestion> getNaireQuestion(@Param(value="naireId")Long naireId,@Param(value="id")Long id);
+}

+ 17 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/CcWorkOrderDao.java

@@ -0,0 +1,17 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.dto.CcWorkOrderCount;
+import com.sifu.sfcc.model.CcWorkOrder;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface CcWorkOrderDao {
+
+	 List<CcWorkOrder> listWorkOrder(@Param("loginId")Long loginId , @Param("status") Integer status, @Param("currentDealerId") Long currentDealerId);
+	 
+	 
+	 List<CcWorkOrderCount> getCount(@Param("startTime")String startTime , @Param("endTime") String endTime, @Param("dealerId") Long dealerId);
+	 
+}

+ 21 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminDao.java

@@ -0,0 +1,21 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.dto.AdminParam;
+import org.apache.ibatis.annotations.Param;
+/**
+ * 部门管理 数据层
+ * 
+ * @author wuying
+ */
+public interface UmsAdminDao
+{
+    /**
+     * 查询部门管理数据
+     * 
+     * @param dept 部门信息
+     * @return 部门信息集合
+     */
+    public AdminParam selectAdminById(@Param("contentId")long id);
+
+   
+}

+ 17 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminPermissionRelationDao.java

@@ -0,0 +1,17 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.model.UmsAdminPermissionRelation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义用户权限关系管理Dao
+ * Created by sifu on 2018/10/8.
+ */
+public interface UmsAdminPermissionRelationDao {
+    /**
+     * 批量创建
+     */
+    int insertList(@Param("list") List<UmsAdminPermissionRelation> list);
+}

+ 45 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsAdminRoleRelationDao.java

@@ -0,0 +1,45 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.model.UmsAdminRoleRelation;
+import com.sifu.sfcc.model.UmsPermission;
+import com.sifu.sfcc.model.UmsResource;
+import com.sifu.sfcc.model.UmsRole;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义后台用户与角色管理Dao
+ * Created by sifu on 2018/10/8.
+ */
+public interface UmsAdminRoleRelationDao {
+    /**
+     * 批量插入用户角色关系
+     */
+    int insertList(@Param("list") List<UmsAdminRoleRelation> adminRoleRelationList);
+
+    /**
+     * 获取用于所有角色
+     */
+    List<UmsRole> getRoleList(@Param("adminId") Long adminId);
+
+    /**
+     * 获取用户所有角色权限
+     */
+    List<UmsPermission> getRolePermissionList(@Param("adminId") Long adminId);
+
+    /**
+     * 获取用户所有权限(包括+-权限)
+     */
+    List<UmsPermission> getPermissionList(@Param("adminId") Long adminId);
+
+    /**
+     * 获取用户所有可访问资源
+     */
+    List<UmsResource> getResourceList(@Param("adminId") Long adminId);
+
+    /**
+     * 获取资源相关用户ID列表
+     */
+    List<Long> getAdminIdList(@Param("resourceId") Long resourceId);
+}

+ 61 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsDeptDao.java

@@ -0,0 +1,61 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import com.sifu.sfcc.model.UmsDept;
+
+/**
+ * 部门管理 数据层
+ * 
+ * @author wuying
+ */
+public interface UmsDeptDao
+{
+    /**
+     * 查询部门管理数据
+     * 
+     * @param dept 部门信息
+     * @return 部门信息集合
+     */
+    public List<UmsDept> selectDeptList(String deptName,String deptPhone,String leader,String phone,String city,String status,Integer pageSize,Integer pageNum);
+
+    /**
+     * 根据部门ID查询信息
+     * 
+     * @param deptId 部门ID
+     * @return 部门信息
+     */
+    public UmsDept selectDeptById(Long deptId);
+
+    /**
+     * 校验部门名称是否唯一
+     * 
+     * @param deptName 部门名称
+     * @return 结果
+     */
+    public UmsDept checkDeptNameUnique(@Param("deptName") String deptName);
+
+    /**
+     * 新增部门信息
+     * 
+     * @param dept 部门信息
+     * @return 结果
+     */
+    public int insertDept(UmsDept dept);
+
+    /**
+     * 修改部门信息
+     * 
+     * @param dept 部门信息
+     * @return 结果
+     */
+    public int updateDept(UmsDept dept);
+
+    /**
+     * 删除部门管理信息
+     * 
+     * @param deptId 部门ID
+     * @return 结果
+     */
+    public int deleteDeptById(Long deptId);
+}

+ 14 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsMemberDao.java

@@ -0,0 +1,14 @@
+package com.sifu.sfcc.dao;
+
+import java.util.List;
+import com.sifu.sfcc.model.UmsMember;
+import org.apache.ibatis.annotations.Param;
+
+public interface UmsMemberDao {
+
+	int updateBatch(@Param("list") List<UmsMember> list);
+	
+	int addBatch(@Param("list") List<UmsMember> list);
+	
+	List<UmsMember> getMember(String archivesCode);
+}

+ 30 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsRoleDao.java

@@ -0,0 +1,30 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.model.UmsMenu;
+import com.sifu.sfcc.model.UmsResource;
+import com.sifu.sfcc.model.UmsRole;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义后台角色管理Dao
+ * Created by sifu on 2020/2/2.
+ */
+public interface UmsRoleDao {
+    /**
+     * 根据后台用户ID获取菜单
+     */
+    List<UmsMenu> getMenuList(@Param("adminId") Long adminId);
+    /**
+     * 根据角色ID获取菜单
+     */
+    List<UmsMenu> getMenuListByRoleId(@Param("roleId") Long roleId);
+    /**
+     * 根据角色ID获取资源
+     */
+    List<UmsResource> getResourceListByRoleId(@Param("roleId") Long roleId);
+    
+    List<UmsRole> list(@Param("keyword") String keyword);
+}

+ 23 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/UmsRolePermissionRelationDao.java

@@ -0,0 +1,23 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.model.UmsPermission;
+import com.sifu.sfcc.model.UmsRolePermissionRelation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 自定义角色权限关系管理Dao
+ * Created by sifu on 2018/9/30.
+ */
+public interface UmsRolePermissionRelationDao {
+    /**
+     * 批量插入角色和权限关系
+     */
+    int insertList(@Param("list") List<UmsRolePermissionRelation> list);
+
+    /**
+     * 根据角色获取权限
+     */
+    List<UmsPermission> getPermissionList(@Param("roleId") Long roleId);
+}

+ 18 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkKeywordDao.java

@@ -0,0 +1,18 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.bo.SaveSMS;
+import com.sifu.sfcc.dto.ProjectParam;
+import com.sifu.sfcc.model.XmkProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface XmkKeywordDao {
+
+
+    int saveQ(SaveSMS saveSMS);
+
+    List<SaveSMS> selectKeyWordPhoneBySessionId(@Param("sessionId") String sessionId);
+
+    List getSendInfo(@Param("type")String type);
+}

+ 16 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkPolicyDao.java

@@ -0,0 +1,16 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.dto.PolicyParam;
+import com.sifu.sfcc.model.XmkPolicy;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface XmkPolicyDao {
+    Long zlExportPolicy(List<XmkPolicy> xmkPolicyList);
+    
+    List<XmkPolicy> getPolicyCount(@Param("city") String city,@Param("title")String title);
+    
+    PolicyParam getPolicyRecommend(@Param("city") String city,@Param("pageNum")Integer pageNum);
+}

+ 26 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dao/XmkProjectDao.java

@@ -0,0 +1,26 @@
+package com.sifu.sfcc.dao;
+
+import com.sifu.sfcc.dto.ProjectParam;
+import com.sifu.sfcc.model.XmkProject;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface XmkProjectDao {
+	
+    Long zlExportProject(List<XmkProject> xmkProjectList);
+
+    List<XmkProject> queryXmkProject();
+    
+    List<XmkProject> getCountByLocation(@Param("city") String city,@Param("area") String area);
+    
+    ProjectParam getRecommendType(@Param("city") String city,@Param("area") String area,@Param("pageNum")Integer pageNum);
+    
+    ProjectParam getRecommend(@Param("city") String city,@Param("area") String area,@Param("type") String type,@Param("pageNum")Integer pageNum);
+    
+    ProjectParam getTotal(@Param("city") String city,@Param("area") String area,@Param("type")String type);
+
+    ProjectParam getLocation(@Param("name") String name, @Param("pageNum")Integer pageNum);   
+    
+}

+ 21 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/AdminParam.java

@@ -0,0 +1,21 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+/**
+ * 用户登录参数
+ * Created by commerce on 2018/4/26.
+ */
+@Getter
+@Setter
+@ToString
+public class AdminParam {
+    @ApiModelProperty(value = "用户名")
+    private String username;
+    @ApiModelProperty(value = "坐席")
+    private String code;
+    @ApiModelProperty(value = "部门名称")
+    private String deptName;
+}

+ 55 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcApproveParam.java

@@ -0,0 +1,55 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+@ApiModel
+public class CcApproveParam {
+
+    @ApiModelProperty("工单编号")
+    @NotBlank(message = "工单编号不能为空!")
+    private String wOrderNO;
+
+    @ApiModelProperty("审批备注")
+    private String approveText;
+
+    @ApiModelProperty("1:接收 2:拒收(退回) 3:已处理 4:转办")
+    @NotBlank(message = "工单动作不能为空!")
+    private int approveAction;
+
+    @ApiModelProperty("approveStatus == 4,该字段必填")
+    private String toCode;
+
+    public String getwOrderNO() {
+        return wOrderNO;
+    }
+
+    public void setwOrderNO(String wOrderNO) {
+        this.wOrderNO = wOrderNO;
+    }
+
+    public String getApproveText() {
+        return approveText;
+    }
+
+    public void setApproveText(String approveText) {
+        this.approveText = approveText;
+    }
+
+    public int getApproveAction() {
+        return approveAction;
+    }
+
+    public void setApproveAction(int approveAction) {
+        this.approveAction = approveAction;
+    }
+
+    public String getToCode() {
+        return toCode;
+    }
+
+    public void setToCode(String toCode) {
+        this.toCode = toCode;
+    }
+}

+ 202 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcArchivesExport.java

@@ -0,0 +1,202 @@
+package com.sifu.sfcc.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.sifu.sfcc.model.CcArchivesContent;
+import com.sifu.sfcc.model.UmsMember;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class CcArchivesExport implements Serializable {
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "档案编号")
+    private String code;
+
+    @ApiModelProperty(value = "公司名称")
+    private String name;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "公司地址")
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "紧迫性")
+    private String urgency;
+
+    @ApiModelProperty(value = "电话")
+    private Long phone;
+    
+    @ApiModelProperty(value = "标签")
+    private String label;
+    
+    @ApiModelProperty(value = "创建人")
+    private Long createdBy;
+    
+    @ApiModelProperty(value = "创建人部门")
+    private String deptName;
+    
+    @ApiModelProperty(value = "坐席")
+    private String sitDown;
+    
+    @ApiModelProperty(value = "创建时间")
+    private String createdTime;
+
+    @ApiModelProperty(value = "更新人")
+    private Long updatedBy;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updatedTime;
+    
+    @ApiModelProperty(value = "服务内容")
+    private List<CcArchivesContent> contents;
+    
+    @ApiModelProperty(value = "来电记录")
+    private List<UmsMember> calls;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUrgency() {
+        return urgency;
+    }
+
+    public void setUrgency(String urgency) {
+        this.urgency = urgency;
+    }
+
+    public Long getPhone() {
+		return phone;
+	}
+
+	public void setPhone(Long phone) {
+		this.phone = phone;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public Long getCreatedBy() {
+        return createdBy;
+    }
+
+    public void setCreatedBy(Long createdBy) {
+        this.createdBy = createdBy;
+    } 
+    
+    public String getSitDown() {
+		return sitDown;
+	}
+
+	public void setSitDown(String sitDown) {
+		this.sitDown = sitDown;
+	}
+
+	public String getDeptName() {
+		return deptName;
+	}
+
+	public void setDeptName(String deptName) {
+		this.deptName = deptName;
+	}
+
+	public String getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(String createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Long getUpdatedBy() {
+        return updatedBy;
+    }
+
+    public void setUpdatedBy(Long updatedBy) {
+        this.updatedBy = updatedBy;
+    }
+
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+	public List<CcArchivesContent> getContents() {
+		return contents;
+	}
+
+	public void setContents(List<CcArchivesContent> contents) {
+		this.contents = contents;
+	}
+
+	public List<UmsMember> getCalls() {
+		return calls;
+	}
+
+	public void setCalls(List<UmsMember> calls) {
+		this.calls = calls;
+	}
+
+}

+ 215 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcArchivesParam.java

@@ -0,0 +1,215 @@
+package com.sifu.sfcc.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.sifu.sfcc.model.CcArchivesContent;
+import com.sifu.sfcc.model.UmsMember;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class CcArchivesParam implements Serializable {
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "档案编号")
+    private String code;
+
+    @ApiModelProperty(value = "公司名称")
+    private String name;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "公司地址")
+    private String address;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "紧迫性")
+    private String urgency;
+
+    @ApiModelProperty(value = "电话")
+    private Long phone;
+    
+    @ApiModelProperty(value = "标签")
+    private String label;
+    
+    @ApiModelProperty(value = "创建人")
+    private Long createdBy;
+    
+    @ApiModelProperty(value = "创建人部门")
+    private String deptName;
+    
+    @ApiModelProperty(value = "坐席")
+    private String sitDown;
+    
+    @ApiModelProperty(value = "创建时间")
+    private Date createdTime;
+
+    @ApiModelProperty(value = "更新人")
+    private Long updatedBy;
+
+    @ApiModelProperty(value = "更新时间")
+    private Date updatedTime;
+    
+    @ApiModelProperty(value = "服务内容")
+    private List<CcArchivesContent> contents;
+    
+    @ApiModelProperty(value = "来电记录")
+    private List<UmsMember> calls;
+    
+    @ApiModelProperty(value = "数量")
+    private long count;
+    
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUrgency() {
+        return urgency;
+    }
+
+    public void setUrgency(String urgency) {
+        this.urgency = urgency;
+    }
+
+    public Long getPhone() {
+		return phone;
+	}
+
+	public void setPhone(Long phone) {
+		this.phone = phone;
+	}
+
+	public String getLabel() {
+		return label;
+	}
+
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	public Long getCreatedBy() {
+        return createdBy;
+    }
+
+    public void setCreatedBy(Long createdBy) {
+        this.createdBy = createdBy;
+    } 
+    
+    public String getSitDown() {
+		return sitDown;
+	}
+
+	public void setSitDown(String sitDown) {
+		this.sitDown = sitDown;
+	}
+
+	public String getDeptName() {
+		return deptName;
+	}
+
+	public void setDeptName(String deptName) {
+		this.deptName = deptName;
+	}
+
+	public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Long getUpdatedBy() {
+        return updatedBy;
+    }
+
+    public void setUpdatedBy(Long updatedBy) {
+        this.updatedBy = updatedBy;
+    }
+
+    public Date getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Date updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+	public List<CcArchivesContent> getContents() {
+		return contents;
+	}
+
+	public void setContents(List<CcArchivesContent> contents) {
+		this.contents = contents;
+	}
+
+	public List<UmsMember> getCalls() {
+		return calls;
+	}
+
+	public void setCalls(List<UmsMember> calls) {
+		this.calls = calls;
+	}
+
+	public long getCount() {
+		return count;
+	}
+
+	public void setCount(long count) {
+		this.count = count;
+	}
+	
+
+}

+ 183 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcCallTaskParam.java

@@ -0,0 +1,183 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Date;
+
+public class CcCallTaskParam implements Serializable {
+    private Long id;
+
+    @ApiModelProperty(value = "项目名称")
+    private String title;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "0未开始,1进行中,2已结束")
+    private Integer status;
+
+    @ApiModelProperty(value = "外呼号")
+    private String filter;
+
+    @ApiModelProperty(value = "坐席号")
+    private String agent;
+
+    @ApiModelProperty(value = "是否去重 0是 1否 默认0是")
+    private Integer removeRepetition;
+
+    @ApiModelProperty(value = "ivr流程id")
+    private Integer ivrId;
+
+    @ApiModelProperty(value = "最大振铃时长 单位/秒(默认60)")
+    private String maxRingTime;
+
+    @ApiModelProperty(value = "问卷模板")
+    private Long naireId;
+
+    @ApiModelProperty(value = "创建人")
+    private Long createdBy;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createdTime;
+    
+    @ApiModelProperty(value = "问卷名称")
+    private String naireTitle;
+    
+    @ApiModelProperty(value = "任务id")
+    private String actionId;
+    
+    @ApiModelProperty(value = "姓名")
+    private String username;
+    
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getFilter() {
+        return filter;
+    }
+
+    public void setFilter(String filter) {
+        this.filter = filter;
+    }
+
+    public String getAgent() {
+        return agent;
+    }
+
+    public void setAgent(String agent) {
+        this.agent = agent;
+    }
+
+    public Integer getRemoveRepetition() {
+        return removeRepetition;
+    }
+
+    public void setRemoveRepetition(Integer removeRepetition) {
+        this.removeRepetition = removeRepetition;
+    }
+
+    public Integer getIvrId() {
+        return ivrId;
+    }
+
+    public void setIvrId(Integer ivrId) {
+        this.ivrId = ivrId;
+    }
+
+    public String getMaxRingTime() {
+        return maxRingTime;
+    }
+
+    public void setMaxRingTime(String maxRingTime) {
+        this.maxRingTime = maxRingTime;
+    }
+
+    public Long getNaireId() {
+        return naireId;
+    }
+
+    public void setNaireId(Long naireId) {
+        this.naireId = naireId;
+    }
+
+    public Long getCreatedBy() {
+        return createdBy;
+    }
+
+    public void setCreatedBy(Long createdBy) {
+        this.createdBy = createdBy;
+    }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+    
+
+    public String getNaireTitle() {
+		return naireTitle;
+	}
+
+	public void setNaireTitle(String naireTitle) {
+		this.naireTitle = naireTitle;
+	}
+	
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getActionId() {
+		return actionId;
+	}
+
+	public void setActionId(String actionId) {
+		this.actionId = actionId;
+	}
+
+	@Override
+	public String toString() {
+		return "CcCallTaskParam [id=" + id + ", title=" + title + ", remark=" + remark + ", status=" + status
+				+ ", filter=" + filter + ", agent=" + agent + ", removeRepetition=" + removeRepetition + ", ivrId="
+				+ ivrId + ", maxRingTime=" + maxRingTime + ", naireId=" + naireId + ", createdBy=" + createdBy
+				+ ", createdTime=" + createdTime + ", naireTitle=" + naireTitle + "]";
+	}
+
+}

+ 32 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcDealerParam.java

@@ -0,0 +1,32 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+@ApiModel
+public class CcDealerParam {
+    @ApiModelProperty(value = "工单编号")
+    @NotBlank(message = "工单编号必填!")
+    private String worderNo;
+
+    @ApiModelProperty(value = "负责人编号")
+    @NotBlank(message = "负责人编号必填!")
+    private String dealerCode;
+
+    public String getWorderNo() {
+        return worderNo;
+    }
+
+    public void setWorderNo(String worderNo) {
+        this.worderNo = worderNo;
+    }
+
+    public String getDealerCode() {
+        return dealerCode;
+    }
+
+    public void setDealerCode(String dealerCode) {
+        this.dealerCode = dealerCode;
+    }
+}

+ 133 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcNaireQuestionParam.java

@@ -0,0 +1,133 @@
+package com.sifu.sfcc.dto;
+
+import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class CcNaireQuestionParam implements Serializable {
+    private Long id;
+
+    private Long naireId;
+
+    @ApiModelProperty(value = "题目")
+    private String title;
+
+    @ApiModelProperty(value = "问题类型")
+    private Integer type;
+    
+    @ApiModelProperty(value = "问卷名称")
+    private String naireTitle;
+    
+    @ApiModelProperty(value = "是否第一个问题0:不是,1:是")
+    private Integer isFirst;
+
+    @ApiModelProperty(value = "是的下个id")
+    private Long isTrueId;
+
+    @ApiModelProperty(value = "否的下个id")
+    private Long isFalseId;
+
+    @ApiModelProperty(value = "文本类下一个")
+    private Long nextId;
+
+    @ApiModelProperty(value = "状态(0:新创建,1:配置完成)")
+    private Integer status;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getNaireId() {
+        return naireId;
+    }
+
+    public void setNaireId(Long naireId) {
+        this.naireId = naireId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    
+    public String getNaireTitle() {
+		return naireTitle;
+	}
+
+	public void setNaireTitle(String naireTitle) {
+		this.naireTitle = naireTitle;
+	}
+
+	public Integer getIsFirst() {
+		return isFirst;
+	}
+
+	public void setIsFirst(Integer isFirst) {
+		this.isFirst = isFirst;
+	}
+
+	public Long getIsTrueId() {
+		return isTrueId;
+	}
+
+	public void setIsTrueId(Long isTrueId) {
+		this.isTrueId = isTrueId;
+	}
+
+	public Long getNextId() {
+		return nextId;
+	}
+
+	public void setNextId(Long nextId) {
+		this.nextId = nextId;
+	}
+
+	public Long getIsFalseId() {
+		return isFalseId;
+	}
+
+	public void setIsFalseId(Long isFalseId) {
+		this.isFalseId = isFalseId;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", naireId=").append(naireId);
+        sb.append(", title=").append(title);
+        sb.append(", type=").append(type);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+
+}

+ 57 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcScoreParam.java

@@ -0,0 +1,57 @@
+package com.sifu.sfcc.dto;
+
+import java.io.Serializable;
+
+public class CcScoreParam implements Serializable {
+	
+	private static final long serialVersionUID = 1L;
+	
+	private String phone;
+	
+	private String sessionId;
+	
+	private String code;
+	
+	private String isPerson;
+	
+	private String score;
+	
+	public String getPhone() {
+		return phone;
+	}
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+	public String getSessionId() {
+		return sessionId;
+	}
+	public void setSessionId(String sessionId) {
+		this.sessionId = sessionId;
+	}
+	public String getCode() {
+		return code;
+	}
+	public void setCode(String code) {
+		this.code = code;
+	}
+	public String getIsPerson() {
+		return isPerson;
+	}
+	public void setIsPerson(String isPerson) {
+		this.isPerson = isPerson;
+	}
+	public String getScore() {
+		return score;
+	}
+	public void setScore(String score) {
+		this.score = score;
+	}
+	@Override
+	public String toString() {
+		return "CcScoreParam [phone=" + phone + ", sessionId=" + sessionId + ", code=" + code + ", isPerson=" + isPerson
+				+ ", score=" + score + "]";
+	}
+
+    
+
+}

+ 32 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorderLabelParam.java

@@ -0,0 +1,32 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class CcWorderLabelParam {
+    @ApiModelProperty(value = "工单标签")
+    @NotBlank(message = "工单标签不能为空!")
+    private String label;
+    @ApiModelProperty(value = "工单编号")
+    @NotBlank(message = "工单编号不能为空!")
+    private String worderNo;
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getWorderNo() {
+        return worderNo;
+    }
+
+    public void setWorderNo(String worderNo) {
+        this.worderNo = worderNo;
+    }
+}

+ 78 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorkOrderCount.java

@@ -0,0 +1,78 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel("工单数量")
+public class CcWorkOrderCount implements Serializable {
+
+    @ApiModelProperty(value = "工单状态")
+    private int status;
+    
+    @ApiModelProperty(value = "对应工单数量")
+    private long count;
+    
+    @ApiModelProperty(value = "工单总数")
+    private long total;
+    
+    @ApiModelProperty(value = "开始日期")
+    private String startTime;
+    
+    @ApiModelProperty(value = "结束日期")
+    private String endTime;
+    
+    @ApiModelProperty(value = "处理人")
+    private Long dealerId;
+
+	public int getStatus() {
+		return status;
+	}
+
+	public void setStatus(int status) {
+		this.status = status;
+	}
+
+	public long getCount() {
+		return count;
+	}
+
+	public void setCount(long count) {
+		this.count = count;
+	}
+
+	public long getTotal() {
+		return total;
+	}
+
+	public void setTotal(long total) {
+		this.total = total;
+	}
+
+	public String getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public Long getDealerId() {
+		return dealerId;
+	}
+
+	public void setDealerId(Long dealerId) {
+		this.dealerId = dealerId;
+	}
+    
+    
+    
+}

+ 196 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/CcWorkOrderParam.java

@@ -0,0 +1,196 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+@ApiModel("工单创建")
+public class CcWorkOrderParam implements Serializable {
+
+
+    @ApiModelProperty(value = "档案编号", required = true)
+    @NotBlank(message = "档案编号不能为空!")
+    private String archivesCode;
+
+    @ApiModelProperty(value = "工单类型 0:工单流转")
+    @NotBlank(message = "工单类型不能为空!")
+    private String  type;
+
+    @ApiModelProperty(value = "工单内容", required = true)
+//    @NotBlank(message = "工单内容不能为空!")
+    private String content;
+
+    @ApiModelProperty(value = "工单标题", required = true)
+//    @NotBlank(message = "工单内容不能为空!")
+    private String title;
+
+    @ApiModelProperty(value = "发起人id 关联ums_member")
+    private Long createId;
+
+    @ApiModelProperty(value = "负责人/处理人id")
+    private Long dealerId;
+
+    @ApiModelProperty(value = "客户电话",required = true)
+    @NotBlank(message = "客户电话不能为空!")
+    private String phone;
+
+    @ApiModelProperty(value = "客户姓名",required = true)
+    @NotBlank(message = "客户姓名不能为空!")
+    private String name;
+
+    @ApiModelProperty(value = "客户地址",required = true)
+    @NotBlank(message = "客户地址不能为空!")
+    private String addr;
+
+    @ApiModelProperty(value = "客户邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "客户联系人")
+    private String concat;
+
+    @ApiModelProperty(value = "客户标签")
+    private String label;
+
+    @ApiModelProperty(value = "档案备份内容")
+    private String archivesRemark;
+
+    @ApiModelProperty(value = "工单备注")
+    private String remark;
+
+    @ApiModelProperty(value = "工单超时关闭时间")
+    private String  submitTime;
+    
+    @ApiModelProperty(value = "sessionId")
+    private String sessionId;
+    
+    public String getSubmitTime() {
+        return submitTime;
+    }
+
+    public void setSubmitTime(String submitTime) {
+        this.submitTime = submitTime;
+    }
+
+    public String getArchivesCode() {
+        return archivesCode;
+    }
+
+    public void setArchivesCode(String archivesCode) {
+        this.archivesCode = archivesCode;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddr() {
+        return addr;
+    }
+
+    public void setAddr(String addr) {
+        this.addr = addr;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getArchivesRemark() {
+        return archivesRemark;
+    }
+
+    public void setArchivesRemark(String archivesRemark) {
+        this.archivesRemark = archivesRemark;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+    public Long getDealerId() {
+        return dealerId;
+    }
+
+    public void setDealerId(Long dealerId) {
+        this.dealerId = dealerId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getConcat() {
+        return concat;
+    }
+
+    public void setConcat(String concat) {
+        this.concat = concat;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+    
+    public String getSessionId() {
+        return sessionId;
+    }
+
+    public void setSessionId(String sessionId) {
+        this.sessionId = sessionId;
+    }
+
+}

+ 31 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/IndexParam.java

@@ -0,0 +1,31 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+/**
+ * 首页参数
+ * Created by commerce on 2021/12/08.
+ */
+@Getter
+@Setter
+@ToString
+public class IndexParam {
+    @ApiModelProperty(value = "工单总量")
+    private long workOrderCount;
+    @ApiModelProperty(value = "档案总量")
+    private long archivesCount;
+    @ApiModelProperty(value = "固定标签筛选出来的档案总量")
+    private long totalCount;
+    @ApiModelProperty(value = "用户总量")
+    private long memberCount;
+    @ApiModelProperty(value = "部门数")
+    private long deptCount;
+    @ApiModelProperty(value = "知识库总量")
+    private long knowledgeCount;
+    @ApiModelProperty(value = "在线AI数量")
+    private long aiCount;
+    @ApiModelProperty(value = "评价数量")
+    private long scoreCount;
+}

+ 34 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/MinioUploadDto.java

@@ -0,0 +1,34 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 文件上传返回结果
+ * Created by commerce on 2019/12/25.
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class MinioUploadDto {
+    @ApiModelProperty("文件访问URL")
+    private String url;
+    @ApiModelProperty("文件名称")
+    private String name;
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 29 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/PolicyParam.java

@@ -0,0 +1,29 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class PolicyParam {
+	 @ApiModelProperty(value = "政策个数")
+	 private long count;
+	 
+	 @ApiModelProperty(value = "政策名称")
+	 private String policyTitle;
+
+	public long getCount() {
+		return count;
+	}
+
+	public void setCount(long count) {
+		this.count = count;
+	}
+
+	public String getPolicyTitle() {
+		return policyTitle;
+	}
+
+	public void setPolicyTitle(String policyTitle) {
+		this.policyTitle = policyTitle;
+	}
+
+	
+}

+ 62 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/ProjectParam.java

@@ -0,0 +1,62 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class ProjectParam {
+	 @ApiModelProperty(value = "项目个数")
+	 private long count;
+	 
+	 @ApiModelProperty(value = "项目名称")
+	 private String projectName;
+	 
+	 @ApiModelProperty(value = "项目类型")
+	 private String projectType;
+	 
+	 @ApiModelProperty(value = "项目总个数")
+	 private long totalCount;
+	 
+	 @ApiModelProperty(value = "地区")
+	 private String location;
+
+	public long getCount() {
+		return count;
+	}
+
+	public void setCount(long count) {
+		this.count = count;
+	}
+
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+
+	public String getProjectType() {
+		return projectType;
+	}
+
+	public void setProjectType(String projectType) {
+		this.projectType = projectType;
+	}
+
+	public long getTotalCount() {
+		return totalCount;
+	}
+
+	public void setTotalCount(long totalCount) {
+		this.totalCount = totalCount;
+	}
+
+	public String getLocation() {
+		return location;
+	}
+
+	public void setLocation(String location) {
+		this.location = location;
+	}
+	
+	
+}

+ 43 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/SmsHomeAdvertiseParam.java

@@ -0,0 +1,43 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+
+@Data
+public class SmsHomeAdvertiseParam {
+    private Long id;
+
+    private String name;
+
+    @ApiModelProperty(value = "轮播位置:0->PC首页轮播;1->app首页轮播")
+    private Integer type;
+
+    private String pic;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+
+    @ApiModelProperty(value = "上下线状态:0->下线;1->上线")
+    private Integer status;
+
+    @ApiModelProperty(value = "点击数")
+    private Integer clickCount;
+
+    @ApiModelProperty(value = "链接地址")
+    private String url;
+
+    @ApiModelProperty(value = "备注")
+    private String note;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    private static final long serialVersionUID = 1L;
+}

+ 34 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsAdminLoginParam.java

@@ -0,0 +1,34 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * 用户登录参数
+ * Created by commerce on 2018/4/26.
+ */
+public class UmsAdminLoginParam {
+    @ApiModelProperty(value = "用户名", required = true)
+    @NotEmpty(message = "用户名不能为空")
+    private String username;
+    @ApiModelProperty(value = "密码", required = true)
+    @NotEmpty(message = "密码不能为空")
+    private String password;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

+ 34 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsAdminParam.java

@@ -0,0 +1,34 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * 用户登录参数
+ * Created by commerce on 2018/4/26.
+ */
+@Getter
+@Setter
+@ToString
+public class UmsAdminParam {
+    @ApiModelProperty(value = "用户名", required = true)
+    @NotEmpty(message = "用户名不能为空")
+    private String username;
+    @ApiModelProperty(value = "密码", required = true)
+    @NotEmpty(message = "密码不能为空")
+    private String password;
+    @ApiModelProperty(value = "用户头像")
+    private String icon;
+    @ApiModelProperty(value = "邮箱")
+    @Email(message = "邮箱格式不合法")
+    private String email;
+    @ApiModelProperty(value = "用户昵称")
+    private String nickName;
+    @ApiModelProperty(value = "备注")
+    private String note;
+}

+ 40 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsCustomerServiceParam.java

@@ -0,0 +1,40 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotEmpty;
+
+public class UmsCustomerServiceParam {
+    @ApiModelProperty(value = "用户名", required = true)
+    @NotEmpty(message = "用户名不能为空")
+    private String username;
+    @ApiModelProperty(value = "密码", required = true)
+    @NotEmpty(message = "密码不能为空")
+    private String password;
+    @ApiModelProperty(value = "用户昵称")
+    private String nickName;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+}

+ 17 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsMenuNode.java

@@ -0,0 +1,17 @@
+package com.sifu.sfcc.dto;
+
+import com.sifu.sfcc.model.UmsMenu;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 后台菜单节点封装
+ * Created by sifu on 2020/2/4.
+ */
+@Getter
+@Setter
+public class UmsMenuNode extends UmsMenu {
+    private List<UmsMenuNode> children;
+}

+ 20 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UmsPermissionNode.java

@@ -0,0 +1,20 @@
+package com.sifu.sfcc.dto;
+
+import com.sifu.sfcc.model.UmsPermission;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 后台权限节点封装
+ * Created by sifu on 2018/9/30.
+ */
+public class UmsPermissionNode extends UmsPermission {
+    @Getter
+    @Setter
+    private List<UmsPermissionNode> children;
+
+    public void setChildren(List<UmsPermissionNode> children) {
+    }
+}

+ 37 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/dto/UpdateAdminPasswordParam.java

@@ -0,0 +1,37 @@
+package com.sifu.sfcc.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * 修改用户名密码参数
+ * Created by commerce on 2019/10/9.
+ */
+@Getter
+@Setter
+public class UpdateAdminPasswordParam {
+    @ApiModelProperty(value = "用户名", required = true)
+    @NotEmpty(message = "用户名不能为空")
+    private String username;
+    @ApiModelProperty(value = "旧密码", required = true)
+    @NotEmpty(message = "旧密码不能为空")
+    private String oldPassword;
+    @ApiModelProperty(value = "新密码", required = true)
+    @NotEmpty(message = "新密码不能为空")
+    private String newPassword;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public CharSequence getOldPassword() {
+        return oldPassword;
+    }
+
+    public CharSequence getNewPassword() {
+        return newPassword;
+    }
+}

+ 70 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/entity/ws/MsgPackage.java

@@ -0,0 +1,70 @@
+package com.sifu.sfcc.entity.ws;
+
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiParam;
+
+public class MsgPackage {
+
+    @ApiModelProperty(value = "通道发送人")
+    private String channelFrom;
+    @ApiModelProperty(value = "通道接收人")
+    private String channelTo;
+    @ApiModelProperty(value = "通道类型 1001(广播)、1002 (单通道)")
+    private Integer chnnelType;
+    @ApiModelProperty(value = "消息内容")
+    private String msg;
+    @ApiModelProperty(value = "业务类型 1003(待办)、1004(催报)")
+    private Integer msgType;
+
+    @ApiModelProperty(value = "产生的原因)")
+    private Integer action;
+
+
+    public String getChannelFrom() {
+        return channelFrom;
+    }
+
+    public void setChannelFrom(String channelFrom) {
+        this.channelFrom = channelFrom;
+    }
+
+    public String getChannelTo() {
+        return channelTo;
+    }
+
+    public void setChannelTo(String channelTo) {
+        this.channelTo = channelTo;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Integer getChnnelType() {
+        return chnnelType;
+    }
+
+    public void setChnnelType(Integer chnnelType) {
+        this.chnnelType = chnnelType;
+    }
+
+    public Integer getMsgType() {
+        return msgType;
+    }
+
+    public void setMsgType(Integer msgType) {
+        this.msgType = msgType;
+    }
+
+    public Integer getAction() {
+        return action;
+    }
+
+    public void setAction(Integer action) {
+        this.action = action;
+    }
+}

+ 35 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/enums/ApproveStatusEnum.java

@@ -0,0 +1,35 @@
+package com.sifu.sfcc.enums;
+
+public enum ApproveStatusEnum {
+    TO_RECIEVE(0,"待接收"),
+    RECIEVED(1,"接收"),
+    REJECT(2,"拒收"),
+    PASSED(3,"结单/已处理"),
+    MOVED(4,"转办"),
+    WITHDRAW(5,"撤回"),
+    REMID(6,"催办"),
+    CANCEl(7,"作废"),
+    ;
+    ApproveStatusEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+    private Integer code;
+    private String name;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 40 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/enums/QueueEnum.java

@@ -0,0 +1,40 @@
+package com.sifu.sfcc.enums;
+
+import lombok.Getter;
+
+/**
+ * 消息队列枚举配置
+ * Created by macro on 2018/9/14.
+ */
+@Getter
+public enum QueueEnum {
+    /**
+     * 商品下架
+     * 消息通知队列
+     */
+    QUEUE_GROUP_CLOSE("mall.group.direct", "mall.group.close", "mall.group.close"),
+    /**
+     * 商品下架
+     * 消息通知ttl队列
+     */
+    QUEUE_TTL_GROUP_CLOSE("mall.group.direct.ttl", "mall.group.close.ttl", "mall.group.close.ttl");
+
+    /**
+     * 交换名称
+     */
+    private String exchange;
+    /**
+     * 队列名称
+     */
+    private String name;
+    /**
+     * 路由键
+     */
+    private String routeKey;
+
+    QueueEnum(String exchange, String name, String routeKey) {
+        this.exchange = exchange;
+        this.name = name;
+        this.routeKey = routeKey;
+    }
+}

+ 44 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/enums/WorderStatusEnum.java

@@ -0,0 +1,44 @@
+package com.sifu.sfcc.enums;
+
+/***
+ * 工单状态
+ */
+public enum WorderStatusEnum {
+
+    /**
+     *初始化
+     */
+    INIT(0),
+    /***
+     * 处理中
+     */
+    PENDING(1),
+    /**
+     * 已完成
+     */
+    FINISH(2),
+    /**
+     * 作废
+     */
+    INVALID(3),
+    /**
+     * 已完成
+     */
+    TIME_OUT(4),
+    ;
+    WorderStatusEnum(Integer code){
+        this.code = code;
+
+    }
+
+    private Integer code;
+
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+}

+ 35 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/enums/ws/MsgTypeEnum.java

@@ -0,0 +1,35 @@
+package com.sifu.sfcc.enums.ws;
+
+public enum MsgTypeEnum {
+    TYPE_BROADCAST(1001,"msg_b"),//广播 消息
+    TYPE_SINGLE(1002,"msg_s"),//单条 普通消息
+
+    TYPE_QRY_TODO(1003,"msg_q_t"),//查询待办
+    TYPE_REMIND_TODO(1004,"msg_r_t"),//催办待办
+//    TYPE_MOVE_TODO(1005,"msg_m_t"),//转办消息
+//    TYPE_REJECT_TODO(1006,"msg_r_t"),//拒收
+
+    ;
+    private Integer type;
+    private String typeName;
+    MsgTypeEnum(Integer type ,String typeName){
+        this.type = type;
+        this.typeName = typeName;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName;
+    }
+}

+ 163 - 0
sfcc-admin/src/main/java/com/sifu/sfcc/service/CCWebSocket.java

@@ -0,0 +1,163 @@
+package com.sifu.sfcc.service;
+
+import com.alibaba.excel.util.CollectionUtils;
+import com.sifu.sfcc.common.exception.ApiException;
+import com.sifu.sfcc.entity.ws.MsgPackage;
+import com.sifu.sfcc.enums.ws.MsgTypeEnum;
+import com.sifu.sfcc.util.MsgUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+import javax.websocket.*;
+import javax.websocket.server.PathParam;
+import javax.websocket.server.ServerEndpoint;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
+@ServerEndpoint(value = "/cc/{userId}")
+@Component
+public class CCWebSocket {
+    private static ConcurrentHashMap<String, Session> sessionPools = new ConcurrentHashMap<String, Session>();
+    private static AtomicInteger online = new AtomicInteger();
+
+    public CCWebSocket() {
+        System.out.println("CCWebSocket");
+    }
+
+    @OnOpen
+    public void onOpen(Session session, @PathParam(value = "userId") String userId) {
+        sessionPools.put(userId, session);
+
+    }
+
+    /**
+     * 关闭连接时调用
+     *
+     * @param userid userid
+     */
+    @OnClose
+    public void onClose(@PathParam(value = "userid") String userid) {
+        sessionPools.remove(userid);
+        //subOnlineCount();
+    }
+
+    public void sendMessage(MsgPackage pkg)  {
+        try{
+            sendMessage(MsgUtils.gson.toJson(pkg));
+        }catch(Exception e){
+            e.printStackTrace();
+            throw new ApiException("发送消息异常");
+        }
+
+    }
+
+    /***
+     * 核心业务发送方法
+     * @param message
+     * @throws IOException
+     */
+    public void sendMessage(String message) throws IOException {
+        MsgPackage msgPkg = null;
+        try {
+            msgPkg = MsgUtils.gson.fromJson(message, MsgPackage.class);
+        } catch (Exception e) {
+            throw new ApiException("解析消息异常");
+        }
+        Integer chnnelType = msgPkg.getChnnelType();
+        Optional<MsgTypeEnum> channelTypeEnum = Arrays.stream(MsgTypeEnum.values()).filter(e -> e.getType().equals(chnnelType)).findFirst();
+        if (Optional.<MsgTypeEnum>empty() == channelTypeEnum || (channelTypeEnum.get() != MsgTypeEnum.TYPE_BROADCAST && channelTypeEnum.get() != MsgTypeEnum.TYPE_SINGLE)) {
+            throw new ApiException("消息通道类型非法");
+        }
+        Integer msgType = msgPkg.getMsgType();
+        Optional<MsgTypeEnum> msgTypeEnum = Arrays.stream(MsgTypeEnum.values()).filter(e -> e.getType().equals(msgType)).findFirst();
+        if(Optional.<MsgTypeEnum>empty() == msgTypeEnum){
+            throw new ApiException("业务类型非法");
+        }
+
+//        switch(msgTypeEnum.get()){
+//            case TYPE_QRY_TODO://查询待办
+//                break;
+//            case TYPE_REMIND_TODO://催办
+//                break;
+//        }
+        if(CollectionUtils.isEmpty(sessionPools)){
+            return;
+        }
+        switch (channelTypeEnum.get()) {
+            case TYPE_BROADCAST:
+                for(Session sendSession :sessionPools.values()){
+                    if(sendSession.isOpen()){
+                        sendSession.getBasicRemote().sendText(message);
+                    }
+
+                }
+                break;
+            case TYPE_SINGLE:
+                Session sendSession = null;
+                for(String userId : sessionPools.keySet()){
+                    if(userId.equals(msgPkg.getChannelTo())){
+                        sendSession = sessionPools.get(userId);
+                    }
+                }
+                if(!ObjectUtils.isEmpty(sendSession)){
+                    if(sendSession.isOpen()){
+                        sendSession.getBasicRemote().sendText(message);
+                    }
+
+                }
+                break;
+        }
+
+    }
+
+    /**
+     * 收到客户端消息时触发(群发)
+     *
+     * @param message
+     * @throws IOException
+     */
+    @OnMessage
+    public void onMessage(String message) throws IOException {
+        sendMessage(message);
+    }
+
+    /**
+     * 发生错误时候
+     *
+     * @param session
+     * @param throwable
+     */
+    @OnError
+    public void onError(Session session, Throwable throwable) {
+        System.out.println("发生错误");
+        throwable.printStackTrace();
+    }
+
+    /**
+     * 给指定用户发送消息
+     *
+     * @param userid  userid
+     * @param message 消息
+     * @throws IOException
+     */
+    public void sendInfo(String userid, String message) {
+        Session session = sessionPools.get(userid);
+        try {
+            session.getBasicRemote().sendText(message);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void addOnlineCount() {
+        online.incrementAndGet();
+    }
+
+    public static void subOnlineCount() {
+        online.decrementAndGet();
+    }
+
+}

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