├── .gitee └── ISSUE_TEMPLATE │ ├── bug.yml │ ├── config.yaml │ └── feature.yml ├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── autotag.sh ├── origin_gitee.sh ├── origin_gitlab.sh ├── pom.xml └── src ├── .DS_Store └── main ├── .DS_Store └── java └── neatlogic └── framework └── knowledge ├── auth └── label │ └── KNOWLEDGE.java ├── constvalue ├── KnowledgeDocumentLineHandler.java ├── KnowledgeDocumentOperate.java ├── KnowledgeDocumentVersionStatus.java ├── KnowledgeFullTextIndexType.java └── KnowledgeType.java ├── dao └── mapper │ ├── KnowledgeCircleMapper.java │ ├── KnowledgeCircleMapper.xml │ ├── KnowledgeDocumentAuditMapper.java │ ├── KnowledgeDocumentAuditMapper.xml │ ├── KnowledgeDocumentMapper.java │ ├── KnowledgeDocumentMapper.xml │ ├── KnowledgeDocumentTypeMapper.java │ ├── KnowledgeDocumentTypeMapper.xml │ ├── KnowledgeTagMapper.java │ ├── KnowledgeTagMapper.xml │ ├── KnowledgeTemplateMapper.java │ └── KnowledgeTemplateMapper.xml ├── dto ├── KnowledgeCircleUserVo.java ├── KnowledgeCircleVo.java ├── KnowledgeDocumentAuditDetailVo.java ├── KnowledgeDocumentAuditVo.java ├── KnowledgeDocumentCollectVo.java ├── KnowledgeDocumentFileVo.java ├── KnowledgeDocumentHistoricalVersionVo.java ├── KnowledgeDocumentInvokeVo.java ├── KnowledgeDocumentLineConfigVo.java ├── KnowledgeDocumentLineContentVo.java ├── KnowledgeDocumentLineVo.java ├── KnowledgeDocumentTagVo.java ├── KnowledgeDocumentTypeVo.java ├── KnowledgeDocumentVersionStatusVo.java ├── KnowledgeDocumentVersionVo.java ├── KnowledgeDocumentVo.java ├── KnowledgeTagVo.java ├── KnowledgeTemplateVo.java ├── KnowledgeTypeVo.java └── SyncSourceVo.java ├── exception ├── KnowledgeCircleHasKnowledgeException.java ├── KnowledgeCircleNameRepeatException.java ├── KnowledgeCircleNotFoundEditTargetException.java ├── KnowledgeCircleNotFoundException.java ├── KnowledgeDocumentCurrentUserNotMemberException.java ├── KnowledgeDocumentCurrentUserNotOwnerException.java ├── KnowledgeDocumentCurrentUserNotReviewerException.java ├── KnowledgeDocumentCurrentVersionCannotBeDeletedException.java ├── KnowledgeDocumentDraftExpiredCannotBeModifiedException.java ├── KnowledgeDocumentDraftExpiredCannotSubmitException.java ├── KnowledgeDocumentDraftPublishedCannotBeModifiedException.java ├── KnowledgeDocumentDraftReviewedException.java ├── KnowledgeDocumentDraftSubmitFailedExecption.java ├── KnowledgeDocumentDraftSubmittedCannotBeDeletedException.java ├── KnowledgeDocumentDraftSubmittedCannotBeModifiedException.java ├── KnowledgeDocumentDraftSubmittedException.java ├── KnowledgeDocumentDraftUnsubmittedCannotBeReviewedException.java ├── KnowledgeDocumentHasBeenCollectedException.java ├── KnowledgeDocumentHasBeenDeletedException.java ├── KnowledgeDocumentHasBeenFavoredException.java ├── KnowledgeDocumentNotFoundEditTargetException.java ├── KnowledgeDocumentNotFoundException.java ├── KnowledgeDocumentNotHistoricalVersionException.java ├── KnowledgeDocumentRepeatInvokeException.java ├── KnowledgeDocumentTitleRepeatException.java ├── KnowledgeDocumentTypeNotFoundException.java ├── KnowledgeDocumentUnmodifiedCannotBeSavedException.java ├── KnowledgeDocumentVersionNotFoundEditTargetException.java ├── KnowledgeDocumentVersionNotFoundException.java ├── KnowledgeDocumentVersionSwitchFailedExecption.java ├── KnowledgeTemplateNameRepeatException.java ├── KnowledgeTemplateNotFoundEditTargetException.java └── KnowledgeTemplateNotFoundException.java ├── linehandler └── core │ └── KnowledgeLineHandlerBase.java └── source ├── ISyncSource.java └── SyncSourceFactory.java /.gitee/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: Bug 反馈 2 | description: 当你在系统中发现了一个 Bug,导致应用崩溃或抛出异常,或者有一个组件存在问题,或者某些地方看起来不对劲。 3 | title: "[Bug]: " 4 | labels: ["bug"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | 感谢对项目的支持与关注。在提出问题之前,请确保你已查看相关开发或使用文档: 10 | - https://gitee.com/neat-logic/neatlogic-itom-all 的readme,对neatlogic系统服务架构有个整体认知. 11 | 然后再浏览下neatlogic其它对应模块的readme介绍. 12 | - 社区版在线文档在系统右上角的“问号”图标,文档持续更新中,敬请期待. 13 | - type: dropdown 14 | id: env 15 | attributes: 16 | label: 环境 17 | description: 你在哪个环境发现这个bug? 18 | options: 19 | - 代码构建 (默认) 20 | - docker 21 | - 演示环境 22 | - 本地部署 23 | validations: 24 | required: true 25 | - type: checkboxes 26 | attributes: 27 | label: 这个问题是否已经存在? 28 | options: 29 | - label: 我已经搜索过现有的问题 30 | required: true 31 | - type: textarea 32 | attributes: 33 | label: 如何复现 34 | description: 请详细告诉我们如何复现你遇到的问题,如涉及代码,可提供一个最小代码示例,并使用反引号```附上它 35 | placeholder: | 36 | 1. ... 37 | 2. ... 38 | 3. ... 39 | validations: 40 | required: true 41 | - type: textarea 42 | attributes: 43 | label: 预期结果 44 | description: 请告诉我们你预期会发生什么。 45 | validations: 46 | required: true 47 | - type: textarea 48 | attributes: 49 | label: 实际结果 50 | description: 请告诉我们实际发生了什么。 51 | validations: 52 | required: true 53 | - type: textarea 54 | attributes: 55 | label: 截图或视频 56 | description: 如果可以的话,上传任何关于 bug 的截图。 57 | value: | 58 | [在这里上传图片] 59 | - type: dropdown 60 | id: version 61 | attributes: 62 | label: 版本 63 | description: 你当前正在使用我们软件的哪个版本/分支? 64 | options: 65 | - develop3.0.0 (默认) 66 | validations: 67 | required: true 68 | -------------------------------------------------------------------------------- /.gitee/ISSUE_TEMPLATE/config.yaml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Gitee 帮助中心 4 | url: https://help.gitee.com/ 5 | about: 提供 Git 使用指南、教程、Gitee.com 平台基本功能使用、介绍和常见问题解答 6 | -------------------------------------------------------------------------------- /.gitee/ISSUE_TEMPLATE/feature.yml: -------------------------------------------------------------------------------- 1 | name: 功能建议 2 | description: 对本项目提出一个功能建议 3 | title: "[功能建议]: " 4 | labels: ["enhancement"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | 感谢对项目的支持与关注。感谢提出功能建议,我们将仔细考虑! 10 | 在提出建议之前,请确保你已查看相关开发或使用文档: 11 | - https://gitee.com/neat-logic/neatlogic-itom-all 的readme,对neatlogic系统服务架构有个整体认知. 12 | 然后再浏览下neatlogic其它对应模块的readme介绍. 13 | - 社区版在线文档在系统右上角的“问号”图标,文档持续更新中,敬请期待. 14 | - type: textarea 15 | id: related-problem 16 | attributes: 17 | label: 你的功能建议是否和某个问题相关? 18 | description: 清晰并简洁地描述问题是什么,例如,当我...时,我总是感到困扰。 19 | validations: 20 | required: false 21 | - type: textarea 22 | id: desired-solution 23 | attributes: 24 | label: 你希望看到什么解决方案? 25 | description: 清晰并简洁地描述你希望发生的事情。 26 | validations: 27 | required: true 28 | - type: textarea 29 | id: alternatives 30 | attributes: 31 | label: 你考虑过哪些替代方案? 32 | description: 清晰并简洁地描述你考虑过的任何替代解决方案或功能。 33 | validations: 34 | required: false 35 | - type: textarea 36 | id: additional-context 37 | attributes: 38 | label: 你有其他上下文或截图吗? 39 | description: 在此处添加有关功能请求的任何其他上下文或截图。 40 | validations: 41 | required: false 42 | - type: checkboxes 43 | attributes: 44 | label: 意向参与贡献 45 | options: 46 | - label: 我有意向参与具体功能的开发实现并将代码贡献回到上游社区 47 | required: false 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /target/ 3 | /.settings/ 4 | /.classpath 5 | /.project 6 | *.iml 7 | .flattened-pom.xml 8 | .DS_Store -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options 2 | 3 | build1: 4 | stage: build 5 | only: 6 | - /^develop.*$/ 7 | - /^release.*$/ 8 | script: 9 | - echo "git clone success!" 10 | - if [[ "${CI_COMMIT_REF_NAME}" == "release"* ]]; then sh autotag.sh ${CI_PROJECT_ID} ${CI_COMMIT_SHA}; fi; 11 | 12 | deploy1: 13 | stage: deploy 14 | only: 15 | - /^develop.*$/ 16 | - /^release.*$/ 17 | script: 18 | - export ENV_NAME="develop"; 19 | - if [[ "${CI_COMMIT_REF_NAME}" == "release"* ]]; then ENV_NAME="release"; fi; 20 | - mvn deploy -e --settings /home/gitlab-runner/.m2/settings.xml -P${ENV_NAME} 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /autotag.sh: -------------------------------------------------------------------------------- 1 | #Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. 2 | # 3 | #This program is free software: you can redistribute it and/or modify 4 | #it under the terms of the GNU Affero General Public License as published by 5 | #the Free Software Foundation, either version 3 of the License, or 6 | #(at your option) any later version. 7 | # 8 | #This program is distributed in the hope that it will be useful, 9 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | #GNU Affero General Public License for more details. 12 | # 13 | #You should have received a copy of the GNU Affero General Public License 14 | #along with this program. If not, see . 15 | 16 | POM_VERSION=`cat pom.xml|grep ""|sed -n '2p'` 17 | POM_VERSION=${POM_VERSION#*>} 18 | POM_VERSION=${POM_VERSION%<*} 19 | if [ $POM_VERSION != "" ]; then 20 | PROJECT_ID=$1 21 | REF=$2 22 | curl -H "PRIVATE-TOKEN: 5zWk91yBpWfrbrN5fZDV" -X POST -d "tag_name=$POM_VERSION&ref=$REF" http://192.168.0.82:7070/api/v4/projects/$PROJECT_ID/repository/tags 23 | fi 24 | -------------------------------------------------------------------------------- /origin_gitee.sh: -------------------------------------------------------------------------------- 1 | dir=$(pwd) 2 | echo "[echo] --------$dir-----------" 3 | # 检查是否存在.git目录或.git配置文件 4 | if [ -d ".git" ] || [ -f ".git" ]; then 5 | #如果pushgitee不存在,则先补充pushgitee 6 | is_pushgitee_exist=$(git config --get alias.pushgitee) 7 | if [ -z "$is_pushgitee_exist" ]; then 8 | echo "[echo] 不存在[alias]:pushgitee" 9 | currentProject=$(basename "$(pwd)") 10 | git config alias.pushgitee "push --force git@gitee.com:neat-logic/$currentProject.git" 11 | fi 12 | # 获取origin的URL和pushgitee的URL 13 | origin_url=$(git remote get-url origin) 14 | pushgitee_url=$(git config alias.pushgitee | sed 's/push --force //') 15 | #如果origin不是gitee 16 | pattern="git@gitee.com" 17 | if [[ ! $origin_url == *$pattern* ]]; then 18 | # 如果这两个URL都存在,则交换它们 19 | if [ ! -z "$origin_url" ] && [ ! -z "$pushgitee_url" ]; then 20 | git remote set-url origin "$pushgitee_url" 21 | git config alias.pushgitee "push --force $origin_url" 22 | echo "[echo] origin_url: $origin_url" 23 | echo "[echo] pushgitee_url: $pushgitee_url" 24 | else 25 | echo "[echo] Missing origin or pushgitee URL in $dir" 26 | fi 27 | fi 28 | else 29 | echo "[echo] No git repository in $dir" 30 | fi 31 | echo "[echo] ----------------------" -------------------------------------------------------------------------------- /origin_gitlab.sh: -------------------------------------------------------------------------------- 1 | dir=$(pwd) 2 | echo "[echo] --------$dir-----------" 3 | # 检查是否存在.git目录或.git配置文件 4 | if [ -d ".git" ] || [ -f ".git" ]; then 5 | #如果pushgitee不存在,则先补充pushgitee 6 | is_pushgitee_exist=$(git config --get alias.pushgitee) 7 | if [ -z "$is_pushgitee_exist" ]; then 8 | echo "[echo] 不存在[alias]:pushgitee" 9 | currentProject=$(basename "$(pwd)") 10 | git config alias.pushgitee "push --force git@gitee.com:neat-logic/$currentProject.git" 11 | fi 12 | # 获取origin的URL和pushgitee的URL 13 | origin_url=$(git remote get-url origin) 14 | pushgitee_url=$(git config alias.pushgitee | sed 's/push --force //') 15 | #如果origin是gitee 16 | pattern="git@gitee.com" 17 | if [[ $origin_url == *$pattern* ]]; then 18 | # 如果这两个URL都存在,则交换它们 19 | if [ ! -z "$origin_url" ] && [ ! -z "$pushgitee_url" ]; then 20 | git remote set-url origin "$pushgitee_url" 21 | git config alias.pushgitee "push --force $origin_url" 22 | echo "[echo] origin_url: $origin_url" 23 | echo "[echo] pushgitee_url: $pushgitee_url" 24 | else 25 | echo "[echo] Missing origin or pushgitee URL in $dir" 26 | fi 27 | fi 28 | else 29 | echo "[echo] No git repository in $dir" 30 | fi 31 | echo "[echo] ----------------------" -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 4.0.0 18 | 19 | com.neatlogic 20 | neatlogic-parent 21 | ${revision} 22 | ../neatlogic-parent 23 | 24 | neatlogic-knowledge-base 25 | 0.3.0.0-SNAPSHOT 26 | 27 | 28 | 29 | src/main/java 30 | 31 | **/*.xml 32 | META-INF/** 33 | 34 | 35 | 36 | 37 | 38 | 39 | com.neatlogic 40 | neatlogic-framework 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatlogic/neatlogic-knowledge-base/d743d503635f180715758ddedfef8e5e98af3494/src/.DS_Store -------------------------------------------------------------------------------- /src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatlogic/neatlogic-knowledge-base/d743d503635f180715758ddedfef8e5e98af3494/src/main/.DS_Store -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/auth/label/KNOWLEDGE.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.auth.label; 2 | 3 | import neatlogic.framework.auth.core.AuthBase; 4 | 5 | public class KNOWLEDGE extends AuthBase { 6 | @Override 7 | public String getAuthDisplayName() { 8 | return "知识库基础权限(接口)"; 9 | } 10 | 11 | @Override 12 | public String getAuthIntroduction() { 13 | return "拥有此权限可以通过接口访问知识库一些底层功能,例如查询知识库文件等"; 14 | } 15 | 16 | @Override 17 | public String getAuthGroup() { 18 | return "knowledge"; 19 | } 20 | 21 | @Override 22 | public Integer getSort() { 23 | return 4; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/constvalue/KnowledgeDocumentLineHandler.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.constvalue; 2 | 3 | import neatlogic.framework.knowledge.dto.KnowledgeDocumentLineVo; 4 | import neatlogic.framework.util.$; 5 | 6 | import java.util.function.BiConsumer; 7 | import java.util.function.Function; 8 | 9 | public enum KnowledgeDocumentLineHandler { 10 | 11 | P("p", "段落", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 12 | H1("h1", "一级标题", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 13 | H2("h2", "二级标题", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 14 | IMG("img", "图片", (line) -> line.getConfig().getString("url"), null), 15 | TABLE("table", "表格", (line) -> line.getConfig().getString("tableList"), null), 16 | CODE("code", "代码块", (line) -> line.getConfig().getString("value"), null), 17 | FORMTABLE("formtable", "表单", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 18 | EDITOR("editor", "编辑器", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 19 | UL("ul", "无序列表", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)), 20 | OL("ol", "有序列表", (line) -> line.getContent(), (line, mainBody) -> line.setContent(mainBody)) 21 | ; 22 | private String value; 23 | private String text; 24 | private Function mainBodyGet; 25 | private BiConsumer mainBodySet; 26 | private KnowledgeDocumentLineHandler(String value, String text, Function mainBodyGet, BiConsumer mainBodySet) { 27 | this.value = value; 28 | this.text = text; 29 | this.mainBodyGet = mainBodyGet; 30 | this.mainBodySet = mainBodySet; 31 | } 32 | public String getValue() { 33 | return value; 34 | } 35 | 36 | public String getText() { 37 | return $.t(text); 38 | } 39 | 40 | // public static BiConsumer getMainBodySet(String _value){ 41 | // for(KnowledgeDocumentLineHandler handler : values()) { 42 | // if(handler.value.equals(_value)) { 43 | // return handler.mainBodySet; 44 | // } 45 | // } 46 | // return null; 47 | // } 48 | // public static String getMainBody(KnowledgeDocumentLineVo line){ 49 | // for(KnowledgeDocumentLineHandler handler : values()) { 50 | // if(handler.value.equals(line.getHandler())) { 51 | // if(handler.mainBodyGet != null) { 52 | // return handler.mainBodyGet.apply(line); 53 | // } 54 | // return null; 55 | // } 56 | // } 57 | // return null; 58 | // } 59 | // public static void setMainBody(KnowledgeDocumentLineVo line, String mainBody){ 60 | // for(KnowledgeDocumentLineHandler handler : values()) { 61 | // if(handler.value.equals(line.getHandler())) { 62 | // if(handler.mainBodySet != null) { 63 | // handler.mainBodySet.accept(line, mainBody); 64 | // } 65 | // return; 66 | // } 67 | // } 68 | // } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/constvalue/KnowledgeDocumentOperate.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.constvalue; 2 | 3 | import neatlogic.framework.util.$; 4 | 5 | public enum KnowledgeDocumentOperate { 6 | SUBMIT("submit", "提交", "提交了审核", false), 7 | PASS("pass", "通过", "通过了审核", false), 8 | REJECT("reject", "拒绝", "退回了审核", false), 9 | SWITCHVERSION("switchversion", "切换版本", "切换【版本${DATA.oldVersion}】至【版本${DATA.newVersion}】", true), 10 | DELETEVERSION("deleteversion", "删除版本", "删除【版本${DATA.version}】", true); 11 | private String value; 12 | private String text; 13 | private String title; 14 | private boolean needReplaceParam; 15 | private KnowledgeDocumentOperate(String value, String text, String title, boolean needReplaceParam) { 16 | this.value = value; 17 | this.text = text; 18 | this.title = title; 19 | this.needReplaceParam = needReplaceParam; 20 | } 21 | public String getValue() { 22 | return value; 23 | } 24 | public String getText() { 25 | return $.t(text); 26 | } 27 | public String getTitle() { 28 | return $.t(title); 29 | } 30 | public boolean isNeedReplaceParam() { 31 | return needReplaceParam; 32 | } 33 | 34 | public static boolean isNeedReplaceParam(String _value) { 35 | for(KnowledgeDocumentOperate operate : values()) { 36 | if(operate.value.equals(_value)) { 37 | return operate.needReplaceParam; 38 | } 39 | } 40 | return false; 41 | } 42 | 43 | public static String getTitle(String _value) { 44 | for(KnowledgeDocumentOperate operate : values()) { 45 | if(operate.value.equals(_value)) { 46 | return operate.title; 47 | } 48 | } 49 | return ""; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/constvalue/KnowledgeDocumentVersionStatus.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.constvalue; 2 | 3 | import neatlogic.framework.util.$; 4 | 5 | public enum KnowledgeDocumentVersionStatus { 6 | ALL("all","全部",""), 7 | DRAFT("draft", "未提交",""), 8 | SUBMITTED("submitted", "待审批","#F59A23"), 9 | PASSED("passed", "已通过","#00BCD4"), 10 | // EXPIRED("expired", "已失效"), 11 | REJECTED("rejected", "不通过","#D9001B"); 12 | private String value; 13 | private String text; 14 | private String color; 15 | private KnowledgeDocumentVersionStatus(String value, String text,String color) { 16 | this.value = value; 17 | this.text = text; 18 | this.color = color; 19 | } 20 | public String getValue() { 21 | return value; 22 | } 23 | 24 | public String getText() { 25 | return $.t(text); 26 | } 27 | 28 | public String getColor() { 29 | return color; 30 | } 31 | 32 | public static String getText(String _value) { 33 | for(KnowledgeDocumentVersionStatus status : values()) { 34 | if(status.value.equals(_value)) { 35 | return status.getText(); 36 | } 37 | } 38 | return ""; 39 | } 40 | 41 | public static String getColor(String _value) { 42 | for(KnowledgeDocumentVersionStatus status : values()) { 43 | if(status.value.equals(_value)) { 44 | return status.color; 45 | } 46 | } 47 | return ""; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/constvalue/KnowledgeFullTextIndexType.java: -------------------------------------------------------------------------------- 1 | /*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved. 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Affero General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU Affero General Public License for more details. 12 | 13 | You should have received a copy of the GNU Affero General Public License 14 | along with this program. If not, see .*/ 15 | 16 | package neatlogic.framework.knowledge.constvalue; 17 | 18 | import neatlogic.framework.fulltextindex.core.IFullTextIndexType; 19 | import neatlogic.framework.util.$; 20 | 21 | public enum KnowledgeFullTextIndexType implements IFullTextIndexType { 22 | KNOW_DOCUMENT_VERSION("knows_document_version", "term.knowledge.groupname"); 23 | 24 | private final String type; 25 | private final String typeName; 26 | 27 | KnowledgeFullTextIndexType(String _type, String _typeName) { 28 | type = _type; 29 | typeName = _typeName; 30 | } 31 | 32 | @Override 33 | public String getType() { 34 | return type; 35 | } 36 | 37 | @Override 38 | public String getTypeName() { 39 | return $.t(typeName); 40 | } 41 | 42 | @Override 43 | public String getTypeName(String type) { 44 | for (KnowledgeFullTextIndexType t : values()) { 45 | if (t.getType().equals(type)) { 46 | return t.getTypeName(); 47 | } 48 | } 49 | return ""; 50 | } 51 | 52 | @Override 53 | public boolean isActiveGlobalSearch() { 54 | return true; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/constvalue/KnowledgeType.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.constvalue; 2 | 3 | import neatlogic.framework.util.$; 4 | 5 | public enum KnowledgeType { 6 | ALL("all", "所有"), 7 | WAITINGFORREVIEW("waitingforreview", "待我审批"), 8 | SHARE("share", "我提交的"), 9 | COLLECT("collect", "我的收藏"), 10 | DRAFT("draft", "草稿"); 11 | private String value; 12 | private String text; 13 | private KnowledgeType(String value, String text) { 14 | this.value = value; 15 | this.text = text; 16 | } 17 | public String getValue() { 18 | return value; 19 | } 20 | public void setValue(String value) { 21 | this.value = value; 22 | } 23 | public String getText() { 24 | return $.t(text); 25 | } 26 | public void setText(String text) { 27 | this.text = text; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeCircleMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import neatlogic.framework.knowledge.dto.KnowledgeCircleUserVo; 4 | import neatlogic.framework.knowledge.dto.KnowledgeCircleVo; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | public interface KnowledgeCircleMapper { 10 | 11 | public int checkKnowledgeCircleExistsById(Long id); 12 | 13 | public int checkNameIsRepeat(KnowledgeCircleVo knowledgeCircleVo); 14 | 15 | public int searchKnowledgeCircleCount(KnowledgeCircleVo knowledgeCircleVo); 16 | 17 | public List searchKnowledgeCircle(KnowledgeCircleVo knowledgeCircleVo); 18 | 19 | public KnowledgeCircleVo getKnowledgeCircleById(Long id); 20 | 21 | public List getKnowledgeCircleUserList(Long knowledgeCircleId); 22 | 23 | public List getKnowledgeCircleUserListByIdAndAuthType(@Param("circleId") Long circleId,@Param("authType") String authType); 24 | 25 | public int checkCircleHasKnowledge(Long id); 26 | 27 | public List getCircleIdListByUserUuidList(@Param("list") List uuidList); 28 | 29 | public void updateKnowledgeCircle(KnowledgeCircleVo knowledgeCircleVo); 30 | 31 | public void insertKnowledgeCircle(KnowledgeCircleVo knowledgeCircleVo); 32 | 33 | public void batchInsertKnowledgeCircleUser(@Param("list") List list); 34 | 35 | public void deleteKnowledgeCircleById(Long id); 36 | 37 | public void deleteKnowledgeCircleUserById(Long circleId); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeCircleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 24 | 25 | 39 | 40 | 49 | 50 | 58 | 59 | 68 | 69 | 78 | 79 | 82 | 83 | 84 | UPDATE `knowledge_circle` SET 85 | `name` = #{name} 86 | WHERE `id` = #{id} 87 | 88 | 89 | 90 | insert into `knowledge_circle`( 91 | `id`, 92 | `name` 93 | ) 94 | values( 95 | #{id}, 96 | #{name} 97 | ) 98 | 99 | 100 | 101 | INSERT INTO `knowledge_circle_user`( 102 | `knowledge_circle_id`, 103 | `uuid`, 104 | `type`, 105 | `auth_type` 106 | ) 107 | VALUES 108 | 109 | ( 110 | #{item.knowledgeCircleId}, 111 | #{item.uuid}, 112 | #{item.type}, 113 | #{item.authType} 114 | ) 115 | 116 | 117 | 118 | 119 | delete from `knowledge_circle` where `id` = #{value} 120 | 121 | 122 | 123 | delete from `knowledge_circle_user` where `knowledge_circle_id` = #{value} 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeDocumentAuditMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import neatlogic.framework.knowledge.dto.KnowledgeDocumentAuditDetailVo; 4 | import neatlogic.framework.knowledge.dto.KnowledgeDocumentAuditVo; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | public interface KnowledgeDocumentAuditMapper { 10 | 11 | public List getKnowledgeDocumentAuditListByKnowledgeDocumentId(KnowledgeDocumentAuditVo knowledgeDocumentAuditVo); 12 | 13 | public KnowledgeDocumentAuditVo getKnowledgeDocumentAuditListByDocumentIdAndVersionIdAndOperate(KnowledgeDocumentAuditVo knowledgeDocumentAuditVo); 14 | 15 | public List getKnowledgeDocumentAuditListByDocumentVersionIdListAndOperate(@Param("versionIdList")List versionIdList,@Param("operate") String operate); 16 | 17 | public int getKnowledgeDocumentAuditCountByKnowledgeDocumentId(KnowledgeDocumentAuditVo searchVo); 18 | 19 | public String getKnowledgeDocumentAuditDetailStringByHash(String hash); 20 | 21 | public int insertKnowledgeDocumentAudit(KnowledgeDocumentAuditVo knowledgeDocumentAuditVo); 22 | 23 | public int insertKnowledgeDocumentAuditDetail(KnowledgeDocumentAuditDetailVo knowledgeDocumentAuditDetailVo); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeDocumentAuditMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 23 | 39 | 40 | 46 | 47 | 65 | 66 | 72 | 73 | 74 | INSERT INTO `knowledge_document_audit` (`knowledge_document_id`, 75 | `knowledge_document_version_id`, 76 | `fcu`, 77 | `operate`, 78 | `fcd`, 79 | `config_hash`) 80 | VALUES (#{knowledgeDocumentId}, 81 | #{knowledgeDocumentVersionId}, 82 | #{fcu}, 83 | #{operate}, 84 | NOW(3), 85 | #{configHash}) 86 | 87 | 88 | 90 | INSERT IGNORE INTO `knowledge_document_audit_detail` (`hash`, `config`) 91 | VALUES (#{hash}, #{config}) 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeDocumentMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import neatlogic.framework.common.dto.BasePageVo; 4 | import neatlogic.framework.common.dto.ValueTextVo; 5 | import neatlogic.framework.knowledge.dto.*; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | 10 | public interface KnowledgeDocumentMapper { 11 | 12 | public KnowledgeDocumentVo getKnowledgeDocumentById(Long id); 13 | 14 | public List getKnowledgeDocumentByTitleAndContent(String contentKeyword); 15 | 16 | public List getKnowledgeDocumentVersionByTitleAndContent(String contentKeyword); 17 | 18 | public KnowledgeDocumentVo getKnowledgeDocumentByTitle(String title); 19 | 20 | public List getKnowledgeDocumentByIdList(@Param("documentIdList") List documentIdList); 21 | 22 | public List getKnowledgeDocumentVersionByIdList(@Param("documentVersionIdList") List documentVersionIdList); 23 | 24 | public List searchKnowledgeDocumentId(KnowledgeDocumentVo knowledgeDocumentVo); 25 | 26 | public List searchKnowledgeDocumentVersionId(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 27 | 28 | public List getMyAllReviewKnowledgeDocumentVersionIdList(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 29 | 30 | public int getMyAllReviewKnowledgeDocumentVersionCount(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 31 | 32 | public Integer searchKnowledgeDocumentVersionIdCount(KnowledgeDocumentVersionVo KnowledgeDocumentVersionVo); 33 | 34 | public Integer searchKnowledgeDocumentIdCount(KnowledgeDocumentVo knowledgeDocumentVo); 35 | 36 | public List getKnowledgeDocumentVersionIdList(); 37 | 38 | public List getKnowledgeDocumentByIdListAndFcd(@Param("documentIdList") List documentIdList, @Param("fromDate") String fromDate, @Param("toDate") String toDate); 39 | 40 | public List getKnowledgeDocumentVersionIdListByLcd(@Param("documentVersionIdList") List documentVersionIdList, @Param("fromDate") String fromDate, @Param("toDate") String toDate); 41 | 42 | public KnowledgeDocumentVersionVo getKnowledgeDocumentVersionById(Long id); 43 | 44 | public int checkKnowledgeDocumentLineConfigHashIsExists(String hash); 45 | 46 | public int checkKnowledgeDocumentLineContentHashIsExists(String hash); 47 | 48 | public KnowledgeDocumentVo getKnowledgeDocumentLockById(Long id); 49 | 50 | public List getKnowledgeDocumentVersionMyVersionList(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 51 | 52 | public int getKnowledgeDocumentVersionMyVersionCount(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 53 | 54 | public List getKnowledgeDocumentLineListByKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId); 55 | 56 | public List getKnowledgeDocumentLineListByKnowledgeDocumentVersionIdAndLineNumberList(@Param("versionId") Long knowledgeDocumentVersionId, @Param("lineNumberList") List lineNumberList); 57 | 58 | public List getKnowledgeDocumentFileIdListByKnowledgeDocumentIdAndVersionId(KnowledgeDocumentFileVo knowledgeDocumentFileVo); 59 | 60 | public List getKnowledgeDocumentTagIdListByKnowledgeDocumentIdAndVersionId(KnowledgeDocumentTagVo knowledgeDocumentTagVo); 61 | 62 | public Integer getKnowledgeDocumentVersionMaxVerionByKnowledgeDocumentId(Long knowledgeDocumentId); 63 | 64 | public List getKnowledgeDocumentWaitingForReviewList( 65 | @Param("basePageVo") BasePageVo basePageVo, 66 | @Param("userUuid") String userUuid, 67 | @Param("teamUuidList") List teamUuidList, 68 | @Param("roleUuidList") List roleUuidList 69 | ); 70 | 71 | public int getKnowledgeDocumentWaitingForReviewCount( 72 | @Param("basePageVo") BasePageVo basePageVo, 73 | @Param("userUuid") String userUuid, 74 | @Param("teamUuidList") List teamUuidList, 75 | @Param("roleUuidList") List roleUuidList 76 | ); 77 | 78 | public List getKnowledgeDocumentHistorialVersionListByKnowledgeDocumentId(Long knowledgeDocumentId); 79 | 80 | public List getKnowledgeDocumentHistorialVersionIdListByKnowledgeDocumentId(Long knowledgeDocumentId); 81 | 82 | public int getKnowledgeDocumentHistorialVersionCountByKnowledgeDocumentId(Long knowledgeDocumentId); 83 | 84 | public List getKnowledgeDocumentHistorialVersionListForSelectByKnowledgeDocumentId(Long knowledgeDocumentId); 85 | 86 | public List getKnowledgeDocumentListForInternalLink(BasePageVo basePageVo); 87 | 88 | public int getKnowledgeDocumentCountForInternalLink(BasePageVo basePageVo); 89 | 90 | public int getCurrentUserKnowledgeDocumentCount( 91 | @Param("userUuid") String userUuid, 92 | @Param("teamUuidList") List teamUuidList, 93 | @Param("roleUuidList") List roleUuidList 94 | ); 95 | 96 | public int checkUserIsApprover( 97 | @Param("knowledgeCircleId") Long knowledgeCircleId, 98 | @Param("userUuid") String userUuid, 99 | @Param("teamUuidList") List teamUuidList, 100 | @Param("roleUuidList") List roleUuidList 101 | ); 102 | 103 | public List getUserAllApproverCircleIdList( 104 | @Param("userUuid") String userUuid, 105 | @Param("teamUuidList") List teamUuidList, 106 | @Param("roleUuidList") List roleUuidList 107 | ); 108 | 109 | public int checkUserIsMember( 110 | @Param("knowledgeCircleId") Long knowledgeCircleId, 111 | @Param("userUuid") String userUuid, 112 | @Param("teamUuidList") List teamUuidList, 113 | @Param("roleUuidList") List roleUuidList 114 | ); 115 | 116 | public List getKnowledgeDocumentListByKnowledgeDocumentTypeUuid(KnowledgeDocumentVo knowledgeDocumentVo); 117 | 118 | public int getKnowledgeDocumentCountByKnowledgeDocumentTypeUuid(KnowledgeDocumentVo knowledgeDocumentVo); 119 | 120 | public int checkDocumentHasBeenFavored(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 121 | 122 | public int getDocumentFavorCount(Long documentId); 123 | 124 | public int checkDocumentHasBeenCollected(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 125 | 126 | public int getDocumentCollectCount(Long documentId); 127 | 128 | public int checkExistsDocumentViewCount(Long documentId); 129 | 130 | public int getDocumentViewCount(Long documentId); 131 | 132 | // public int checkIFThereIsSubmittedDraftByKnowDocumentIdAndFromVersion(@Param("knowledgeDocumentId")Long knowledgeDocumentId, @Param("fromVersion")Integer fromVersion); 133 | 134 | public int checkIFThereIsSubmittedDraftByKnowDocumentId(Long knowledgeDocumentId); 135 | 136 | public int checkIfTheVersionIsTheCurrentVersion(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 137 | 138 | public List getKnowledgeDocumentVersionMyCollectList(KnowledgeDocumentCollectVo knowledgeDocumentCollectVo); 139 | 140 | public int getKnowledgeDocumentVersionMyCollectCount(KnowledgeDocumentCollectVo knowledgeDocumentCollectVo); 141 | 142 | public List getKnowledgeDocumentCollectDocumentIdListByUserUuidAndDocumentIdList(@Param("userUuid") String userUuid, @Param("knowledgeDocumentIdList") List knowledgeDocumentIdList); 143 | 144 | public List getKnowledgeDocumentFavorDocumentIdListByUserUuidAndDocumentIdList(@Param("userUuid") String userUuid, @Param("knowledgeDocumentIdList") List knowledgeDocumentIdList); 145 | 146 | public Long getKnowledgeDocumentIdByInvokeIdAndSource(KnowledgeDocumentInvokeVo knowledgeDocumentInvokeVo); 147 | 148 | public KnowledgeDocumentVersionVo getKnowledgeDocumentVersionByknowledgeDocumentIdLimitOne(Long knowledgeDocumentId); 149 | 150 | public int checkKnowledgeDocumentTitleIsRepeat(KnowledgeDocumentVo documentVo); 151 | 152 | List getKnowledgeDocumentVersionListByKnowledgeDocumentId(Long knowledgeDocumentId); 153 | 154 | public int insertKnowledgeDocument(KnowledgeDocumentVo knowledgeDocumentVo); 155 | 156 | public int insertKnowledgeDocumentVersion(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 157 | 158 | public int insertKnowledgeDocumentFile(KnowledgeDocumentFileVo knowledgeDocumentFileVo); 159 | 160 | public int insertKnowledgeDocumentTag(KnowledgeDocumentTagVo knowledgeDocumentTagVo); 161 | 162 | public int insertKnowledgeDocumentLineConfig(KnowledgeDocumentLineConfigVo knowledgeDocumentLineConfigVo); 163 | 164 | 165 | public int insertKnowledgeDocumentLineContent(KnowledgeDocumentLineContentVo knowledgeDocumentLineContentVo); 166 | 167 | public int insertKnowledgeDocumentLineList(List knowledgeDocumentLineList); 168 | 169 | public int insertKnowledgeDocumentFavor(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 170 | 171 | public int insertKnowledgeDocumentCollect(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 172 | 173 | public int insertKnowledgeDocumentViewCount(@Param("documentId") Long documentId, @Param("count") int count); 174 | 175 | public int insertKnowledgeDocumentInvoke(KnowledgeDocumentInvokeVo knowledgeDocumentInvokeVo); 176 | 177 | public int updateKnowledgeDocumentToDeleteById(Long knowledgeDocumentId); 178 | 179 | public int updateKnowledgeDocumentVersionById(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 180 | 181 | public int updateKnowledgeDocumentVersionStatusByKnowledgeDocumentIdAndVersionAndStatus( 182 | @Param("knowledgeDocumentId") Long knowledgeDocumentId, 183 | @Param("fromVersion") Integer fromVersion, 184 | @Param("oldStatus") String oldStatus, 185 | @Param("newStatus") String newStatus 186 | ); 187 | 188 | 189 | public int updateKnowledgeDocumentById(KnowledgeDocumentVo knowledgeDocumentVo); 190 | 191 | public int updateKnowledgeDocumentTitleById(KnowledgeDocumentVo knowledgeDocumentVo); 192 | 193 | public int updateKnowledgeDocumentTypeUuidById(KnowledgeDocumentVo knowledgeDocumentVo); 194 | 195 | public int updateKnowledgeViewCountIncrementOne(Long documentId); 196 | 197 | public int updateKnowledgeDocumentVersionToDeleteByKnowledgeDocumentId(Long knowledgeDocumentId); 198 | 199 | public int updateKnowledgeDocumentVersionToDeleteById(Long id); 200 | 201 | public int updateKnowledgeDocumentVersionTypeByKnowledgeDocumentId(KnowledgeDocumentVersionVo knowledgeDocumentVersionVo); 202 | 203 | public int resetKnowledgeViewCountByDocumentId(Long knowledgeDocumentId); 204 | 205 | public int deleteKnowledgeDocumentLineByKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId); 206 | 207 | public int deleteKnowledgeDocumentFileByKnowledgeDocumentIdAndVersionId(KnowledgeDocumentFileVo knowledgeDocumentFileVo); 208 | 209 | public int deleteKnowledgeDocumentTagByKnowledgeDocumentIdAndVersionId(KnowledgeDocumentTagVo knowledgeDocumentTagVo); 210 | 211 | public int deleteKnowledgeDocumentVersionById(Long id); 212 | 213 | public int deleteKnowledgeDocumentById(Long id); 214 | 215 | public int deleteKnowledgeDocumentFavor(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 216 | 217 | public int deleteKnowledgeDocumentCollect(@Param("documentId") Long documentId, @Param("userUuid") String userUuid); 218 | 219 | public int deleteKnowledgeDocumentDraftByKnowledgeDocumentIdAndLcu(@Param("knowledgeDocumentId") Long knowledgeDocumentId, @Param("lcu") String userUuid); 220 | 221 | public int deleteKnowledgeDocumentInvokeByKnowledgeDocumentId(Long knowledgeDocumentId); 222 | 223 | public int deleteKnowledgeDocumentCollectByDocumentId(Long knowledgeDocumentId); 224 | 225 | public int deleteKnowledgeDocumentFavorByDocumentId(Long knowledgeDocumentId); 226 | 227 | public int deleteKnowledgeDocumentAuditByKnowledgeDocumentVersionIdList(List knowledgeDocumentVersionIdList); 228 | } 229 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeDocumentTypeMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import neatlogic.framework.knowledge.dto.KnowledgeDocumentTypeVo; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | public interface KnowledgeDocumentTypeMapper { 9 | public Integer getMaxRhtCode(Long knowledgeCircleId); 10 | 11 | public int checkTypeIsExists(String uuid); 12 | 13 | public List searchType(KnowledgeDocumentTypeVo vo); 14 | 15 | public List getTypeByParentUuid(@Param("parentUuid") String parentUuid, @Param("knowledgeCircleId") Long knowledgeCircleId); 16 | 17 | public List getTypeForTree(@Param("lft") Integer lft, @Param("rht") Integer rht, @Param("knowledgeCircleId") Long knowledgeCircleId); 18 | 19 | public int getDocumentCountByLftRht(@Param("lft") Integer lft, @Param("rht") Integer rht, @Param("knowledgeCircleId") Long knowledgeCircleId); 20 | 21 | public List getAncestorsAndSelfNameByLftRht(@Param("lft") Integer lft, @Param("rht") Integer rht, @Param("knowledgeCircleId") Long knowledgeCircleId); 22 | 23 | public KnowledgeDocumentTypeVo getTypeByUuid(String uuid); 24 | 25 | public List getAncestorsAndSelfByLftRht(@Param("lft") Integer lft, @Param("rht") Integer rht, @Param("circleId") Long circleId); 26 | 27 | public List getTypeChildCountListByUuidList(List uuidList); 28 | 29 | public List getChildAndSelfByLftRht(@Param("lft") Integer lft, @Param("rht") Integer rht, @Param("circleId") Long circleId); 30 | 31 | public int getDocumentCountByUuid(String uuid); 32 | 33 | public void updateTypeLeftRightCode(@Param("uuid") String uuid, @Param("lft") Integer lft, @Param("rht") Integer rht); 34 | 35 | public void batchInsertType(@Param("list") List list); 36 | 37 | public void deleteTypeByCircleId(Long knowledgeCircleId); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeDocumentTypeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 35 | 57 | 58 | 74 | 75 | 93 | 94 | 99 | 100 | 112 | 113 | 125 | 126 | 138 | 139 | 150 | 151 | 154 | 155 | 156 | UPDATE `knowledge_document_type` SET `lft` = #{lft}, `rht` = #{rht} WHERE `uuid` = #{uuid} 157 | 158 | 159 | 160 | INSERT INTO `knowledge_document_type`( 161 | `uuid`, 162 | `name`, 163 | `knowledge_circle_id`, 164 | `parent_uuid`, 165 | `lft`, 166 | `rht`, 167 | `sort` 168 | ) 169 | VALUES 170 | 171 | ( 172 | #{item.uuid}, 173 | #{item.name}, 174 | #{item.knowledgeCircleId}, 175 | #{item.parentUuid}, 176 | #{item.lft}, 177 | #{item.rht}, 178 | #{item.sort} 179 | ) 180 | 181 | 182 | 183 | 184 | delete from `knowledge_document_type` where `knowledge_circle_id` = #{value} 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeTagMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import java.util.List; 4 | 5 | import neatlogic.framework.common.dto.BasePageVo; 6 | import neatlogic.framework.common.dto.ValueTextVo; 7 | import neatlogic.framework.knowledge.dto.KnowledgeTagVo; 8 | 9 | public interface KnowledgeTagMapper { 10 | 11 | public Long getKnowledgeTagIdByName(String name); 12 | 13 | public List getKnowledgeTagNameListByIdList(List idList); 14 | 15 | public int getKnowledgeTagCount(BasePageVo basePageVo); 16 | 17 | public List getKnowledgeTagList(BasePageVo basePageVo); 18 | 19 | public int insertKnowledgeTag(KnowledgeTagVo knowledgeTagVo); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeTagMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 19 | 20 | 28 | 29 | 42 | 43 | 44 | INSERT INTO `knowledge_tag` (`id`, `name`) VALUES (#{id}, #{name}) 45 | 46 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeTemplateMapper.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dao.mapper; 2 | 3 | import neatlogic.framework.knowledge.dto.KnowledgeTemplateVo; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | public interface KnowledgeTemplateMapper { 9 | 10 | public int checkKnowledgeTemplateExistsById(Long id); 11 | 12 | public int checkNameIsRepeat(KnowledgeTemplateVo knowledgeTemplateVo); 13 | 14 | public KnowledgeTemplateVo getKnowledgeTemplateById(Long id); 15 | 16 | public int searchKnowledgeTemplateCount(KnowledgeTemplateVo knowledgeTemplateVo); 17 | 18 | public List searchKnowledgeTemplate(KnowledgeTemplateVo knowledgeTemplateVo); 19 | 20 | public void updateKnowledgeTemplate(KnowledgeTemplateVo knowledgeTemplateVo); 21 | 22 | public void updateActiveStatus(@Param("id") Long id, @Param("isActive") Integer isActive); 23 | 24 | public void insertKnowledgeTemplate(KnowledgeTemplateVo knowledgeTemplateVo); 25 | 26 | public void deleteKnowledgeTemplate(Long id); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dao/mapper/KnowledgeTemplateMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 25 | 26 | 40 | 41 | 64 | 65 | 66 | UPDATE `knowledge_template` SET 67 | `name` = #{name}, 68 | `content` = #{content}, 69 | `lcu` = #{lcu}, 70 | `lcd` = NOW(3) 71 | WHERE `id` = #{id} 72 | 73 | 74 | 75 | UPDATE `knowledge_template` SET 76 | `is_active` = #{isActive} 77 | WHERE `id` = #{id} 78 | 79 | 80 | 81 | insert into `knowledge_template`( 82 | `id`, 83 | `name`, 84 | `content`, 85 | `is_active`, 86 | `fcu`, 87 | `lcu`, 88 | `fcd`, 89 | `lcd` 90 | ) 91 | values( 92 | #{id}, 93 | #{name}, 94 | #{content}, 95 | #{isActive}, 96 | #{fcu}, 97 | #{lcu}, 98 | now(3), 99 | now(3) 100 | ) 101 | 102 | 103 | delete from knowledge_template where `id` = #{id} 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeCircleUserVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.restful.annotation.EntityField; 5 | import neatlogic.framework.util.$; 6 | 7 | public class KnowledgeCircleUserVo{ 8 | 9 | public enum AuthType { 10 | APPROVER("approver", "审批人"), MEMBER("member", "成员"); 11 | 12 | private String name; 13 | private String text; 14 | 15 | private AuthType(String _name, String _text) { 16 | this.name = _name; 17 | this.text = _text; 18 | } 19 | 20 | public String getValue() { 21 | return name; 22 | } 23 | 24 | public String getText() { 25 | return $.t(text); 26 | } 27 | 28 | public static String getText(String name) { 29 | for (AuthType s : AuthType.values()) { 30 | if (s.getValue().equals(name)) { 31 | return s.getText(); 32 | } 33 | } 34 | return ""; 35 | } 36 | } 37 | 38 | @EntityField(name = "知识圈ID", type = ApiParamType.LONG) 39 | private Long knowledgeCircleId; 40 | @EntityField(name = "用户/角色/分组UUID", type = ApiParamType.STRING) 41 | private String uuid; 42 | @EntityField(name = "类型", type = ApiParamType.STRING) 43 | private String type; 44 | @EntityField(name = "区分审批人与成员字段(approver:审批人;member:成员)", type = ApiParamType.STRING) 45 | private String authType; 46 | 47 | public KnowledgeCircleUserVo() {} 48 | 49 | public Long getKnowledgeCircleId() { 50 | return knowledgeCircleId; 51 | } 52 | 53 | public void setKnowledgeCircleId(Long knowledgeCircleId) { 54 | this.knowledgeCircleId = knowledgeCircleId; 55 | } 56 | 57 | public String getUuid() { 58 | return uuid; 59 | } 60 | 61 | public void setUuid(String uuid) { 62 | this.uuid = uuid; 63 | } 64 | 65 | public String getType() { 66 | return type; 67 | } 68 | 69 | public void setType(String type) { 70 | this.type = type; 71 | } 72 | 73 | public String getAuthType() { 74 | return authType; 75 | } 76 | 77 | public void setAuthType(String authType) { 78 | this.authType = authType; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeCircleVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.common.constvalue.GroupSearch; 5 | import neatlogic.framework.common.dto.BasePageVo; 6 | import neatlogic.framework.dto.UserVo; 7 | import neatlogic.framework.restful.annotation.EntityField; 8 | import neatlogic.framework.util.SnowflakeUtil; 9 | import com.alibaba.fastjson.annotation.JSONField; 10 | import org.apache.commons.collections4.CollectionUtils; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | public class KnowledgeCircleVo extends BasePageVo { 16 | 17 | @EntityField(name = "知识圈ID", type = ApiParamType.LONG) 18 | private Long id; 19 | @EntityField(name = "知识圈名称", type = ApiParamType.STRING) 20 | private String name; 21 | @EntityField(name = "知识文档数", type = ApiParamType.INTEGER) 22 | private Integer documentCount; 23 | @EntityField(name = "成员数", type = ApiParamType.INTEGER) 24 | private Integer memberCount; 25 | @EntityField(name = "审批人用户名列表", type = ApiParamType.JSONARRAY) 26 | private List approverNameList; 27 | @EntityField(name = "审批人用户列表", type = ApiParamType.JSONARRAY) 28 | private List approverVoList; 29 | @EntityField(name = "审批人列表", type = ApiParamType.JSONARRAY) 30 | private List approverList; 31 | @EntityField(name = "成员列表", type = ApiParamType.JSONARRAY) 32 | private List memberList; 33 | @EntityField(name = "知识文档类型列表", type = ApiParamType.JSONARRAY) 34 | private List documentTypeList; 35 | 36 | /** 知识圈关联的所有对象,包括用户、组、角色 */ 37 | @JSONField(serialize = false) 38 | private List authList; 39 | 40 | public KnowledgeCircleVo() {} 41 | 42 | public Long getId() { 43 | if(id == null){ 44 | id = SnowflakeUtil.uniqueLong(); 45 | } 46 | return id; 47 | } 48 | 49 | public void setId(Long id) { 50 | this.id = id; 51 | } 52 | 53 | public String getName() { 54 | return name; 55 | } 56 | 57 | public void setName(String name) { 58 | this.name = name; 59 | } 60 | 61 | public Integer getDocumentCount() { 62 | return documentCount; 63 | } 64 | 65 | public void setDocumentCount(Integer documentCount) { 66 | this.documentCount = documentCount; 67 | } 68 | 69 | public Integer getMemberCount() { 70 | return memberCount; 71 | } 72 | 73 | public void setMemberCount(Integer memberCount) { 74 | this.memberCount = memberCount; 75 | } 76 | 77 | public List getApproverNameList() { 78 | return approverNameList; 79 | } 80 | 81 | public void setApproverNameList(List approverNameList) { 82 | this.approverNameList = approverNameList; 83 | } 84 | 85 | public List getApproverList() { 86 | if(CollectionUtils.isEmpty(approverList) && CollectionUtils.isNotEmpty(authList)){ 87 | approverList = new ArrayList<>(); 88 | for(KnowledgeCircleUserVo vo : authList) { 89 | GroupSearch groupSearch = GroupSearch.getGroupSearch(vo.getType()); 90 | if(groupSearch != null && KnowledgeCircleUserVo.AuthType.APPROVER.getValue().equals(vo.getAuthType())) { 91 | approverList.add(groupSearch.getValuePlugin() + vo.getUuid()); 92 | } 93 | } 94 | } 95 | return approverList; 96 | } 97 | 98 | public void setApproverList(List approverList) { 99 | this.approverList = approverList; 100 | } 101 | 102 | public List getMemberList() { 103 | if(CollectionUtils.isEmpty(memberList) && CollectionUtils.isNotEmpty(authList)){ 104 | memberList = new ArrayList<>(); 105 | for(KnowledgeCircleUserVo vo : authList) { 106 | GroupSearch groupSearch = GroupSearch.getGroupSearch(vo.getType()); 107 | if(groupSearch != null && KnowledgeCircleUserVo.AuthType.MEMBER.getValue().equals(vo.getAuthType())) { 108 | memberList.add(groupSearch.getValuePlugin() + vo.getUuid()); 109 | } 110 | } 111 | } 112 | return memberList; 113 | } 114 | 115 | public void setMemberList(List memberList) { 116 | this.memberList = memberList; 117 | } 118 | 119 | public List getAuthList() { 120 | return authList; 121 | } 122 | 123 | public void setAuthList(List authList) { 124 | this.authList = authList; 125 | } 126 | 127 | public List getDocumentTypeList() { 128 | return documentTypeList; 129 | } 130 | 131 | public void setDocumentTypeList(List documentTypeList) { 132 | this.documentTypeList = documentTypeList; 133 | } 134 | 135 | public List getApproverVoList() { 136 | return approverVoList; 137 | } 138 | 139 | public void setApproverVoList(List approverVoList) { 140 | this.approverVoList = approverVoList; 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentAuditDetailVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.util.DigestUtils; 5 | 6 | public class KnowledgeDocumentAuditDetailVo { 7 | private String hash; 8 | private final String config; 9 | 10 | public KnowledgeDocumentAuditDetailVo(String config) { 11 | this.config = config; 12 | } 13 | 14 | public String getConfig() { 15 | return config; 16 | } 17 | 18 | public String getHash() { 19 | if (StringUtils.isBlank(hash) && StringUtils.isNotBlank(config)) { 20 | hash = DigestUtils.md5DigestAsHex(config.getBytes()); 21 | } 22 | return hash; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentAuditVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | 5 | import neatlogic.framework.common.constvalue.ApiParamType; 6 | import neatlogic.framework.common.dto.BaseEditorVo; 7 | import neatlogic.framework.restful.annotation.EntityField; 8 | import com.alibaba.fastjson.annotation.JSONField; 9 | import org.apache.commons.collections4.MapUtils; 10 | import org.apache.commons.lang3.StringUtils; 11 | 12 | public class KnowledgeDocumentAuditVo extends BaseEditorVo { 13 | 14 | @EntityField(name = "文档id", type = ApiParamType.LONG) 15 | private Long KnowledgeDocumentId; 16 | @EntityField(name = "文档版本id", type = ApiParamType.LONG) 17 | private Long knowledgeDocumentVersionId; 18 | @EntityField(name = "操作类型", type = ApiParamType.STRING) 19 | private String operate; 20 | @EntityField(name = "操作描述", type = ApiParamType.STRING) 21 | private String title; 22 | @EntityField(name = "内容", type = ApiParamType.STRING) 23 | private String content; 24 | private String configStr; 25 | @JSONField(serialize = false) 26 | private JSONObject config; 27 | @JSONField(serialize = false) 28 | private String configHash; 29 | 30 | public Long getKnowledgeDocumentId() { 31 | return KnowledgeDocumentId; 32 | } 33 | 34 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 35 | KnowledgeDocumentId = knowledgeDocumentId; 36 | } 37 | 38 | public KnowledgeDocumentAuditVo() { 39 | } 40 | 41 | public KnowledgeDocumentAuditVo(Long knowledgeDocumentId, Long knowledgeDocumentVersionId, String operate) { 42 | KnowledgeDocumentId = knowledgeDocumentId; 43 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 44 | this.operate = operate; 45 | } 46 | 47 | public String getOperate() { 48 | return operate; 49 | } 50 | 51 | public void setOperate(String operate) { 52 | this.operate = operate; 53 | } 54 | 55 | public String getTitle() { 56 | return title; 57 | } 58 | 59 | public void setTitle(String title) { 60 | this.title = title; 61 | } 62 | 63 | public String getContent() { 64 | return content; 65 | } 66 | 67 | public void setContent(String content) { 68 | this.content = content; 69 | } 70 | 71 | public JSONObject getConfig() { 72 | if(MapUtils.isEmpty(config)&& StringUtils.isNotBlank(configStr)){ 73 | config = JSONObject.parseObject(configStr); 74 | } 75 | return config; 76 | } 77 | 78 | public void setConfig(JSONObject config) { 79 | this.config = config; 80 | } 81 | 82 | public String getConfigHash() { 83 | return configHash; 84 | } 85 | 86 | public void setConfigHash(String configHash) { 87 | this.configHash = configHash; 88 | } 89 | 90 | public Long getKnowledgeDocumentVersionId() { 91 | return knowledgeDocumentVersionId; 92 | } 93 | 94 | public void setKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId) { 95 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 96 | } 97 | 98 | public String getConfigStr() { 99 | return configStr; 100 | } 101 | 102 | public void setConfigStr(String configStr) { 103 | this.configStr = configStr; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentCollectVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.dto.BasePageVo; 4 | 5 | public class KnowledgeDocumentCollectVo extends BasePageVo { 6 | 7 | private Long knowledgeDocumentId; 8 | private String userUuid; 9 | public Long getKnowledgeDocumentId() { 10 | return knowledgeDocumentId; 11 | } 12 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 13 | this.knowledgeDocumentId = knowledgeDocumentId; 14 | } 15 | public String getUserUuid() { 16 | return userUuid; 17 | } 18 | public void setUserUuid(String userUuid) { 19 | this.userUuid = userUuid; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentFileVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | public class KnowledgeDocumentFileVo { 4 | 5 | private Long knowledgeDocumentId; 6 | private Long knowledgeDocumentVersionId; 7 | private Long fileId; 8 | public KnowledgeDocumentFileVo() { 9 | 10 | } 11 | public KnowledgeDocumentFileVo(Long knowledgeDocumentId, Long knowledgeDocumentVersionId) { 12 | this.knowledgeDocumentId = knowledgeDocumentId; 13 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 14 | } 15 | 16 | public KnowledgeDocumentFileVo(Long knowledgeDocumentId, Long knowledgeDocumentVersionId,Long fileId) { 17 | this.knowledgeDocumentId = knowledgeDocumentId; 18 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 19 | this.fileId = fileId; 20 | } 21 | public Long getKnowledgeDocumentId() { 22 | return knowledgeDocumentId; 23 | } 24 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 25 | this.knowledgeDocumentId = knowledgeDocumentId; 26 | } 27 | public Long getKnowledgeDocumentVersionId() { 28 | return knowledgeDocumentVersionId; 29 | } 30 | public void setKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId) { 31 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 32 | } 33 | public Long getFileId() { 34 | return fileId; 35 | } 36 | public void setFileId(Long fileId) { 37 | this.fileId = fileId; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentHistoricalVersionVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | 4 | import neatlogic.framework.common.dto.BaseEditorVo; 5 | import org.apache.commons.lang3.StringUtils; 6 | 7 | import neatlogic.framework.common.constvalue.ApiParamType; 8 | import neatlogic.framework.restful.annotation.EntityField; 9 | 10 | public class KnowledgeDocumentHistoricalVersionVo extends BaseEditorVo { 11 | @EntityField(name = "版本id", type = ApiParamType.LONG) 12 | private Long id; 13 | @EntityField(name = "文档id", type = ApiParamType.LONG) 14 | private Long knowledgeDocumentId; 15 | @EntityField(name = "版本号", type = ApiParamType.STRING) 16 | private Integer version; 17 | @EntityField(name = "版本名", type = ApiParamType.STRING) 18 | private String versionName; 19 | @EntityField(name = "标题", type = ApiParamType.STRING) 20 | private String title; 21 | @EntityField(name = "是否可删除", type = ApiParamType.INTEGER) 22 | private Integer isDeletable; 23 | @EntityField(name = "是否可回退", type = ApiParamType.INTEGER) 24 | private Integer isSwitchable; 25 | public Long getId() { 26 | return id; 27 | } 28 | public void setId(Long id) { 29 | this.id = id; 30 | } 31 | public Long getKnowledgeDocumentId() { 32 | return knowledgeDocumentId; 33 | } 34 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 35 | this.knowledgeDocumentId = knowledgeDocumentId; 36 | } 37 | public Integer getVersion() { 38 | return version; 39 | } 40 | public void setVersion(Integer version) { 41 | this.version = version; 42 | } 43 | public String getVersionName() { 44 | if(StringUtils.isBlank(versionName) && version != null) { 45 | versionName = "版本" + version; 46 | } 47 | return versionName; 48 | } 49 | public String getTitle() { 50 | return title; 51 | } 52 | public void setTitle(String title) { 53 | this.title = title; 54 | } 55 | 56 | public Integer getIsDeletable() { 57 | return isDeletable; 58 | } 59 | public void setIsDeletable(Integer isDeletable) { 60 | this.isDeletable = isDeletable; 61 | } 62 | public Integer getIsSwitchable() { 63 | return isSwitchable; 64 | } 65 | public void setIsSwitchable(Integer isSwitchable) { 66 | this.isSwitchable = isSwitchable; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentInvokeVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | public class KnowledgeDocumentInvokeVo { 4 | 5 | private Long knowledgeDocumentId; 6 | private Long invokeId; 7 | private String source; 8 | public KnowledgeDocumentInvokeVo(Long invokeId, String source) { 9 | this.invokeId = invokeId; 10 | this.source = source; 11 | } 12 | public KnowledgeDocumentInvokeVo(Long knowledgeDocumentId, Long invokeId, String source) { 13 | this.knowledgeDocumentId = knowledgeDocumentId; 14 | this.invokeId = invokeId; 15 | this.source = source; 16 | } 17 | public Long getKnowledgeDocumentId() { 18 | return knowledgeDocumentId; 19 | } 20 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 21 | this.knowledgeDocumentId = knowledgeDocumentId; 22 | } 23 | public Long getInvokeId() { 24 | return invokeId; 25 | } 26 | public void setInvokeId(Long invokeId) { 27 | this.invokeId = invokeId; 28 | } 29 | public String getSource() { 30 | return source; 31 | } 32 | public void setSource(String source) { 33 | this.source = source; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentLineConfigVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.util.DigestUtils; 5 | 6 | public class KnowledgeDocumentLineConfigVo { 7 | private String hash; 8 | private final String config; 9 | 10 | public KnowledgeDocumentLineConfigVo(String config) { 11 | this.config = config; 12 | } 13 | 14 | public String getConfig() { 15 | return config; 16 | } 17 | 18 | public String getHash() { 19 | if (StringUtils.isBlank(hash) && StringUtils.isNotBlank(config)) { 20 | hash = DigestUtils.md5DigestAsHex(config.getBytes()); 21 | } 22 | return hash; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentLineContentVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.springframework.util.DigestUtils; 5 | 6 | public class KnowledgeDocumentLineContentVo { 7 | private String hash; 8 | private final String content; 9 | 10 | public KnowledgeDocumentLineContentVo(String content) { 11 | this.content = content; 12 | } 13 | 14 | public String getContent() { 15 | return content; 16 | } 17 | 18 | public String getHash() { 19 | if (StringUtils.isBlank(hash) && StringUtils.isNotBlank(content)) { 20 | hash = DigestUtils.md5DigestAsHex(content.getBytes()); 21 | } 22 | return hash; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentLineVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.lcs.BaseLineVo; 5 | import neatlogic.framework.restful.annotation.EntityField; 6 | import com.alibaba.fastjson.annotation.JSONField; 7 | 8 | public class KnowledgeDocumentLineVo extends BaseLineVo { 9 | 10 | @EntityField(name = "标题", type = ApiParamType.STRING) 11 | private String uuid; 12 | // private String handler; 13 | // private String content; 14 | // private String changeType; 15 | // private JSONObject config; 16 | // private Integer lineNumber; 17 | @JSONField(serialize = false) 18 | private Long knowledgeDocumentId; 19 | // @ESKey(type = ESKeyType.PKEY, name = "documentId") 20 | @JSONField(serialize = false) 21 | private Long knowledgeDocumentVersionId; 22 | @JSONField(serialize = false) 23 | private String contentHash; 24 | @JSONField(serialize = false) 25 | private String configHash; 26 | // @JSONField(serialize = false) 27 | // private String configStr; 28 | public KnowledgeDocumentLineVo() { 29 | } 30 | public String getUuid() { 31 | return uuid; 32 | } 33 | public void setUuid(String uuid) { 34 | this.uuid = uuid; 35 | } 36 | // public String getHandler() { 37 | // return handler; 38 | // } 39 | // public void setHandler(String handler) { 40 | // this.handler = handler; 41 | // } 42 | // public String getContent() { 43 | // return content; 44 | // } 45 | // public void setContent(String content) { 46 | // this.content = content; 47 | // } 48 | // public String getChangeType() { 49 | // return changeType; 50 | // } 51 | // public void setChangeType(String changeType) { 52 | // this.changeType = changeType; 53 | // } 54 | // public JSONObject getConfig() { 55 | // return config; 56 | // } 57 | // public void setConfig(String config) { 58 | // this.config = JSON.parseObject(config); 59 | // } 60 | // public Integer getLineNumber() { 61 | // return lineNumber; 62 | // } 63 | // public void setLineNumber(Integer lineNumber) { 64 | // this.lineNumber = lineNumber; 65 | // } 66 | public Long getKnowledgeDocumentId() { 67 | return knowledgeDocumentId; 68 | } 69 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 70 | this.knowledgeDocumentId = knowledgeDocumentId; 71 | } 72 | public Long getKnowledgeDocumentVersionId() { 73 | return knowledgeDocumentVersionId; 74 | } 75 | public void setKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId) { 76 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 77 | } 78 | public String getContentHash() { 79 | return contentHash; 80 | } 81 | public void setContentHash(String contentHash) { 82 | this.contentHash = contentHash; 83 | } 84 | public String getConfigHash() { 85 | return configHash; 86 | } 87 | public void setConfigHash(String configHash) { 88 | this.configHash = configHash; 89 | } 90 | // public String getConfigStr() { 91 | // if(StringUtils.isBlank(configStr) && config != null) { 92 | // configStr = config.toJSONString(); 93 | // } 94 | // return configStr; 95 | // } 96 | // @Override 97 | // public int hashCode() { 98 | // final int prime = 31; 99 | // int result = 1; 100 | // result = prime * result + ((handler == null) ? 0 : handler.hashCode()); 101 | // String mainBody = null; 102 | // ILineHandler lineHandler = LineHandlerFactory.getHandler(handler); 103 | // if (lineHandler != null) { 104 | // mainBody = lineHandler.getMainBody(this); 105 | // } 106 | // result = prime * result + ((mainBody == null) ? 0 : mainBody.hashCode()); 107 | // return result; 108 | // } 109 | // @Override 110 | // public boolean equals(Object obj) { 111 | // if (this == obj) 112 | // return true; 113 | // if (obj == null) 114 | // return false; 115 | // if (getClass() != obj.getClass()) 116 | // return false; 117 | // KnowledgeDocumentLineVo other = (KnowledgeDocumentLineVo)obj; 118 | // if (handler == null) { 119 | // if (other.handler != null) 120 | // return false; 121 | // } else if (!handler.equals(other.handler)) 122 | // return false; 123 | // ILineHandler lineHandler = LineHandlerFactory.getHandler(handler); 124 | // if (lineHandler == null) { 125 | // return true; 126 | // } 127 | // return Objects.equals(lineHandler.getMainBody(this), lineHandler.getMainBody(other)); 128 | // } 129 | } 130 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentTagVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | public class KnowledgeDocumentTagVo { 4 | 5 | private Long knowledgeDocumentId; 6 | private Long knowledgeDocumentVersionId; 7 | private Long tagId; 8 | public KnowledgeDocumentTagVo() { 9 | 10 | } 11 | public KnowledgeDocumentTagVo(Long knowledgeDocumentId, Long knowledgeDocumentVersionId) { 12 | this.knowledgeDocumentId = knowledgeDocumentId; 13 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 14 | } 15 | public Long getKnowledgeDocumentId() { 16 | return knowledgeDocumentId; 17 | } 18 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 19 | this.knowledgeDocumentId = knowledgeDocumentId; 20 | } 21 | public Long getKnowledgeDocumentVersionId() { 22 | return knowledgeDocumentVersionId; 23 | } 24 | public void setKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId) { 25 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 26 | } 27 | public Long getTagId() { 28 | return tagId; 29 | } 30 | public void setTagId(Long tagId) { 31 | this.tagId = tagId; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentTypeVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.restful.annotation.EntityField; 5 | import com.alibaba.fastjson.annotation.JSONField; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class KnowledgeDocumentTypeVo { 11 | 12 | public static final String ROOT_PARENTUUID = "-1"; 13 | public static final String ROOT_UUID = "0"; 14 | 15 | @EntityField(name = "知识类型ID", type = ApiParamType.STRING) 16 | private String uuid; 17 | @EntityField(name = "知识类型名称", type = ApiParamType.STRING) 18 | private String name; 19 | @EntityField(name = "知识圈ID", type = ApiParamType.LONG) 20 | private Long knowledgeCircleId; 21 | @EntityField(name = "父类型ID", type = ApiParamType.STRING) 22 | private String parentUuid; 23 | @JSONField(serialize = false) 24 | @EntityField(name = "左编码", type = ApiParamType.INTEGER) 25 | private Integer lft; 26 | @JSONField(serialize = false) 27 | @EntityField(name = "右编码", type = ApiParamType.INTEGER) 28 | private Integer rht; 29 | @JSONField(serialize = false) 30 | @EntityField(name = "排序(相对于同级节点的顺序)", type = ApiParamType.INTEGER) 31 | private Integer sort; 32 | @EntityField(name = "子节点数量", type = ApiParamType.INTEGER) 33 | private Integer childCount; 34 | @EntityField(name = "关联的知识文档数", type = ApiParamType.INTEGER) 35 | private Integer documentCount; 36 | 37 | @JSONField(serialize = false) 38 | private KnowledgeDocumentTypeVo parent; 39 | 40 | private List children = new ArrayList<>(); 41 | 42 | @JSONField(serialize = false) 43 | private String keyword; 44 | 45 | public KnowledgeDocumentTypeVo() {} 46 | 47 | public String getUuid() { 48 | return uuid; 49 | } 50 | 51 | public void setUuid(String uuid) { 52 | this.uuid = uuid; 53 | } 54 | 55 | public String getName() { 56 | return name; 57 | } 58 | 59 | public void setName(String name) { 60 | this.name = name; 61 | } 62 | 63 | public Long getKnowledgeCircleId() { 64 | return knowledgeCircleId; 65 | } 66 | 67 | public void setKnowledgeCircleId(Long knowledgeCircleId) { 68 | this.knowledgeCircleId = knowledgeCircleId; 69 | } 70 | 71 | public String getParentUuid() { 72 | return parentUuid; 73 | } 74 | 75 | public void setParentUuid(String parentUuid) { 76 | this.parentUuid = parentUuid; 77 | } 78 | 79 | public Integer getLft() { 80 | return lft; 81 | } 82 | 83 | public void setLft(Integer lft) { 84 | this.lft = lft; 85 | } 86 | 87 | public Integer getRht() { 88 | return rht; 89 | } 90 | 91 | public void setRht(Integer rht) { 92 | this.rht = rht; 93 | } 94 | 95 | public Integer getSort() { 96 | return sort; 97 | } 98 | 99 | public void setSort(Integer sort) { 100 | this.sort = sort; 101 | } 102 | 103 | public Integer getChildCount() { 104 | return childCount; 105 | } 106 | 107 | public void setChildCount(Integer childCount) { 108 | this.childCount = childCount; 109 | } 110 | 111 | public Integer getDocumentCount() { 112 | return documentCount; 113 | } 114 | 115 | public void setDocumentCount(Integer documentCount) { 116 | this.documentCount = documentCount; 117 | } 118 | 119 | public KnowledgeDocumentTypeVo getParent() { 120 | return parent; 121 | } 122 | 123 | public void setParent(KnowledgeDocumentTypeVo parent) { 124 | this.parent = parent; 125 | parent.getChildren().add(this); 126 | } 127 | 128 | public List getChildren() { 129 | return children; 130 | } 131 | 132 | public void setChildren(List children) { 133 | this.children = children; 134 | } 135 | 136 | public String getKeyword() { 137 | return keyword; 138 | } 139 | 140 | public void setKeyword(String keyword) { 141 | this.keyword = keyword; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentVersionStatusVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | public class KnowledgeDocumentVersionStatusVo { 4 | private final String value; 5 | private final String text; 6 | private final String color; 7 | 8 | public KnowledgeDocumentVersionStatusVo(String value, String text,String color) { 9 | this.value = value; 10 | this.text = text; 11 | this.color = color; 12 | } 13 | public String getValue() { 14 | return value; 15 | } 16 | public String getText() { 17 | return text; 18 | } 19 | public String getColor() { 20 | return color; 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentVersionVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.common.constvalue.GroupSearch; 5 | import neatlogic.framework.common.dto.BaseEditorVo; 6 | import neatlogic.framework.knowledge.dto.SyncSourceVo; 7 | import neatlogic.framework.knowledge.source.SyncSourceFactory; 8 | import neatlogic.framework.restful.annotation.EntityField; 9 | import neatlogic.framework.util.SnowflakeUtil; 10 | import neatlogic.framework.util.TimeUtil; 11 | import neatlogic.framework.knowledge.constvalue.KnowledgeDocumentVersionStatus; 12 | import com.alibaba.fastjson.JSON; 13 | import com.alibaba.fastjson.JSONObject; 14 | import com.alibaba.fastjson.annotation.JSONField; 15 | import org.apache.commons.collections4.CollectionUtils; 16 | import org.apache.commons.lang3.StringUtils; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Date; 20 | import java.util.List; 21 | 22 | public class KnowledgeDocumentVersionVo extends BaseEditorVo { 23 | @EntityField(name = "版本id", type = ApiParamType.LONG) 24 | private Long id; 25 | @EntityField(name = "文档类型Uuid", type = ApiParamType.LONG) 26 | private String knowledgeDocumentTypeUuid; 27 | @EntityField(name = "文档知识圈id", type = ApiParamType.LONG) 28 | private Long knowledgeCircleId; 29 | @EntityField(name = "文档id", type = ApiParamType.LONG) 30 | private Long knowledgeDocumentId; 31 | @EntityField(name = "版本号", type = ApiParamType.STRING) 32 | private Integer version; 33 | @EntityField(name = "版本名", type = ApiParamType.STRING) 34 | private String versionName; 35 | @EntityField(name = "原版本号", type = ApiParamType.STRING) 36 | private Integer fromVersion; 37 | @EntityField(name = "原版本名", type = ApiParamType.STRING) 38 | private String fromVersionName; 39 | @EntityField(name = "状态", type = ApiParamType.STRING) 40 | private String status; 41 | @EntityField(name = "状态信息", type = ApiParamType.JSONOBJECT) 42 | private KnowledgeDocumentVersionStatusVo statusVo; 43 | @EntityField(name = "标题", type = ApiParamType.STRING) 44 | private String title; 45 | @EntityField(name = "文档大小,单位是字节", type = ApiParamType.INTEGER) 46 | private Integer size; 47 | @EntityField(name = "文档大小描述", type = ApiParamType.STRING) 48 | private Integer sizeDesc; 49 | @EntityField(name = "审核人", type = ApiParamType.STRING) 50 | private String reviewer; 51 | @EntityField(name = "审核人名", type = ApiParamType.STRING) 52 | private String reviewerName; 53 | @EntityField(name = "审核人额外属性", type = ApiParamType.STRING) 54 | private String reviewerInfo; 55 | @EntityField(name = "审核人头像", type = ApiParamType.STRING) 56 | private String reviewerAvatar; 57 | @EntityField(name = "审核时间", type = ApiParamType.LONG) 58 | private Date reviewTime; 59 | @EntityField(name = "是否可编辑", type = ApiParamType.INTEGER) 60 | private Integer isEditable; 61 | @EntityField(name = "是否可删除", type = ApiParamType.INTEGER) 62 | private Integer isDeletable; 63 | @EntityField(name = "是否收藏", type = ApiParamType.INTEGER) 64 | private int isCollect; 65 | @EntityField(name = "是否已删除", type = ApiParamType.INTEGER) 66 | private Integer isDelete; 67 | @EntityField(name = "路径", type = ApiParamType.JSONARRAY) 68 | private List path = new ArrayList<>(); 69 | @EntityField(name = "标签名列表", type = ApiParamType.JSONARRAY) 70 | private List tagList = new ArrayList<>(); 71 | @EntityField(name = "标签列表", type = ApiParamType.JSONARRAY) 72 | private List tagVoList = new ArrayList<>(); 73 | @EntityField(name = "知识内容", type = ApiParamType.STRING) 74 | private String content; 75 | @EntityField(name = "不通过原因", type = ApiParamType.STRING) 76 | private String rejectReason; 77 | @EntityField(name = "行数据列表", type = ApiParamType.JSONARRAY) 78 | private List knowledgeDocumentLineList = new ArrayList<>(); 79 | @JSONField(serialize = false) 80 | private boolean isAutoGenerateId = true; 81 | @JSONField(serialize = false) 82 | private List statusList; 83 | @EntityField(name = "来源", type = ApiParamType.INTEGER) 84 | private String source; 85 | @EntityField(name = "来源名", type = ApiParamType.INTEGER) 86 | private String sourceName; 87 | @JSONField(serialize = false) 88 | private String lcdStartTime; 89 | @JSONField(serialize = false) 90 | private String lcdEndTime; 91 | @JSONField(serialize = false) 92 | private List knowledgeDocumentVersionIdList; 93 | @JSONField(serialize = false) 94 | private List lcuList; 95 | @JSONField(serialize = false) 96 | private List reviewerList; 97 | @JSONField(serialize = false) 98 | private List sourceList; 99 | @JSONField(serialize = false) 100 | private String reviewDateStartTime; 101 | @JSONField(serialize = false) 102 | private String reviewDateEndTime; 103 | @JSONField(serialize = false) 104 | private List reviewerRoleUuidList = new ArrayList<>(); 105 | @JSONField(serialize = false) 106 | private List reviewerTeamUuidList = new ArrayList<>(); 107 | @JSONField(serialize = false) 108 | private Integer isReviewer; 109 | 110 | public KnowledgeDocumentVersionVo() { 111 | } 112 | 113 | public KnowledgeDocumentVersionVo(JSONObject paramJson) { 114 | JSONObject lcd = paramJson.getJSONObject("lcd"); 115 | paramJson.remove("lcd"); 116 | KnowledgeDocumentVersionVo tmpVo = JSON.toJavaObject(paramJson, KnowledgeDocumentVersionVo.class); 117 | this.setPageSize(tmpVo.getPageSize()); 118 | this.setCurrentPage(tmpVo.getCurrentPage()); 119 | this.setKeyword(tmpVo.getKeyword()); 120 | this.knowledgeDocumentTypeUuid = tmpVo.getKnowledgeDocumentTypeUuid(); 121 | this.lcuList = tmpVo.getLcuList(); 122 | this.tagList = tmpVo.getTagList(); 123 | this.sourceList = tmpVo.getSourceList(); 124 | this.reviewerList = tmpVo.getReviewerList(); 125 | this.statusList = tmpVo.getStatusList(); 126 | if (lcd != null) { 127 | JSONObject lcdJson = TimeUtil.getStartTimeAndEndTimeByDateJson(lcd); 128 | this.lcdStartTime = lcdJson.getString("startTime"); 129 | this.lcdEndTime = lcdJson.getString("endTime"); 130 | } 131 | JSONObject reviewDate = paramJson.getJSONObject("reviewDate"); 132 | if (reviewDate != null) { 133 | JSONObject reviewDateJson = TimeUtil.getStartTimeAndEndTimeByDateJson(reviewDate); 134 | this.reviewDateStartTime = reviewDateJson.getString("startTime"); 135 | this.reviewDateEndTime = reviewDateJson.getString("endTime"); 136 | } 137 | } 138 | 139 | 140 | public boolean isAutoGenerateId() { 141 | return isAutoGenerateId; 142 | } 143 | 144 | public void setAutoGenerateId(boolean isAutoGenerateId) { 145 | this.isAutoGenerateId = isAutoGenerateId; 146 | } 147 | 148 | public synchronized Long getId() { 149 | if (id == null && isAutoGenerateId) { 150 | id = SnowflakeUtil.uniqueLong(); 151 | } 152 | return id; 153 | } 154 | 155 | public void setId(Long id) { 156 | this.id = id; 157 | } 158 | 159 | public String getKnowledgeDocumentTypeUuid() { 160 | return knowledgeDocumentTypeUuid; 161 | } 162 | 163 | public void setKnowledgeDocumentTypeUuid(String knowledgeDocumentTypeUuid) { 164 | this.knowledgeDocumentTypeUuid = knowledgeDocumentTypeUuid; 165 | } 166 | 167 | public Long getKnowledgeDocumentId() { 168 | return knowledgeDocumentId; 169 | } 170 | 171 | public void setKnowledgeDocumentId(Long knowledgeDocumentId) { 172 | this.knowledgeDocumentId = knowledgeDocumentId; 173 | } 174 | 175 | public Integer getVersion() { 176 | return version; 177 | } 178 | 179 | public void setVersion(Integer version) { 180 | this.version = version; 181 | } 182 | 183 | public String getVersionName() { 184 | if (StringUtils.isBlank(versionName)) { 185 | if (version != null) { 186 | versionName = "版本" + version; 187 | } else { 188 | versionName = "-"; 189 | } 190 | 191 | } 192 | return versionName; 193 | } 194 | 195 | public Integer getFromVersion() { 196 | return fromVersion; 197 | } 198 | 199 | public void setFromVersion(Integer fromVersion) { 200 | this.fromVersion = fromVersion; 201 | } 202 | 203 | public String getFromVersionName() { 204 | if (StringUtils.isBlank(fromVersionName)) { 205 | if (fromVersion != 0) { 206 | fromVersionName = "版本" + fromVersion; 207 | } else { 208 | fromVersionName = "-"; 209 | } 210 | } 211 | return fromVersionName; 212 | } 213 | 214 | public String getStatus() { 215 | return status; 216 | } 217 | 218 | public void setStatus(String status) { 219 | this.status = status; 220 | } 221 | 222 | public KnowledgeDocumentVersionStatusVo getStatusVo() { 223 | if (statusVo == null && StringUtils.isNotBlank(status)) { 224 | statusVo = new KnowledgeDocumentVersionStatusVo(status, KnowledgeDocumentVersionStatus.getText(status), KnowledgeDocumentVersionStatus.getColor(status)); 225 | } 226 | return statusVo; 227 | } 228 | 229 | public void setStatusVo(KnowledgeDocumentVersionStatusVo statusVo) { 230 | this.statusVo = statusVo; 231 | } 232 | 233 | public String getTitle() { 234 | return title; 235 | } 236 | 237 | public void setTitle(String title) { 238 | this.title = title; 239 | } 240 | 241 | public Integer getSize() { 242 | return size; 243 | } 244 | 245 | public void setSize(Integer size) { 246 | this.size = size; 247 | } 248 | 249 | public String getReviewer() { 250 | return reviewer; 251 | } 252 | 253 | public void setReviewer(String reviewer) { 254 | this.reviewer = reviewer; 255 | } 256 | 257 | public Date getReviewTime() { 258 | return reviewTime; 259 | } 260 | 261 | public void setReviewTime(Date reviewerTime) { 262 | this.reviewTime = reviewerTime; 263 | } 264 | 265 | public Integer getSizeDesc() { 266 | return sizeDesc; 267 | } 268 | 269 | public void setSizeDesc(Integer sizeDesc) { 270 | this.sizeDesc = sizeDesc; 271 | } 272 | 273 | public String getReviewerName() { 274 | return reviewerName; 275 | } 276 | 277 | public void setReviewerName(String reviewerName) { 278 | this.reviewerName = reviewerName; 279 | } 280 | 281 | public String getReviewerInfo() { 282 | return reviewerInfo; 283 | } 284 | 285 | public void setReviewerInfo(String reviewerInfo) { 286 | this.reviewerInfo = reviewerInfo; 287 | } 288 | 289 | public String getReviewerAvatar() { 290 | if (StringUtils.isBlank(reviewerAvatar) && StringUtils.isNotBlank(reviewerInfo)) { 291 | JSONObject jsonObject = JSONObject.parseObject(reviewerInfo); 292 | reviewerAvatar = jsonObject.getString("avatar"); 293 | } 294 | return reviewerAvatar; 295 | } 296 | 297 | public void setReviewerAvatar(String reviewerAvatar) { 298 | this.reviewerAvatar = reviewerAvatar; 299 | } 300 | 301 | public List getStatusList() { 302 | return statusList; 303 | } 304 | 305 | public void setStatusList(List statusList) { 306 | this.statusList = statusList; 307 | } 308 | 309 | public Integer getIsEditable() { 310 | return isEditable; 311 | } 312 | 313 | public void setIsEditable(Integer isEditable) { 314 | this.isEditable = isEditable; 315 | } 316 | 317 | public Integer getIsDeletable() { 318 | return isDeletable; 319 | } 320 | 321 | public void setIsDeletable(Integer isDeletable) { 322 | this.isDeletable = isDeletable; 323 | } 324 | 325 | public int getIsCollect() { 326 | return isCollect; 327 | } 328 | 329 | public void setIsCollect(int isCollect) { 330 | this.isCollect = isCollect; 331 | } 332 | 333 | public Integer getIsDelete() { 334 | return isDelete; 335 | } 336 | 337 | public void setIsDelete(Integer isDelete) { 338 | this.isDelete = isDelete; 339 | } 340 | 341 | public List getPath() { 342 | return path; 343 | } 344 | 345 | public void setPath(List path) { 346 | this.path = path; 347 | } 348 | 349 | public List getKnowledgeDocumentLineList() { 350 | return knowledgeDocumentLineList; 351 | } 352 | 353 | public void setKnowledgeDocumentLineList(List knowledgeDocumentLineList) { 354 | this.knowledgeDocumentLineList = knowledgeDocumentLineList; 355 | } 356 | 357 | public List getTagList() { 358 | return tagList; 359 | } 360 | 361 | public void setTagList(List tagList) { 362 | this.tagList = tagList; 363 | } 364 | 365 | public String getSource() { 366 | return source; 367 | } 368 | 369 | public void setSource(String source) { 370 | this.source = source; 371 | } 372 | 373 | public String getContent() { 374 | return content; 375 | } 376 | 377 | public void setContent(String content) { 378 | this.content = content; 379 | } 380 | 381 | public String getLcdStartTime() { 382 | return lcdStartTime; 383 | } 384 | 385 | public void setLcdStartTime(String lcdStartTime) { 386 | this.lcdStartTime = lcdStartTime; 387 | } 388 | 389 | public String getLcdEndTime() { 390 | return lcdEndTime; 391 | } 392 | 393 | public void setLcdEndTime(String lcdEndTime) { 394 | this.lcdEndTime = lcdEndTime; 395 | } 396 | 397 | public List getKnowledgeDocumentVersionIdList() { 398 | return knowledgeDocumentVersionIdList; 399 | } 400 | 401 | public void setKnowledgeDocumentVersionIdList(List knowledgeDocumentVersionIdList) { 402 | this.knowledgeDocumentVersionIdList = knowledgeDocumentVersionIdList; 403 | } 404 | 405 | public List getTagVoList() { 406 | return tagVoList; 407 | } 408 | 409 | public void setTagVoList(List tagVoList) { 410 | this.tagVoList = tagVoList; 411 | } 412 | 413 | public List getLcuList() { 414 | if (CollectionUtils.isNotEmpty(lcuList)) { 415 | lcuList = com.google.common.collect.Lists.newArrayList(lcuList); 416 | for (int i = 0; i < lcuList.size(); i++) { 417 | String tmpUser = lcuList.get(i).replaceAll(GroupSearch.USER.getValuePlugin(), ""); 418 | lcuList.set(i, tmpUser); 419 | } 420 | } 421 | return lcuList; 422 | } 423 | 424 | public void setLcuList(List lcuList) { 425 | this.lcuList = lcuList; 426 | } 427 | 428 | public List getReviewerList() { 429 | return reviewerList; 430 | } 431 | 432 | public void setReviewerList(List reviewerList) { 433 | this.reviewerList = reviewerList; 434 | } 435 | 436 | public List getSourceList() { 437 | return sourceList; 438 | } 439 | 440 | public void setSourceList(List sourceList) { 441 | this.sourceList = sourceList; 442 | } 443 | 444 | public String getReviewDateStartTime() { 445 | return reviewDateStartTime; 446 | } 447 | 448 | public void setReviewDateStartTime(String reviewDateStartTime) { 449 | this.reviewDateStartTime = reviewDateStartTime; 450 | } 451 | 452 | public String getReviewDateEndTime() { 453 | return reviewDateEndTime; 454 | } 455 | 456 | public void setReviewDateEndTime(String reviewDateEndTime) { 457 | this.reviewDateEndTime = reviewDateEndTime; 458 | } 459 | 460 | public List getReviewerRoleUuidList() { 461 | return reviewerRoleUuidList; 462 | } 463 | 464 | public void setReviewerRoleUuidList(List reviewerRoleUuidList) { 465 | this.reviewerRoleUuidList = reviewerRoleUuidList; 466 | } 467 | 468 | public List getReviewerTeamUuidList() { 469 | return reviewerTeamUuidList; 470 | } 471 | 472 | public void setReviewerTeamUuidList(List reviewerTeamUuidList) { 473 | this.reviewerTeamUuidList = reviewerTeamUuidList; 474 | } 475 | 476 | public Integer getIsReviewer() { 477 | return isReviewer; 478 | } 479 | 480 | public void setIsReviewer(Integer isReviewer) { 481 | this.isReviewer = isReviewer; 482 | } 483 | 484 | public Long getKnowledgeCircleId() { 485 | return knowledgeCircleId; 486 | } 487 | 488 | public void setKnowledgeCircleId(Long knowledgeCircleId) { 489 | this.knowledgeCircleId = knowledgeCircleId; 490 | } 491 | 492 | public String getRejectReason() { 493 | return rejectReason; 494 | } 495 | 496 | public void setRejectReason(String rejectReason) { 497 | this.rejectReason = rejectReason; 498 | } 499 | 500 | public String getSourceName() { 501 | if (StringUtils.isNotBlank(source)) { 502 | SyncSourceVo syncSource = SyncSourceFactory.getSourceMap().get(source); 503 | if (syncSource != null) { 504 | this.setSourceName(syncSource.getSourceName() + "转知识"); 505 | } 506 | } 507 | return sourceName; 508 | } 509 | 510 | public void setSourceName(String sourceName) { 511 | this.sourceName = sourceName; 512 | } 513 | 514 | 515 | } 516 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeDocumentVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.JSONObject; 5 | import com.alibaba.fastjson.annotation.JSONField; 6 | import neatlogic.framework.common.constvalue.ApiParamType; 7 | import neatlogic.framework.common.constvalue.GroupSearch; 8 | import neatlogic.framework.common.dto.BaseEditorVo; 9 | import neatlogic.framework.dto.WorkAssignmentUnitVo; 10 | import neatlogic.framework.file.dto.FileVo; 11 | import neatlogic.framework.knowledge.source.SyncSourceFactory; 12 | import neatlogic.framework.restful.annotation.EntityField; 13 | import neatlogic.framework.util.SnowflakeUtil; 14 | import neatlogic.framework.util.TimeUtil; 15 | import org.apache.commons.collections4.CollectionUtils; 16 | import org.apache.commons.lang3.StringUtils; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | public class KnowledgeDocumentVo extends BaseEditorVo { 22 | // @ESKey(type = ESKeyType.PKEY, name = "documentId") 23 | @EntityField(name = "文档id", type = ApiParamType.LONG) 24 | private Long id; 25 | @EntityField(name = "版本id", type = ApiParamType.LONG) 26 | private Long knowledgeDocumentVersionId; 27 | @EntityField(name = "版本号", type = ApiParamType.STRING) 28 | private Integer version; 29 | @EntityField(name = "类型uuid", type = ApiParamType.STRING) 30 | private String knowledgeDocumentTypeUuid; 31 | @EntityField(name = "知识圈id", type = ApiParamType.LONG) 32 | private Long knowledgeCircleId; 33 | @EntityField(name = "知识圈名", type = ApiParamType.LONG) 34 | private String knowledgeCircleName; 35 | @EntityField(name = "标题", type = ApiParamType.STRING) 36 | private String title; 37 | @EntityField(name = "行数据列表", type = ApiParamType.JSONARRAY) 38 | private List lineList = new ArrayList<>(); 39 | @EntityField(name = "附件列表", type = ApiParamType.JSONARRAY) 40 | private List fileList = new ArrayList<>(); 41 | @EntityField(name = "标签名列表", type = ApiParamType.JSONARRAY) 42 | private List tagList = new ArrayList<>(); 43 | @EntityField(name = "是否可编辑", type = ApiParamType.INTEGER) 44 | private Integer isEditable; 45 | @EntityField(name = "是否可删除", type = ApiParamType.INTEGER) 46 | private Integer isDeletable; 47 | @EntityField(name = "是否可审核", type = ApiParamType.INTEGER) 48 | private Integer isReviewable; 49 | private List fileIdList = new ArrayList<>(); 50 | private List tagIdList = new ArrayList<>(); 51 | @EntityField(name = "标签列表", type = ApiParamType.JSONARRAY) 52 | private List tagVoList = new ArrayList<>(); 53 | @EntityField(name = "是否收藏", type = ApiParamType.INTEGER) 54 | private int isCollect; 55 | @EntityField(name = "是否点赞", type = ApiParamType.INTEGER) 56 | private int isFavor; 57 | @EntityField(name = "点赞量", type = ApiParamType.INTEGER) 58 | private int favorCount; 59 | @EntityField(name = "收藏量", type = ApiParamType.INTEGER) 60 | private int collectCount; 61 | @EntityField(name = "浏览量", type = ApiParamType.INTEGER) 62 | private int viewCount; 63 | @EntityField(name = "知识内容", type = ApiParamType.STRING) 64 | private String content; 65 | @EntityField(name = "知识内容(已截取)", type = ApiParamType.STRING) 66 | private String contentShortCut; 67 | @EntityField(name = "路径", type = ApiParamType.JSONARRAY) 68 | private List path = new ArrayList<>(); 69 | @EntityField(name = "是否是当前版本", type = ApiParamType.INTEGER) 70 | private Integer isCurrentVersion; 71 | @EntityField(name = "知识文档类型路径", type = ApiParamType.STRING) 72 | private String documentTypePath; 73 | @EntityField(name = "当前知识文档版本状态", type = ApiParamType.STRING) 74 | private String status; 75 | @EntityField(name = "调用者id", type = ApiParamType.LONG) 76 | private Long invokeId; 77 | @EntityField(name = "来源", type = ApiParamType.STRING) 78 | private String source; 79 | @EntityField(name = "来源名", type = ApiParamType.STRING) 80 | private String sourceName; 81 | @EntityField(name = "审核人列表", type = ApiParamType.JSONARRAY) 82 | private List reviewerVoList; 83 | @EntityField(name = "不通过原因", type = ApiParamType.STRING) 84 | private String rejectReason; 85 | @EntityField(name = "审核人", type = ApiParamType.JSONOBJECT) 86 | private WorkAssignmentUnitVo reviewerVo; 87 | @EntityField(name = "当前用户是否是审核人", type = ApiParamType.INTEGER) 88 | private Integer isReviewer; 89 | @EntityField(name = "当前用户是否是成员", type = ApiParamType.INTEGER) 90 | private Integer isMember; 91 | @JSONField(serialize=false) 92 | private Integer isDelete; 93 | @JSONField(serialize=false) 94 | private boolean isAutoGenerateId = true; 95 | @JSONField(serialize=false) 96 | private String type; 97 | @JSONField(serialize=false) 98 | private List knowledgeDocumentIdList; 99 | @JSONField(serialize=false) 100 | private String lcdStartTime; 101 | @JSONField(serialize=false) 102 | private String lcdEndTime; 103 | @JSONField(serialize=false) 104 | private String collector; 105 | @JSONField(serialize=false) 106 | private List lcuList; 107 | @JSONField(serialize=false) 108 | private List reviewerList; 109 | @JSONField(serialize=false) 110 | private List sourceList; 111 | @JSONField(serialize=false) 112 | private List statusList; 113 | @JSONField(serialize=false) 114 | private String circleUserUuid; 115 | @JSONField(serialize=false) 116 | private List circleTeamUuidList; 117 | @JSONField(serialize=false) 118 | private List circleRoleUuidList; 119 | @JSONField(serialize=false) 120 | private List knowledgeDocumentTypeUuidList; 121 | 122 | public KnowledgeDocumentVo() {} 123 | 124 | public KnowledgeDocumentVo(JSONObject paramJson) { 125 | JSONObject lcd = paramJson.getJSONObject("lcd"); 126 | paramJson.remove("lcd"); 127 | KnowledgeDocumentVo tmpVo = JSON.toJavaObject(paramJson, KnowledgeDocumentVo.class); 128 | this.setPageSize(tmpVo.getPageSize()); 129 | this.setCurrentPage(tmpVo.getCurrentPage()); 130 | this.setKeyword(tmpVo.getKeyword()); 131 | this.knowledgeDocumentTypeUuid = tmpVo.getKnowledgeDocumentTypeUuid(); 132 | this.lcuList = tmpVo.getLcuList(); 133 | this.tagList = tmpVo.getTagList(); 134 | this.sourceList = tmpVo.getSourceList(); 135 | this.collector = tmpVo.getCollector(); 136 | if (lcd != null) { 137 | JSONObject lcdJson = TimeUtil.getStartTimeAndEndTimeByDateJson(lcd); 138 | this.lcdStartTime = lcdJson.getString("startTime"); 139 | this.lcdEndTime = lcdJson.getString("endTime"); 140 | } 141 | } 142 | 143 | public String getType() { 144 | return type; 145 | } 146 | public void setType(String type) { 147 | this.type = type; 148 | } 149 | public boolean isAutoGenerateId() { 150 | return isAutoGenerateId; 151 | } 152 | public void setAutoGenerateId(boolean isAutoGenerateId) { 153 | this.isAutoGenerateId = isAutoGenerateId; 154 | } 155 | public synchronized Long getId() { 156 | if(id == null && isAutoGenerateId) { 157 | id = SnowflakeUtil.uniqueLong(); 158 | } 159 | return id; 160 | } 161 | public void setId(Long id) { 162 | this.id = id; 163 | } 164 | public Long getKnowledgeDocumentVersionId() { 165 | return knowledgeDocumentVersionId; 166 | } 167 | public void setKnowledgeDocumentVersionId(Long knowledgeDocumentVersionId) { 168 | this.knowledgeDocumentVersionId = knowledgeDocumentVersionId; 169 | } 170 | public Integer getVersion() { 171 | return version; 172 | } 173 | public void setVersion(Integer version) { 174 | this.version = version; 175 | } 176 | 177 | public String getKnowledgeDocumentTypeUuid() { 178 | return knowledgeDocumentTypeUuid; 179 | } 180 | 181 | public void setKnowledgeDocumentTypeUuid(String knowledgeDocumentTypeUuid) { 182 | this.knowledgeDocumentTypeUuid = knowledgeDocumentTypeUuid; 183 | } 184 | 185 | public Long getKnowledgeCircleId() { 186 | return knowledgeCircleId; 187 | } 188 | public void setKnowledgeCircleId(Long knowledgeCircleId) { 189 | this.knowledgeCircleId = knowledgeCircleId; 190 | } 191 | public String getTitle() { 192 | return title; 193 | } 194 | public void setTitle(String title) { 195 | this.title = title; 196 | } 197 | public List getLineList() { 198 | return lineList; 199 | } 200 | public void setLineList(List lineList) { 201 | this.lineList = lineList; 202 | } 203 | public List getFileList() { 204 | return fileList; 205 | } 206 | public void setFileList(List fileList) { 207 | this.fileList = fileList; 208 | } 209 | public List getTagList() { 210 | return tagList; 211 | } 212 | public void setTagList(List tagList) { 213 | this.tagList = tagList; 214 | } 215 | public List getFileIdList() { 216 | return fileIdList; 217 | } 218 | public void setFileIdList(List fileIdList) { 219 | this.fileIdList = fileIdList; 220 | } 221 | public List getTagIdList() { 222 | return tagIdList; 223 | } 224 | public void setTagIdList(List tagIdList) { 225 | this.tagIdList = tagIdList; 226 | } 227 | public Integer getIsDelete() { 228 | return isDelete; 229 | } 230 | public void setIsDelete(Integer isDelete) { 231 | this.isDelete = isDelete; 232 | } 233 | public Integer getIsEditable() { 234 | return isEditable; 235 | } 236 | public void setIsEditable(Integer isEditable) { 237 | this.isEditable = isEditable; 238 | } 239 | public Integer getIsDeletable() { 240 | return isDeletable; 241 | } 242 | public void setIsDeletable(Integer isDeletable) { 243 | this.isDeletable = isDeletable; 244 | } 245 | public Integer getIsReviewable() { 246 | return isReviewable; 247 | } 248 | public void setIsReviewable(Integer isReviewable) { 249 | this.isReviewable = isReviewable; 250 | } 251 | public int getIsCollect() { 252 | return isCollect; 253 | } 254 | public void setIsCollect(int isCollect) { 255 | this.isCollect = isCollect; 256 | } 257 | public int getIsFavor() { 258 | return isFavor; 259 | } 260 | public void setIsFavor(int isFavor) { 261 | this.isFavor = isFavor; 262 | } 263 | public int getFavorCount() { 264 | return favorCount; 265 | } 266 | public void setFavorCount(int favorCount) { 267 | this.favorCount = favorCount; 268 | } 269 | public int getCollectCount() { 270 | return collectCount; 271 | } 272 | public void setCollectCount(int collectCount) { 273 | this.collectCount = collectCount; 274 | } 275 | public int getViewCount() { 276 | return viewCount; 277 | } 278 | public void setViewCount(int viewCount) { 279 | this.viewCount = viewCount; 280 | } 281 | public String getContent() { 282 | return content; 283 | } 284 | public void setContent(String content) { 285 | this.content = content; 286 | } 287 | public List getPath() { 288 | return path; 289 | } 290 | public void setPath(List path) { 291 | this.path = path; 292 | } 293 | public Integer getIsCurrentVersion() { 294 | return isCurrentVersion; 295 | } 296 | public void setIsCurrentVersion(Integer isCurrentVersion) { 297 | this.isCurrentVersion = isCurrentVersion; 298 | } 299 | public String getKnowledgeCircleName() { 300 | return knowledgeCircleName; 301 | } 302 | public void setKnowledgeCircleName(String knowledgeCircleName) { 303 | this.knowledgeCircleName = knowledgeCircleName; 304 | } 305 | public String getDocumentTypePath() { 306 | return documentTypePath; 307 | } 308 | public void setDocumentTypePath(String documentTypePath) { 309 | this.documentTypePath = documentTypePath; 310 | } 311 | public List getTagVoList() { 312 | return tagVoList; 313 | } 314 | public void setTagVoList(List tagVoList) { 315 | this.tagVoList = tagVoList; 316 | } 317 | public String getStatus() { 318 | return status; 319 | } 320 | public void setStatus(String status) { 321 | this.status = status; 322 | } 323 | public Long getInvokeId() { 324 | return invokeId; 325 | } 326 | public void setInvokeId(Long invokeId) { 327 | this.invokeId = invokeId; 328 | } 329 | public String getSource() { 330 | return source; 331 | } 332 | public void setSource(String source) { 333 | this.source = source; 334 | } 335 | public List getKnowledgeDocumentIdList() { 336 | return knowledgeDocumentIdList; 337 | } 338 | public void setKnowledgeDocumentIdList(List knowledgeDocumentIdList) { 339 | this.knowledgeDocumentIdList = knowledgeDocumentIdList; 340 | } 341 | public String getLcdStartTime() { 342 | return lcdStartTime; 343 | } 344 | public void setLcdStartTime(String lcdStartTime) { 345 | this.lcdStartTime = lcdStartTime; 346 | } 347 | public String getLcdEndTime() { 348 | return lcdEndTime; 349 | } 350 | public void setLcdEndTime(String lcdEndTime) { 351 | this.lcdEndTime = lcdEndTime; 352 | } 353 | public String getCollector() { 354 | if(StringUtils.isNotBlank(collector)) { 355 | collector = collector.replaceAll(GroupSearch.USER.getValuePlugin(), ""); 356 | } 357 | return collector; 358 | } 359 | public void setCollector(String collector) { 360 | this.collector = collector; 361 | } 362 | public List getLcuList() { 363 | if(CollectionUtils.isNotEmpty(lcuList)) { 364 | for(int i = 0;i lcuList) { 371 | this.lcuList = lcuList; 372 | } 373 | public List getReviewerList() { 374 | return reviewerList; 375 | } 376 | public void setReviewerList(List reviewerList) { 377 | this.reviewerList = reviewerList; 378 | } 379 | public List getSourceList() { 380 | return sourceList; 381 | } 382 | public void setSourceList(List sourceList) { 383 | this.sourceList = sourceList; 384 | } 385 | public List getStatusList() { 386 | return statusList; 387 | } 388 | public void setStatusList(List statusList) { 389 | this.statusList = statusList; 390 | } 391 | public String getSourceName() { 392 | if(StringUtils.isNotBlank(source)) { 393 | SyncSourceVo syncSource = SyncSourceFactory.getSourceMap().get(source); 394 | if(syncSource != null) { 395 | this.setSourceName(syncSource.getSourceName()+"转知识"); 396 | } 397 | } 398 | return sourceName; 399 | } 400 | public void setSourceName(String sourceName) { 401 | this.sourceName = sourceName; 402 | } 403 | public String getCircleUserUuid() { 404 | return circleUserUuid; 405 | } 406 | public void setCircleUserUuid(String circleUserUuid) { 407 | this.circleUserUuid = circleUserUuid; 408 | } 409 | public List getCircleTeamUuidList() { 410 | return circleTeamUuidList; 411 | } 412 | public void setCircleTeamUuidList(List circleTeamUuidList) { 413 | this.circleTeamUuidList = circleTeamUuidList; 414 | } 415 | public List getCircleRoleUuidList() { 416 | return circleRoleUuidList; 417 | } 418 | public void setCircleRoleUuidList(List circleRoleUuidList) { 419 | this.circleRoleUuidList = circleRoleUuidList; 420 | } 421 | 422 | public List getReviewerVoList() { 423 | return reviewerVoList; 424 | } 425 | 426 | public void setReviewerVoList(List reviewerVoList) { 427 | this.reviewerVoList = reviewerVoList; 428 | } 429 | 430 | public String getRejectReason() { 431 | return rejectReason; 432 | } 433 | 434 | public void setRejectReason(String rejectReason) { 435 | this.rejectReason = rejectReason; 436 | } 437 | 438 | public WorkAssignmentUnitVo getReviewerVo() { 439 | return reviewerVo; 440 | } 441 | 442 | public void setReviewerVo(WorkAssignmentUnitVo reviewerVo) { 443 | this.reviewerVo = reviewerVo; 444 | } 445 | 446 | public Integer getIsReviewer() { 447 | return isReviewer; 448 | } 449 | 450 | public void setIsReviewer(Integer isReviewer) { 451 | this.isReviewer = isReviewer; 452 | } 453 | 454 | public String getContentShortCut() { 455 | return contentShortCut; 456 | } 457 | 458 | public void setContentShortCut(String contentShortCut) { 459 | this.contentShortCut = contentShortCut; 460 | } 461 | 462 | public Integer getIsMember() { 463 | return isMember; 464 | } 465 | 466 | public void setIsMember(Integer isMember) { 467 | this.isMember = isMember; 468 | } 469 | 470 | public List getKnowledgeDocumentTypeUuidList() { 471 | return knowledgeDocumentTypeUuidList; 472 | } 473 | 474 | public void setKnowledgeDocumentTypeUuidList(List knowledgeDocumentTypeUuidList) { 475 | this.knowledgeDocumentTypeUuidList = knowledgeDocumentTypeUuidList; 476 | } 477 | } 478 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeTagVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.util.SnowflakeUtil; 4 | 5 | public class KnowledgeTagVo { 6 | 7 | private Long id; 8 | private String name; 9 | public KnowledgeTagVo() {} 10 | public KnowledgeTagVo(String name) { 11 | this.name = name; 12 | } 13 | public synchronized Long getId() { 14 | if(id == null) { 15 | id = SnowflakeUtil.uniqueLong(); 16 | } 17 | return id; 18 | } 19 | public void setId(Long id) { 20 | this.id = id; 21 | } 22 | public String getName() { 23 | return name; 24 | } 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeTemplateVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.common.constvalue.ApiParamType; 4 | import neatlogic.framework.common.dto.BaseEditorVo; 5 | import neatlogic.framework.restful.annotation.EntityField; 6 | import neatlogic.framework.util.SnowflakeUtil; 7 | 8 | public class KnowledgeTemplateVo extends BaseEditorVo { 9 | 10 | @EntityField(name = "知识模版ID", type = ApiParamType.LONG) 11 | private Long id; 12 | @EntityField(name = "知识模版名称", type = ApiParamType.STRING) 13 | private String name; 14 | @EntityField(name = "导航目录", type = ApiParamType.STRING) 15 | private String content; 16 | @EntityField(name = "是否激活", type = ApiParamType.INTEGER) 17 | private Integer isActive; 18 | 19 | public KnowledgeTemplateVo() {} 20 | 21 | public Long getId() { 22 | if(id == null){ 23 | id = SnowflakeUtil.uniqueLong(); 24 | } 25 | return id; 26 | } 27 | 28 | public void setId(Long id) { 29 | this.id = id; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public String getContent() { 41 | return content; 42 | } 43 | 44 | public void setContent(String content) { 45 | this.content = content; 46 | } 47 | 48 | public Integer getIsActive() { 49 | return isActive; 50 | } 51 | 52 | public void setIsActive(Integer isActive) { 53 | this.isActive = isActive; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/KnowledgeTypeVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | import neatlogic.framework.asynchronization.threadlocal.UserContext; 4 | import neatlogic.framework.common.constvalue.GroupSearch; 5 | import neatlogic.framework.knowledge.constvalue.KnowledgeDocumentVersionStatus; 6 | import neatlogic.framework.knowledge.constvalue.KnowledgeType; 7 | import com.alibaba.fastjson.JSONObject; 8 | 9 | import java.util.Arrays; 10 | 11 | public class KnowledgeTypeVo { 12 | 13 | private String value; 14 | private String text; 15 | private int count; 16 | private JSONObject defaultCondition; 17 | public KnowledgeTypeVo(KnowledgeType type) { 18 | this.value = type.getValue(); 19 | this.text = type.getText(); 20 | } 21 | public String getValue() { 22 | return value; 23 | } 24 | public void setValue(String value) { 25 | this.value = value; 26 | } 27 | public String getText() { 28 | return text; 29 | } 30 | public void setText(String text) { 31 | this.text = text; 32 | } 33 | public int getCount() { 34 | return count; 35 | } 36 | public void setCount(int count) { 37 | this.count = count; 38 | } 39 | public JSONObject getDefaultCondition() { 40 | if(defaultCondition == null) { 41 | defaultCondition = new JSONObject(); 42 | defaultCondition.put("type", "documentVersion"); 43 | if(KnowledgeType.WAITINGFORREVIEW.getValue().equals(this.value)) { 44 | defaultCondition.put("reviewerList", Arrays.asList(GroupSearch.USER.getValuePlugin()+UserContext.get().getUserUuid())); 45 | defaultCondition.put("statusList", Arrays.asList(KnowledgeDocumentVersionStatus.SUBMITTED.getValue())); 46 | }else if(KnowledgeType.SHARE.getValue().equals(this.value)){ 47 | defaultCondition.put("lcuList", Arrays.asList(GroupSearch.USER.getValuePlugin()+UserContext.get().getUserUuid())); 48 | defaultCondition.put("statusList", Arrays.asList(KnowledgeDocumentVersionStatus.ALL.getValue())); 49 | }else if(KnowledgeType.COLLECT.getValue().equals(this.value)){ 50 | defaultCondition.put("collector", GroupSearch.USER.getValuePlugin()+UserContext.get().getUserUuid()); 51 | defaultCondition.put("type", "document"); 52 | defaultCondition.put("statusList", Arrays.asList(KnowledgeDocumentVersionStatus.PASSED.getValue())); 53 | }else if(KnowledgeType.DRAFT.getValue().equals(this.value)){ 54 | defaultCondition.put("lcuList", Arrays.asList(GroupSearch.USER.getValuePlugin()+UserContext.get().getUserUuid())); 55 | defaultCondition.put("statusList", Arrays.asList(KnowledgeDocumentVersionStatus.DRAFT.getValue())); 56 | }else if(KnowledgeType.ALL.getValue().equals(this.getValue())) { 57 | defaultCondition.put("type", "document"); 58 | defaultCondition.put("statusList", Arrays.asList(KnowledgeDocumentVersionStatus.PASSED.getValue())); 59 | } 60 | 61 | } 62 | return defaultCondition; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/dto/SyncSourceVo.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.dto; 2 | 3 | public class SyncSourceVo { 4 | private String source; 5 | private String sourceName; 6 | public String getSource() { 7 | return source; 8 | } 9 | public void setSource(String source) { 10 | this.source = source; 11 | } 12 | public String getSourceName() { 13 | return sourceName; 14 | } 15 | public void setSourceName(String sourceName) { 16 | this.sourceName = sourceName; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeCircleHasKnowledgeException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeCircleHasKnowledgeException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -380236429435380456L; 8 | 9 | public KnowledgeCircleHasKnowledgeException(Long id) { 10 | super("知识圈:“{0}”中已存在文档,不可删除", id); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeCircleNameRepeatException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeCircleNameRepeatException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -5574780571750812574L; 8 | 9 | public KnowledgeCircleNameRepeatException(String name) { 10 | super("知识圈:“{0}”已存在", name); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeCircleNotFoundEditTargetException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.NotFoundEditTargetException; 4 | 5 | public class KnowledgeCircleNotFoundEditTargetException extends NotFoundEditTargetException { 6 | 7 | private static final long serialVersionUID = -919485022666974049L; 8 | 9 | public KnowledgeCircleNotFoundEditTargetException(Long id) { 10 | super("nfke.knowledgecirclenotfoundedittargetexception.knowledgecirclenotfoundedittargetexception", id); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeCircleNotFoundException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeCircleNotFoundException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -919485022666974048L; 8 | 9 | public KnowledgeCircleNotFoundException(Long id) { 10 | super("知识圈:{0}不存在", id); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentCurrentUserNotMemberException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentCurrentUserNotMemberException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -2647202188708812513L; 8 | 9 | public KnowledgeDocumentCurrentUserNotMemberException() { 10 | super("当前用户不是成员,无权限执行此操作"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentCurrentUserNotOwnerException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentCurrentUserNotOwnerException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 3870135806607487845L; 8 | 9 | public KnowledgeDocumentCurrentUserNotOwnerException() { 10 | super("当前用户不是该草稿的所有者,无权限执行此操作"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentCurrentUserNotReviewerException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentCurrentUserNotReviewerException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -4045126943871911846L; 8 | 9 | public KnowledgeDocumentCurrentUserNotReviewerException() { 10 | super("当前用户不是审核人,无权限执行此操作"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentCurrentVersionCannotBeDeletedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentCurrentVersionCannotBeDeletedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 1035159337589949165L; 8 | 9 | public KnowledgeDocumentCurrentVersionCannotBeDeletedException() { 10 | super("文档当前版本不允许删除"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftExpiredCannotBeModifiedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftExpiredCannotBeModifiedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 5096757106289969691L; 8 | 9 | public KnowledgeDocumentDraftExpiredCannotBeModifiedException() { 10 | super("该文档草稿已过期,不能再修改,请在文档的当前版本上修改"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftExpiredCannotSubmitException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftExpiredCannotSubmitException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 984692472481791872L; 8 | 9 | public KnowledgeDocumentDraftExpiredCannotSubmitException(Long id) { 10 | super("文档草稿:“{0}”已过期不能提交", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftPublishedCannotBeModifiedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftPublishedCannotBeModifiedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -6817743906280750578L; 8 | 9 | public KnowledgeDocumentDraftPublishedCannotBeModifiedException() { 10 | super("该文档草稿已发布,不能再修改,请在文档的当前版本上修改"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftReviewedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftReviewedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 8651017043019488660L; 8 | 9 | public KnowledgeDocumentDraftReviewedException() { 10 | super("nfke.knowledgedocumentdraftreviewedexception.knowledgedocumentdraftreviewedexception"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftSubmitFailedExecption.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftSubmitFailedExecption extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -7127685028688353196L; 8 | 9 | public KnowledgeDocumentDraftSubmitFailedExecption() { 10 | super("该文档已有其他待审核草稿,暂时不能提交"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftSubmittedCannotBeDeletedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftSubmittedCannotBeDeletedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -3200607738061745327L; 8 | public KnowledgeDocumentDraftSubmittedCannotBeDeletedException(){ 9 | super("该文档草稿已提交,不能删除"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftSubmittedCannotBeModifiedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftSubmittedCannotBeModifiedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 1183935503393911341L; 8 | 9 | public KnowledgeDocumentDraftSubmittedCannotBeModifiedException() { 10 | super("该文档草稿已提交,不能再修改,请在文档的当前版本上修改"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftSubmittedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftSubmittedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 1675060542349897055L; 8 | 9 | public KnowledgeDocumentDraftSubmittedException() { 10 | super("该文档草稿已经提交过,不能重复提交,请在该文档的当前版本上修改后保存草稿再提交"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentDraftUnsubmittedCannotBeReviewedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentDraftUnsubmittedCannotBeReviewedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -8320690753297472640L; 8 | 9 | public KnowledgeDocumentDraftUnsubmittedCannotBeReviewedException() { 10 | super("该文档草稿未提交,不能审核"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentHasBeenCollectedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentHasBeenCollectedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -568671825480042607L; 8 | 9 | public KnowledgeDocumentHasBeenCollectedException(Long id) { 10 | super("您已收藏文档:{0}", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentHasBeenDeletedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentHasBeenDeletedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -5791042284219697759L; 8 | 9 | public KnowledgeDocumentHasBeenDeletedException(Long id) { 10 | super("文档:“{0}”已被删除", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentHasBeenFavoredException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentHasBeenFavoredException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 4725067136465559549L; 8 | 9 | public KnowledgeDocumentHasBeenFavoredException(String title) { 10 | super("您已点赞文档:{0}", title); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentNotFoundEditTargetException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.NotFoundEditTargetException; 4 | 5 | public class KnowledgeDocumentNotFoundEditTargetException extends NotFoundEditTargetException { 6 | 7 | private static final long serialVersionUID = 1669102356313895842L; 8 | 9 | public KnowledgeDocumentNotFoundEditTargetException(Long id) { 10 | super("nfke.knowledgedocumentnotfoundedittargetexception.knowledgedocumentnotfoundedittargetexception", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentNotFoundException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentNotFoundException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 1669102356313895840L; 8 | 9 | public KnowledgeDocumentNotFoundException(Long id) { 10 | super("知识库文档:“{0}”不存在", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentNotHistoricalVersionException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentNotHistoricalVersionException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -5142955558690729434L; 8 | 9 | public KnowledgeDocumentNotHistoricalVersionException(Long id) { 10 | super("文档草稿:“{0}”不是文档的历史版本,不能回退", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentRepeatInvokeException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentRepeatInvokeException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -5425416746534756745L; 8 | 9 | public KnowledgeDocumentRepeatInvokeException() { 10 | super("一个引用方只能引用一个知识文档"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentTitleRepeatException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentTitleRepeatException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -4997134182698313408L; 8 | 9 | public KnowledgeDocumentTitleRepeatException(String title) { 10 | super("知识标题:“{0}”已存在", title); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentTypeNotFoundException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentTypeNotFoundException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -6399417451182542331L; 8 | 9 | public KnowledgeDocumentTypeNotFoundException(String uuid) { 10 | super("知识类型:{0}不存在", uuid); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentUnmodifiedCannotBeSavedException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentUnmodifiedCannotBeSavedException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 505929515870442177L; 8 | 9 | public KnowledgeDocumentUnmodifiedCannotBeSavedException(){ 10 | super("文档未经修改"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentVersionNotFoundEditTargetException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.NotFoundEditTargetException; 4 | 5 | public class KnowledgeDocumentVersionNotFoundEditTargetException extends NotFoundEditTargetException { 6 | 7 | private static final long serialVersionUID = 8975582712748692018L; 8 | 9 | public KnowledgeDocumentVersionNotFoundEditTargetException(Long id) { 10 | super("nfke.knowledgedocumentversionnotfoundedittargetexception.knowledgedocumentversionnotfoundedittargetexception", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentVersionNotFoundException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentVersionNotFoundException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = 8975582712748692017L; 8 | 9 | public KnowledgeDocumentVersionNotFoundException(Long id) { 10 | super("知识库文档版本:“{0}”不存在", id); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeDocumentVersionSwitchFailedExecption.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeDocumentVersionSwitchFailedExecption extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -6922309555256498892L; 8 | 9 | public KnowledgeDocumentVersionSwitchFailedExecption() { 10 | super("该文档已有其他待审核草稿,暂时不能切换"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeTemplateNameRepeatException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeTemplateNameRepeatException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -4894671473727349454L; 8 | 9 | public KnowledgeTemplateNameRepeatException(String name) { 10 | super("知识模版:“{0}”已存在", name); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeTemplateNotFoundEditTargetException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.NotFoundEditTargetException; 4 | 5 | public class KnowledgeTemplateNotFoundEditTargetException extends NotFoundEditTargetException { 6 | 7 | private static final long serialVersionUID = -5268810011964811913L; 8 | 9 | public KnowledgeTemplateNotFoundEditTargetException(Long id) { 10 | super("nfke.knowledgetemplatenotfoundedittargetexception.knowledgetemplatenotfoundedittargetexception", id); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/exception/KnowledgeTemplateNotFoundException.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.exception; 2 | 3 | import neatlogic.framework.exception.core.ApiRuntimeException; 4 | 5 | public class KnowledgeTemplateNotFoundException extends ApiRuntimeException { 6 | 7 | private static final long serialVersionUID = -5268810011964811912L; 8 | 9 | public KnowledgeTemplateNotFoundException(Long id) { 10 | super("知识模版:{0}不存在", id); 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/linehandler/core/KnowledgeLineHandlerBase.java: -------------------------------------------------------------------------------- 1 | /*Copyright (C) 2023 深圳极向量科技有限公司 All Rights Reserved. 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Affero General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU Affero General Public License for more details. 12 | 13 | You should have received a copy of the GNU Affero General Public License 14 | along with this program. If not, see .*/ 15 | 16 | package neatlogic.framework.knowledge.linehandler.core; 17 | 18 | import neatlogic.framework.lcs.BaseLineVo; 19 | import neatlogic.framework.lcs.linehandler.core.ILineHandler; 20 | import org.jsoup.nodes.Element; 21 | 22 | public abstract class KnowledgeLineHandlerBase implements ILineHandler { 23 | 24 | /** 25 | * 将contend 转为 html 26 | * 27 | * @param line 行对象 28 | * @return html 29 | */ 30 | public String convertContentToHtml(BaseLineVo line) { 31 | return myConvertContentToHtml(line); 32 | } 33 | 34 | protected String myConvertContentToHtml(BaseLineVo line) { 35 | return "<" + this.getHandler() + ">" 36 | + (line.getContent() != null ? line.getContent() : "") 37 | + ""; 38 | } 39 | 40 | /** 41 | * 将html 转为content 42 | * 43 | * @param element html 44 | * @return 知识内容 45 | */ 46 | public String convertHtmlToContent(Element element) { 47 | return myConvertHtmlToContent(element); 48 | } 49 | 50 | protected String myConvertHtmlToContent(Element element) { 51 | return element.html(); 52 | } 53 | 54 | public String convertHtmlToConfig(Element element) { 55 | return myConvertHtmlToConfig(element); 56 | } 57 | 58 | protected String myConvertHtmlToConfig(Element element) { 59 | return null; 60 | } 61 | 62 | public String getRealHandler(Element element){ 63 | return myRealHandler(element); 64 | } 65 | 66 | protected String myRealHandler(Element element){ 67 | return getHandler(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/source/ISyncSource.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.source; 2 | 3 | import java.util.List; 4 | 5 | import neatlogic.framework.knowledge.dto.SyncSourceVo; 6 | 7 | public interface ISyncSource { 8 | 9 | public List getSyncSource(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/neatlogic/framework/knowledge/source/SyncSourceFactory.java: -------------------------------------------------------------------------------- 1 | package neatlogic.framework.knowledge.source; 2 | 3 | import neatlogic.framework.knowledge.dto.SyncSourceVo; 4 | import org.reflections.Reflections; 5 | 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.Set; 10 | 11 | public class SyncSourceFactory { 12 | private static Map syncSourceMap = new HashMap(); 13 | static { 14 | Reflections reflections = new Reflections("neatlogic"); 15 | Set> syncSourceClass = reflections.getSubTypesOf(ISyncSource.class); 16 | for (Class c: syncSourceClass) { 17 | try { 18 | Object[] objects = c.getEnumConstants(); 19 | @SuppressWarnings("unchecked") 20 | List syncSourceList = (List) c.getMethod("getSyncSource").invoke(objects[0]); 21 | for(SyncSourceVo syncSourceVo: syncSourceList) { 22 | syncSourceMap.put(syncSourceVo.getSource(), syncSourceVo); 23 | } 24 | } catch (Exception e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | } 29 | public static Map getSourceMap() { 30 | return syncSourceMap; 31 | } 32 | 33 | } 34 | --------------------------------------------------------------------------------