diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 00000000..46774343 --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,16 @@ +name: Greetings + +on: [pull_request_target, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "Message that will be displayed on users' first issue" + pr-message: "Message that will be displayed on users' first pull request" diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c6f23056..5312704f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -10,25 +10,21 @@ name: Java CI with Maven on: push: - branches: [ "master", "dev" ] + branches: [ "master" ] pull_request: - branches: [ "master", "dev" ] + branches: [ "master" ] jobs: build: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest, macos-latest, ubuntu-latest] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 20.0.2 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '20.0.2' + java-version: '17' distribution: 'temurin' cache: maven - name: Build with Maven diff --git a/.gitignore b/.gitignore index 90124a04..fd35dd9c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,4 @@ hs_err_pid* **/*.iml .gitattributes -/api/src/main/resources/application-prod.yml -/api/src/main/resources/application-dev.yml - -/log -**/log/ \ No newline at end of file +/api/src/main/resources/application-prod.yml \ No newline at end of file diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index 57f9e5bc..00000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, February 2023 - http://www.apache.org/licenses/LICENSE-2.0 - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/LICENSE-MIT b/LICENSE-MIT deleted file mode 100644 index 1e61332a..00000000 --- a/LICENSE-MIT +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (C) 2023-2033 WanSen AI Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index eaafa298..d729b64c 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,6 @@ If you have any questions or suggestions, please submit [issue](https://github.c preview address: http://erp.wansen.cloud/ -## Version -1. 1.0.2 (current version) -2. 1.0.1 [old versions](https://github.com/wansenai/wansen-erp/releases/tag/V1.0.1) - ## Module Description 1. **Domain Module:** diff --git a/api/pom.xml b/api/pom.xml index e6a6fc13..2ced53aa 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,14 +5,15 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT api + - 21 - 21 + 17 + 17 UTF-8 diff --git a/api/src/main/java/com/wansensoft/api/ErpApplication.java b/api/src/main/java/com/wansensoft/api/ErpApplication.java index ecd18148..613478da 100644 --- a/api/src/main/java/com/wansensoft/api/ErpApplication.java +++ b/api/src/main/java/com/wansensoft/api/ErpApplication.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api; import com.wansensoft.utils.ComputerInfo; @@ -37,4 +25,4 @@ public static void main(String[] args) throws IOException { System.out.println("您还需启动前端服务,启动命令:yarn run serve 或 npm run serve,测试用户:wansenerp,密码:123456"); } -} \ No newline at end of file +} diff --git a/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java index 0007f2b4..54a54d15 100644 --- a/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java +++ b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/LogController.java b/api/src/main/java/com/wansensoft/api/LogController.java new file mode 100644 index 00000000..bc718d03 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/LogController.java @@ -0,0 +1,49 @@ +package com.wansensoft.api; + +import com.wansensoft.entities.log.Log; +import com.wansensoft.entities.user.User; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.Constants; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/log") +public class LogController { + + private final LogService logService; + + public LogController(LogService logService) { + this.logService = logService; + } + + @GetMapping("/getAllList") + public BaseResponseInfo getAllList(@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, + @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, + @RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + List dataList = logService.getLog(); + if(dataList!=null) { + data.put("total", 10); + data.put("rows", dataList); + } + res.code = 200; + res.data = data; + } catch(Exception e){ + res.code = 500; + res.data = "获取失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/OperatorController.java b/api/src/main/java/com/wansensoft/api/OperatorController.java index 0fd45a66..132fb3a9 100644 --- a/api/src/main/java/com/wansensoft/api/OperatorController.java +++ b/api/src/main/java/com/wansensoft/api/OperatorController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/PluginController.java b/api/src/main/java/com/wansensoft/api/PluginController.java new file mode 100644 index 00000000..2cb62487 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/PluginController.java @@ -0,0 +1,363 @@ +//package com.wansensoft.api; +// +//import com.gitee.starblues.core.PluginInfo; +//import com.gitee.starblues.integration.application.PluginApplication; +//import com.gitee.starblues.integration.operator.PluginOperator; +//import com.wansensoft.entities.user.User; +//import com.wansensoft.service.user.UserService; +//import com.wansensoft.utils.BaseResponseInfo; +//import com.wansensoft.utils.ComputerInfo; +//import com.wansensoft.utils.StringUtil; +//import com.wansensoft.utils.constants.BusinessConstants; +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.util.DigestUtils; +//import org.springframework.web.bind.annotation.*; +//import org.springframework.web.multipart.MultipartFile; +// +//import jakarta.servlet.http.HttpServletRequest; +//import jakarta.servlet.http.HttpServletResponse; +//import java.nio.file.Paths; +//import java.util.*; +// +///** +// * 插件包 +// * +// */ +//@RestController +//@RequestMapping("/plugin") +//@Api(tags = {"插件管理"}) +//public class PluginController { +// +// private final UserService userService; +// +// private final PluginOperator pluginOperator; +// +// @Autowired +// public PluginController(UserService userService, PluginApplication pluginApplication) { +// this.userService = userService; +// this.pluginOperator = pluginApplication.getPluginOperator(); +// } +// /** +// * 获取插件信息 +// * @return 返回插件信息 +// */ +// @GetMapping(value = "/list") +// @ApiOperation(value = "获取插件信息") +// public BaseResponseInfo getPluginInfo(@RequestParam(value = "name",required = false) String name, +// @RequestParam("currentPage") Integer currentPage, +// @RequestParam("pageSize") Integer pageSize, +// HttpServletRequest request) throws Exception{ +// BaseResponseInfo res = new BaseResponseInfo(); +// Map map = new HashMap(); +// try { +// List resList = new ArrayList<>(); +// User userInfo = userService.getCurrentUser(); +// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +// List list = pluginOperator.getPluginInfo(); +// if (StringUtil.isEmpty(name)) { +// resList = list; +// } else { +// for (PluginInfo pi : list) { +// String desc = pi.getPluginDescriptor().getDescription(); +// if (desc.contains(name)) { +// resList.add(pi); +// } +// } +// } +// } +// map.put("rows", resList); +// map.put("total", resList.size()); +// res.code = 200; +// res.data = map; +// } catch(Exception e){ +// e.printStackTrace(); +// res.code = 500; +// res.data = "获取数据失败"; +// } +// return res; +// } +// +// /** +// * 获取插件jar文件名 +// * @return 获取插件文件名。只在生产环境显示 +// */ +//// @GetMapping("/files") +//// @ApiOperation(value = "获取插件jar文件名") +//// public Set getPluginFilePaths(){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// return pluginOperator.getPluginFilePaths(); +//// } else { +//// return null; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return null; +//// } +//// } +// +// +// /** +// * 根据插件id停止插件 +// * @param id 插件id +// * @return 返回操作结果 +// */ +// @PostMapping("/stop/{id}") +// @ApiOperation(value = "根据插件id停止插件") +// public BaseResponseInfo stop(@PathVariable("id") String id){ +// BaseResponseInfo res = new BaseResponseInfo(); +// Map map = new HashMap(); +// String message = ""; +// try { +// User userInfo = userService.getCurrentUser(); +// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +// if (pluginOperator.stop(id)) { +// message = "plugin '" + id + "' stop success"; +// } else { +// message = "plugin '" + id + "' stop failure"; +// } +// } else { +// message = "power is limit"; +// } +// map.put("message", message); +// res.code = 200; +// res.data = map; +// } catch (Exception e) { +// e.printStackTrace(); +// map.put("message", "plugin '" + id +"' stop failure. " + e.getMessage()); +// res.code = 500; +// res.data = map; +// } +// return res; +// } +// +// /** +// * 根据插件id启动插件 +// * @param id 插件id +// * @return 返回操作结果 +// */ +// @PostMapping("/start/{id}") +// @ApiOperation(value = "根据插件id启动插件") +// public BaseResponseInfo start(@PathVariable("id") String id){ +// BaseResponseInfo res = new BaseResponseInfo(); +// Map map = new HashMap(); +// String message = ""; +// try { +// User userInfo = userService.getCurrentUser(); +// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +// if (pluginOperator.start(id)) { +// message = "plugin '" + id + "' start success"; +// } else { +// message = "plugin '" + id + "' start failure"; +// } +// } else { +// message = "power is limit"; +// } +// map.put("message", message); +// res.code = 200; +// res.data = map; +// } catch (Exception e) { +// e.printStackTrace(); +// map.put("message", "plugin '" + id +"' start failure. " + e.getMessage()); +// res.code = 500; +// res.data = map; +// } +// return res; +// } +// +// +// /** +// * 根据插件id卸载插件 +// * @param id 插件id +// * @return 返回操作结果 +// */ +//// @PostMapping("/uninstall/{id}") +//// @ApiOperation(value = "根据插件id卸载插件") +//// public BaseResponseInfo uninstall(@PathVariable("id") String id){ +//// BaseResponseInfo res = new BaseResponseInfo(); +//// Map map = new HashMap(); +//// String message = ""; +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.uninstall(id, true)) { +//// message = "plugin '" + id + "' uninstall success"; +//// } else { +//// message = "plugin '" + id + "' uninstall failure"; +//// } +//// } else { +//// message = "power is limit"; +//// } +//// map.put("message", message); +//// res.code = 200; +//// res.data = map; +//// } catch (Exception e) { +//// e.printStackTrace(); +//// map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage()); +//// res.code = 500; +//// res.data = map; +//// } +//// return res; +//// } +// +// +// /** +// * 根据插件路径安装插件。该插件jar必须在服务器上存在。注意: 该操作只适用于生产环境 +// * @param path 插件路径名称 +// * @return 操作结果 +// */ +//// @PostMapping("/installByPath") +//// @ApiOperation(value = "根据插件路径安装插件") +//// public String install(@RequestParam("path") String path){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.install(Paths.get(path))) { +//// return "installByPath success"; +//// } else { +//// return "installByPath failure"; +//// } +//// } else { +//// return "installByPath failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "installByPath failure : " + e.getMessage(); +//// } +//// } +// +// +// /** +// * 上传并安装插件。注意: 该操作只适用于生产环境 +// * @param file 上传文件 multipartFile +// * @return 操作结果 +// */ +//// @PostMapping("/uploadInstallPluginJar") +//// @ApiOperation(value = "上传并安装插件") +//// public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ +//// BaseResponseInfo res = new BaseResponseInfo(); +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// pluginOperator.uploadPluginAndStart(file); +//// res.code = 200; +//// res.data = "导入成功"; +//// } else { +//// res.code = 500; +//// res.data = "抱歉,无操作权限!"; +//// } +//// } catch(Exception e){ +//// e.printStackTrace(); +//// res.code = 500; +//// res.data = "导入失败"; +//// } +//// return res; +//// } +//// +//// /** +//// * 上传插件的配置文件。注意: 该操作只适用于生产环境 +//// * @param multipartFile 上传文件 multipartFile +//// * @return 操作结果 +//// */ +//// @PostMapping("/uploadPluginConfigFile") +//// @ApiOperation(value = "上传插件的配置文件") +//// public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.uploadConfigFile(multipartFile)) { +//// return "uploadConfig success"; +//// } else { +//// return "uploadConfig failure"; +//// } +//// } else { +//// return "installByPath failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "uploadConfig failure : " + e.getMessage(); +//// } +//// } +// +// +//// /** +//// * 备份插件。注意: 该操作只适用于生产环境 +//// * @param pluginId 插件id +//// * @return 操作结果 +//// */ +//// @PostMapping("/back/{pluginId}") +//// @ApiOperation(value = "备份插件") +//// public String backupPlugin(@PathVariable("pluginId") String pluginId){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.backupPlugin(pluginId, "testBack")) { +//// return "backupPlugin success"; +//// } else { +//// return "backupPlugin failure"; +//// } +//// } else { +//// return "backupPlugin failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "backupPlugin failure : " + e.getMessage(); +//// } +//// } +// +// /** +// * 获取加密后的mac +// * @return +// */ +// @GetMapping("/getMacWithSecret") +// @ApiOperation(value = "获取加密后的mac") +// public BaseResponseInfo getMacWithSecret(){ +// BaseResponseInfo res = new BaseResponseInfo(); +// try { +// String mac = ComputerInfo.getMacAddress(); +// res.code = 200; +// res.data = DigestUtils.md5DigestAsHex(mac.getBytes()); +// } catch (Exception e) { +// e.printStackTrace(); +// res.code = 500; +// res.data = "获取数据失败"; +// } +// return res; +// } +// +// /** +// * 根据插件标识判断是否存在 +// * @param pluginIds 多个用逗号隔开 +// * @return +// */ +// @GetMapping("/checkByPluginId") +// @ApiOperation(value = "根据插件标识判断是否存在") +// public BaseResponseInfo checkByTag(@RequestParam("pluginIds") String pluginIds){ +// BaseResponseInfo res = new BaseResponseInfo(); +// try { +// boolean data = false; +// if(StringUtil.isNotEmpty(pluginIds)) { +// String[] pluginIdList = pluginIds.split(","); +// List list = pluginOperator.getPluginInfo(); +// for (PluginInfo pi : list) { +// String info = pi.getPluginDescriptor().getPluginId(); +// for (int i = 0; i < pluginIdList.length; i++) { +// if (pluginIdList[i].equals(info)) { +// data = true; +// } +// } +// } +// } +// res.code = 200; +// res.data = data; +// } catch (Exception e) { +// e.printStackTrace(); +// res.code = 500; +// res.data = "获取数据失败"; +// } +// return res; +// } +//} diff --git a/api/src/main/java/com/wansensoft/api/ResourceController.java b/api/src/main/java/com/wansensoft/api/ResourceController.java new file mode 100644 index 00000000..acd74bf5 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/ResourceController.java @@ -0,0 +1,148 @@ +package com.wansensoft.api; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.service.CommonQueryManager; +import com.wansensoft.utils.*; +import com.wansensoft.utils.enums.CodeEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@Api(tags = {"资源接口"}) +public class ResourceController { + + private final CommonQueryManager configResourceManager; + + public ResourceController(CommonQueryManager configResourceManager) { + this.configResourceManager = configResourceManager; + } + + @GetMapping(value = "/{apiName}/info") + @ApiOperation(value = "根据id获取信息") + public String getList(@PathVariable("apiName") String apiName, + @RequestParam("id") Long id, + HttpServletRequest request) throws Exception { + Object obj = configResourceManager.selectOne(apiName, id); + Map objectMap = new HashMap(); + if(obj != null) { + objectMap.put("info", obj); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/{apiName}/list") + @ApiOperation(value = "获取信息列表") + public String getList(@PathVariable("apiName") String apiName, + @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, + @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, + @RequestParam(value = Constants.SEARCH, required = false) String search, + HttpServletRequest request)throws Exception { + Map parameterMap = ParamUtils.requestToMap(request); + parameterMap.put(Constants.SEARCH, search); + Map objectMap = new HashMap<>(); + if (pageSize != null && pageSize <= 0) { + pageSize = 10; + } + String offset = ParamUtils.getPageOffset(currentPage, pageSize); + if (StringUtil.isNotEmpty(offset)) { + parameterMap.put(Constants.OFFSET, offset); + } + List list = configResourceManager.select(apiName, parameterMap); + if (list != null) { + objectMap.put("total", configResourceManager.counts(apiName, parameterMap)); + objectMap.put("rows", list); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); + objectMap.put("rows", new ArrayList()); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + } + + @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "新增") + public String addResource(@PathVariable("apiName") String apiName, + @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int insert = configResourceManager.insert(apiName, obj, request); + if(insert > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(insert == -1) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "修改") + public String updateResource(@PathVariable("apiName") String apiName, + @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int update = configResourceManager.update(apiName, obj, request); + if(update > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(update == -1) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "删除") + public String deleteResource(@PathVariable("apiName") String apiName, + @RequestParam("id") Long id, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int delete = configResourceManager.delete(apiName, id, request); + if(delete > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(delete == -1) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"}) + @ApiOperation(value = "批量删除") + public String batchDeleteResource(@PathVariable("apiName") String apiName, + @RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int delete = configResourceManager.deleteBatch(apiName, ids, request); + if(delete > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(delete == -1) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/{apiName}/checkIsNameExist") + @ApiOperation(value = "检查名称是否存在") + public String checkIsNameExist(@PathVariable("apiName") String apiName, + @RequestParam Long id, @RequestParam(value ="name", required = false) String name, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int exist = configResourceManager.checkIsNameExist(apiName, id, name); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + +} diff --git a/api/src/main/java/com/wansensoft/api/SystemSupplierController.java b/api/src/main/java/com/wansensoft/api/SystemSupplierController.java index 013fa64d..f37dd430 100644 --- a/api/src/main/java/com/wansensoft/api/SystemSupplierController.java +++ b/api/src/main/java/com/wansensoft/api/SystemSupplierController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/account/AccountController.java b/api/src/main/java/com/wansensoft/api/account/AccountController.java new file mode 100644 index 00000000..1ea6faeb --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/account/AccountController.java @@ -0,0 +1,210 @@ +package com.wansensoft.api.account; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.account.Account; +import com.wansensoft.service.account.AccountService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.vo.AccountVo4InOutList; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import jakarta.servlet.http.HttpServletRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/account") +@Api(tags = {"账户管理"}) +public class AccountController { + private Logger logger = LoggerFactory.getLogger(AccountController.class); + + private AccountService accountService; + + private SystemConfigService systemConfigService; + + @Autowired + public void setAccountService(AccountService accountService) { + this.accountService = accountService; + } + + @Autowired + public void setSystemConfigService(SystemConfigService systemConfigService) { + this.systemConfigService = systemConfigService; + } + + + /** + * 查找结算账户信息-下拉框 + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找结算账户信息-下拉框") + public String findBySelect(HttpServletRequest request) throws Exception { + String res = null; + try { + List dataList = accountService.findBySelect(); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Account account : dataList) { + JSONObject item = new JSONObject(); + item.put("Id", account.getId()); + //结算账户名称 + item.put("AccountName", account.getName()); + dataArray.add(item); + } + } + res = dataArray.toJSONString(); + } catch(Exception e){ + e.printStackTrace(); + res = "获取数据失败"; + } + return res; + } + + /** + * 获取所有结算账户 + * @param request + * @return + */ + @GetMapping(value = "/getAccount") + @ApiOperation(value = "获取所有结算账户") + public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List accountList = accountService.getAccount(); + map.put("accountList", accountList); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 账户流水信息 + * @param currentPage + * @param pageSize + * @param accountId + * @param initialAmount + * @param request + * @return + */ + @GetMapping(value = "/findAccountInOutList") + @ApiOperation(value = "账户流水信息") + public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("accountId") Long accountId, + @RequestParam("initialAmount") BigDecimal initialAmount, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize); + int total = accountService.findAccountInOutListCount(accountId); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + for (AccountVo4InOutList aEx : dataList) { + String type = aEx.getType().replace("其它", ""); + aEx.setType(type); + String timeStr = aEx.getOperTime().toString(); + BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date", forceFlag).add(accountService.getAccountSumByHead(accountId, timeStr, "date", forceFlag)) + .add(accountService.getAccountSumByDetail(accountId, timeStr, "date", forceFlag)).add(accountService.getManyAccountSum(accountId, timeStr, "date", forceFlag)).add(initialAmount); + aEx.setBalance(balance); + aEx.setAccountId(accountId); + dataArray.add(aEx); + } + } + map.put("rows", dataArray); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 更新默认账户 + * @param object + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/updateIsDefault") + @ApiOperation(value = "更新默认账户") + public String updateIsDefault(@RequestBody JSONObject object, + HttpServletRequest request) throws Exception{ + Long accountId = object.getLong("id"); + Map objectMap = new HashMap<>(); + int res = accountService.updateIsDefault(accountId); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 结算账户的统计 + * @param request + * @return + */ + @GetMapping(value = "/getStatistics") + @ApiOperation(value = "结算账户的统计") + public BaseResponseInfo getStatistics(@RequestParam("name") String name, + @RequestParam("serialNo") String serialNo, + HttpServletRequest request) throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map map = accountService.getStatistics(name, serialNo); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = accountService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java new file mode 100644 index 00000000..a4e74fad --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java @@ -0,0 +1,135 @@ +package com.wansensoft.api.account; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.account.AccountHeadVo4Body; +import com.wansensoft.entities.account.AccountHeadVo4ListEx; +import com.wansensoft.service.accountHead.AccountHeadService; +import com.wansensoft.utils.Response; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/accountHead") +@Api(tags = {"财务管理"}) +public class AccountHeadController { + private Logger logger = LoggerFactory.getLogger(AccountHeadController.class); + + @Resource + private AccountHeadService accountHeadService; + + /** + * 批量设置状态-审核或者反审核 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-审核或者反审核") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception{ + Map objectMap = new HashMap<>(); + String status = jsonObject.getString("status"); + String ids = jsonObject.getString("ids"); + int res = accountHeadService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 新增财务主表及财务子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/addAccountHeadAndDetail") + @ApiOperation(value = "新增财务主表及财务子表信息") + public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + accountHeadService.addAccountHeadAndDetail(beanJson,rows, request); + return result; + } + + /** + * 更新财务主表及财务子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PutMapping(value = "/updateAccountHeadAndDetail") + @ApiOperation(value = "更新财务主表及财务子表信息") + public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + accountHeadService.updateAccountHeadAndDetail(beanJson,rows,request); + return result; + } + + /** + * 根据编号查询单据信息 + * @param billNo + * @param request + * @return + */ + @GetMapping(value = "/getDetailByNumber") + @ApiOperation(value = "根据编号查询单据信息") + public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx(); + try { + List list = accountHeadService.getDetailByNumber(billNo); + if(!list.isEmpty()) { + ahl = list.get(0); + } + res.code = 200; + res.data = ahl; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据出入库单据id查询收付款单号 + * @param billId + * @param request + * @return + */ + @GetMapping(value = "/getFinancialBillNoByBillId") + @ApiOperation(value = "根据编号查询单据信息") + public BaseResponseInfo getFinancialBillNoByBillId(@RequestParam("billId") Long billId, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = accountHeadService.getFinancialBillNoByBillId(billId); + res.code = 200; + res.data = list; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/account/AccountItemController.java b/api/src/main/java/com/wansensoft/api/account/AccountItemController.java new file mode 100644 index 00000000..c7d243f4 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/account/AccountItemController.java @@ -0,0 +1,92 @@ +package com.wansensoft.api.account; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.accountHead.AccountHeadService; +import com.wansensoft.service.accountItem.AccountItemService; +import com.wansensoft.vo.AccountItemVo4List; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.StringUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping(value = "/accountItem") +@Api(tags = {"财务明细"}) +public class AccountItemController { + private Logger logger = LoggerFactory.getLogger(AccountItemController.class); + + private final AccountItemService accountItemService; + + private final AccountHeadService accountHeadService; + + public AccountItemController(AccountItemService accountItemService, AccountHeadService accountHeadService) { + this.accountItemService = accountItemService; + this.accountHeadService = accountHeadService; + } + + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "明细列表") + public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String type = null; + List dataList = new ArrayList<>(); + if(headerId != 0) { + dataList = accountItemService.getDetailList(headerId); + type = accountHeadService.getAccountHead(headerId).getType(); + } + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (AccountItemVo4List ai : dataList) { + JSONObject item = new JSONObject(); + item.put("accountId", ai.getAccountId()); + item.put("accountName", ai.getAccountName()); + item.put("inOutItemId", ai.getInOutItemId()); + item.put("inOutItemName", ai.getInOutItemName()); + if(StringUtil.isNotEmpty(ai.getBillNumber())) { + item.put("billNumber", ai.getBillNumber()); + } else { + item.put("billNumber", "QiChu"); + } + item.put("needDebt", ai.getNeedDebt()); + item.put("finishDebt", ai.getFinishDebt()); + BigDecimal eachAmount = ai.getEachAmount(); + if(BusinessConstants.TYPE_MONEY_IN.equals(type)) { + item.put("eachAmount", eachAmount); + } else if(BusinessConstants.TYPE_MONEY_OUT.equals(type)) { + item.put("eachAmount", BigDecimal.ZERO.subtract(eachAmount)); + } else { + item.put("eachAmount", (eachAmount.compareTo(BigDecimal.ZERO))==-1 ? BigDecimal.ZERO.subtract(eachAmount): eachAmount); + } + item.put("remark", ai.getRemark()); + dataArray.add(item); + } + } + outer.put("rows", dataArray); + res.code = 200; + res.data = outer; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/common/CommonController.java b/api/src/main/java/com/wansensoft/api/common/CommonController.java deleted file mode 100644 index 71d08d1b..00000000 --- a/api/src/main/java/com/wansensoft/api/common/CommonController.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.api.common; - -import com.wansensoft.service.common.CommonService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.utils.constants.ApiVersionConstants; -import com.wansensoft.utils.enums.BaseCodeEnum; -import com.wansensoft.vo.CaptchaVO; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping(ApiVersionConstants.API_CLASS_VERSION_V2 + "common") -public class CommonController { - - private final CommonService commonService; - - public CommonController(CommonService commonService) { - this.commonService = commonService; - } - - @GetMapping( "captcha") - public Response getCaptcha() { - CaptchaVO captchaVo = commonService.getCaptcha(); - if(captchaVo == null) { - return Response.responseMsg(BaseCodeEnum.ERROR); - } - return Response.responseData(captchaVo); - } - - @GetMapping("sms/{type}/{phoneNumber}") - public Response sendSmsCode(@PathVariable Integer type, @PathVariable String phoneNumber) { - boolean result = commonService.sendSmsCode(type, phoneNumber); - if(!result) { - return Response.responseMsg(BaseCodeEnum.PHONE_NUMBER_FORMAT_ERROR); - } - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_SEND_SUCCESS); - } -} diff --git a/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java index d128373d..77fa1a0e 100644 --- a/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java +++ b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.config; import com.baomidou.mybatisplus.annotation.DbType; @@ -17,47 +5,27 @@ import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; -import com.wansensoft.utils.redis.RedisUtil; +import com.wansensoft.utils.Tools; import jakarta.servlet.http.HttpServletRequest; import net.sf.jsqlparser.expression.Expression; import net.sf.jsqlparser.expression.LongValue; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.util.StringUtils; @Configuration @MapperScan("com.wansensoft.mappers") public class MybatisPlusConfig { - public final RedisUtil redisUtil; - - public MybatisPlusConfig(RedisUtil redisUtil) { - this.redisUtil = redisUtil; - } - - - /** - * 根据token截取租户id - * @param token - * @return - */ - public Long getTenantIdByToken(String token) { - long tenantId = -1L; - if(StringUtils.hasText(token)) { - tenantId = Long.parseLong(redisUtil.getString(token + ":tenantId")); - } - return tenantId; - } - @Bean public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) { MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(); interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() { @Override public Expression getTenantId() { - String token = request.getHeader("Authorization"); - Long tenantId = getTenantIdByToken(token); + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); if (tenantId!=0L) { return new LongValue(tenantId); } else { @@ -71,11 +39,11 @@ public Expression getTenantId() { public boolean ignoreTable(String tableName) { //获取开启状态 boolean res = true; - String token = request.getHeader("Authorization"); - Long tenantId = getTenantIdByToken(token); + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); if (tenantId!=0L) { // 这里可以判断是否过滤表 - if ("sys_user".equals(tableName) || "jsh_sequence".equals(tableName) + if ("jsh_material_property".equals(tableName) || "jsh_sequence".equals(tableName) || "jsh_user_business".equals(tableName) || "jsh_function".equals(tableName) || "jsh_platform_config".equals(tableName) || "jsh_tenant".equals(tableName)) { res = true; @@ -94,4 +62,95 @@ public boolean ignoreTable(String tableName) { return interceptor; } +// @Bean +// public PaginationInnerInterceptor paginationInterceptor(HttpServletRequest request) { +// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); +// +// PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(); +// List sqlParserList = new ArrayList<>(); +// TenantSqlParser tenantSqlParser = new TenantSqlParser(); +// tenantSqlParser.setTenantHandler(new TenantHandler() { +// @Override +// public Expression getTenantId() { +// String token = request.getHeader("X-Access-Token"); +// Long tenantId = Tools.getTenantIdByToken(token); +// if (tenantId!=0L) { +// return new LongValue(tenantId); +// } else { +// //超管 +// return null; +// } +// } +// +// @Override +// public String getTenantIdColumn() { +// return "tenant_id"; +// } +// +// @Override +// public boolean doTableFilter(String tableName) { +// //获取开启状态 +// Boolean res = true; +// String token = request.getHeader("X-Access-Token"); +// Long tenantId = Tools.getTenantIdByToken(token); +// if (tenantId!=0L) { +// // 这里可以判断是否过滤表 +// if ("jsh_material_property".equals(tableName) || "jsh_sequence".equals(tableName) +// || "jsh_user_business".equals(tableName) || "jsh_function".equals(tableName) +// || "jsh_platform_config".equals(tableName) || "jsh_tenant".equals(tableName)) { +// res = true; +// } else { +// res = false; +// } +// } +// return res; +// } +// }); +// +// sqlParserList.add(tenantSqlParser); +// paginationInterceptor.setSqlParserList(sqlParserList); +// paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() { +// @Override +// public boolean doFilter(MetaObject metaObject) { +// MappedStatement ms = SqlParserHelper.getMappedStatement(metaObject); +// // 过滤自定义查询此时无租户信息约束出现 +// if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserByWeixinOpenId".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.updateUserWithWeixinOpenId".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserListByUserNameOrLoginName".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.disableUserByLimit".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.RoleMapperEx.getRoleWithoutTenant".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.LogMapperEx.insertLogWithUserId".equals(ms.getId())) { +// return true; +// } +// return false; +// } +// }); +// return paginationInterceptor; +// } + + /** + * 相当于顶部的: + * {@code @MapperScan("com.wansensoft.erp.datasource.mappers*")} + * 这里可以扩展,比如使用配置文件来配置扫描Mapper的路径 + */ +// @Bean +// public MapperScannerConfigurer mapperScannerConfigurer() { +// MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer(); +// scannerConfigurer.setBasePackage("com.wansensoft.mappers*"); +// return scannerConfigurer; +// } + + /** + * 性能分析拦截器,不建议生产使用 + */ +// @Bean +// public PerformanceInterceptor performanceInterceptor(){ +// return new PerformanceInterceptor(); +// } + } diff --git a/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java new file mode 100644 index 00000000..fb4dd2e8 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java @@ -0,0 +1,44 @@ +package com.wansensoft.api.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * 插件集成配置 + * + * @author jishenghua + * @version 1.0 + */ +@Configuration +@EnableSwagger2 +public class Swagger2Config { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(this.apiInfo()) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("WanSen ERP Restful Api") + .description("WanSen ERP接口描述") + .termsOfServiceUrl("http://127.0.0.1") + .contact(new Contact("WanSen ERP", "", "")) + .version("1.0.1") + .build(); + } + +} diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotController.java b/api/src/main/java/com/wansensoft/api/depot/DepotController.java new file mode 100644 index 00000000..c2b857f1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/depot/DepotController.java @@ -0,0 +1,220 @@ +package com.wansensoft.api.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.depot.DepotEx; +import com.wansensoft.entities.material.MaterialInitialStock; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.material.MaterialService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.Response; +import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.enums.CodeEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.*; + +/** + * + */ +@RestController +@RequestMapping(value = "/depot") +@Api(tags = {"仓库管理"}) +public class DepotController { + private Logger logger = LoggerFactory.getLogger(DepotController.class); + + + private final DepotService depotService; + + private final UserBusinessService userBusinessService; + + private final MaterialService materialService; + + public DepotController(DepotService depotService, UserBusinessService userBusinessService, MaterialService materialService) { + this.depotService = depotService; + this.userBusinessService = userBusinessService; + this.materialService = materialService; + } + + /** + * 仓库列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "仓库列表") + public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + List depotList = depotService.getAllList(); + res.code = 200; + res.data = depotList; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 用户对应仓库显示 + * @param type + * @param keyId + * @param request + * @return + */ + @GetMapping(value = "/findUserDepot") + @ApiOperation(value = "用户对应仓库显示") + public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, + HttpServletRequest request) throws Exception{ + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = depotService.findUserDepot(); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.put("id", 0); + outer.put("key", 0); + outer.put("value", 0); + outer.put("title", "仓库列表"); + outer.put("attributes", "仓库列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("key", depot.getId()); + item.put("value", depot.getId()); + item.put("title", depot.getName()); + item.put("attributes", depot.getName()); + Boolean flag = ubValue.contains("[" + depot.getId().toString() + "]"); + if (flag) { + item.put("checked", true); + } + dataArray.add(item); + } + } + outer.put("children", dataArray); + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 获取当前用户拥有权限的仓库列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findDepotByCurrentUser") + @ApiOperation(value = "获取当前用户拥有权限的仓库列表") + public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + JSONArray arr = depotService.findDepotByCurrentUser(); + res.code = 200; + res.data = arr; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 更新默认仓库 + * @param object + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/updateIsDefault") + @ApiOperation(value = "更新默认仓库") + public String updateIsDefault(@RequestBody JSONObject object, + HttpServletRequest request) throws Exception{ + Long depotId = object.getLong("id"); + Map objectMap = new HashMap<>(); + int res = depotService.updateIsDefault(depotId); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 仓库列表-带库存 + * @param mId + * @param request + * @return + */ + @GetMapping(value = "/getAllListWithStock") + @ApiOperation(value = "仓库列表-带库存") + public BaseResponseInfo getAllList(@RequestParam("mId") Long mId, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = depotService.getAllList(); + List depotList = new ArrayList(); + for(Depot depot: list) { + DepotEx de = new DepotEx(); + if(mId!=0) { + BigDecimal initStock = materialService.getInitStock(mId, depot.getId()); + BigDecimal currentStock = materialService.getCurrentStockByMaterialIdAndDepotId(mId, depot.getId()); + de.setInitStock(initStock); + de.setCurrentStock(currentStock); + MaterialInitialStock materialInitialStock = materialService.getSafeStock(mId, depot.getId()); + de.setLowSafeStock(materialInitialStock.getLowSafeStock()); + de.setHighSafeStock(materialInitialStock.getHighSafeStock()); + } else { + de.setInitStock(BigDecimal.ZERO); + de.setCurrentStock(BigDecimal.ZERO); + } + de.setId(depot.getId()); + de.setName(depot.getName()); + depotList.add(de); + } + res.code = 200; + res.data = depotList; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = depotService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java new file mode 100644 index 00000000..109c8275 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java @@ -0,0 +1,538 @@ +package com.wansensoft.api.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wansensoft.dto.depot.RetailOutboundDto; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.depot.DepotHeadVo4Body; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.depotHead.DepotHeadService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.utils.*; +import com.wansensoft.vo.DepotHeadVo4InDetail; +import com.wansensoft.vo.DepotHeadVo4InOutMCount; +import com.wansensoft.vo.DepotHeadVo4List; +import com.wansensoft.vo.DepotHeadVo4StatementAccount; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author ji-sheng-hua 752*718*920 + */ +@RestController +@RequestMapping(value = "/depotHead") +@Api(tags = {"单据管理"}) +public class DepotHeadController { + private Logger logger = LoggerFactory.getLogger(DepotHeadController.class); + + private final DepotHeadService depotHeadService; + private final DepotService depotService; + private final SystemConfigService systemConfigService; + private final RedisService redisService; + + public DepotHeadController(DepotHeadService depotHeadService, DepotService depotService, SystemConfigService systemConfigService, RedisService redisService) { + this.depotHeadService = depotHeadService; + this.depotService = depotService; + this.systemConfigService = systemConfigService; + this.redisService = redisService; + } + + @PostMapping("/getAllList") + public Response> getList(@RequestBody RetailOutboundDto retailOutboundDto){ + return Response.responseData(depotHeadService.selectByConditionDepotHead(retailOutboundDto)); + } + + + /** + * 批量设置状态-审核或者反审核 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-审核或者反审核") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception{ + Map objectMap = new HashMap<>(); + String status = jsonObject.getString("status"); + String ids = jsonObject.getString("ids"); + int res = depotHeadService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 入库出库明细接口 + * @param currentPage + * @param pageSize + * @param oId + * @param number + * @param materialParam + * @param depotId + * @param beginTime + * @param endTime + * @param type + * @param request + * @return + */ + @GetMapping(value = "/findInOutDetail") + @ApiOperation(value = "入库出库明细接口") + public BaseResponseInfo findInOutDetail(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "organId", required = false) Integer oId, + @RequestParam("number") String number, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "roleType", required = false) String roleType, + @RequestParam("type") String type, + @RequestParam(value = "creator", required = false) Long creator, + @RequestParam("remark") String remark, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + List resList = new ArrayList(); + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + String subType = "出库".equals(type)? "销售" : ""; + String [] organArray = depotHeadService.getOrganArray(subType, ""); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List list = depotHeadService.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, + StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, + StringUtil.toNull(materialParam), depotList, oId, StringUtil.toNull(number), creator, remark); + map.put("total", total); + //存放数据json数组 + if (null != list) { + resList.addAll(list); + } + map.put("rows", resList); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 入库出库统计接口 + * @param currentPage + * @param pageSize + * @param oId + * @param materialParam + * @param depotId + * @param beginTime + * @param endTime + * @param type + * @param request + * @return + */ + @GetMapping(value = "/findInOutMaterialCount") + @ApiOperation(value = "入库出库统计接口") + public BaseResponseInfo findInOutMaterialCount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "organId", required = false) Integer oId, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam("type") String type, + @RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List list = depotHeadService.findInOutMaterialCount(beginTime, endTime, type, forceFlag, StringUtil.toNull(materialParam), + depotList, oId, roleType, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, StringUtil.toNull(materialParam), + depotList, oId, roleType); + map.put("total", total); + map.put("rows", list); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 调拨明细统计 + * @param currentPage + * @param pageSize + * @param number + * @param materialParam + * @param depotIdF 调出仓库 + * @param depotId 调入仓库 + * @param beginTime + * @param endTime + * @param subType + * @param request + * @return + */ + @GetMapping(value = "/findAllocationDetail") + @ApiOperation(value = "调拨明细统计") + public BaseResponseInfo findallocationDetail(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("number") String number, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam(value = "depotIdF", required = false) Long depotIdF, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam("subType") String subType, + @RequestParam(value = "roleType", required = false) String roleType, + @RequestParam("remark") String remark, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List depotList = new ArrayList<>(); + List depotFList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + if(depotIdF != null) { + depotFList.add(depotIdF); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotFList.add(object.getLong("id")); + } + } + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List list = depotHeadService.findAllocationDetail(beginTime, endTime, subType, StringUtil.toNull(number), + creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.findAllocationDetailCount(beginTime, endTime, subType, StringUtil.toNull(number), + creatorArray, forceFlag, StringUtil.toNull(materialParam), depotList, depotFList, remark); + map.put("rows", list); + map.put("total", total); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 对账单接口 + * @param currentPage + * @param pageSize + * @param beginTime + * @param endTime + * @param organId + * @param supplierType + * @param request + * @return + */ + @GetMapping(value = "/getStatementAccount") + @ApiOperation(value = "对账单接口") + public BaseResponseInfo getStatementAccount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "organId", required = false) Integer organId, + @RequestParam("supplierType") String supplierType, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + String type = ""; + String subType = ""; + String typeBack = ""; + String subTypeBack = ""; + String billType = ""; + if (("供应商").equals(supplierType)) { + type = "入库"; + subType = "采购"; + typeBack = "出库"; + subTypeBack = "采购退货"; + billType = "付款"; + } else if (("客户").equals(supplierType)) { + type = "出库"; + subType = "销售"; + typeBack = "入库"; + subTypeBack = "销售退货"; + billType = "收款"; + } + String [] organArray = depotHeadService.getOrganArray(subType, ""); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadService.getStatementAccount(beginTime, endTime, organId, organArray, + supplierType, type, subType,typeBack, subTypeBack, billType, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.getStatementAccountCount(beginTime, endTime, organId, organArray, + supplierType, type, subType,typeBack, subTypeBack, billType); + for(DepotHeadVo4StatementAccount item: list) { + //期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款 + BigDecimal preNeed = item.getBeginNeed().add(item.getPreDebtMoney()).subtract(item.getPreReturnDebtMoney()).subtract(item.getPreBackMoney()); + item.setPreNeed(preNeed); + //实际欠款 = 本期欠款-本期退货的欠款金额 + BigDecimal realDebtMoney = item.getDebtMoney().subtract(item.getReturnDebtMoney()); + item.setDebtMoney(realDebtMoney); + //期末 = 期初+实际欠款-本期收款 + BigDecimal allNeedGet = preNeed.add(realDebtMoney).subtract(item.getBackMoney()); + item.setAllNeed(allNeedGet); + } + map.put("rows", list); + map.put("total", total); + List totalPayList = depotHeadService.getStatementAccountTotalPay(beginTime, endTime, organId, organArray, + supplierType, type, subType, typeBack, subTypeBack, billType); + if(totalPayList.size()>0) { + DepotHeadVo4StatementAccount totalPayItem = totalPayList.get(0); + BigDecimal firstMoney = BigDecimal.ZERO; + BigDecimal lastMoney = BigDecimal.ZERO; + if(totalPayItem!=null) { + //期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款 + firstMoney = totalPayItem.getBeginNeed().add(totalPayItem.getPreDebtMoney()).subtract(totalPayItem.getPreReturnDebtMoney()).subtract(totalPayItem.getPreBackMoney()); + //期末 = 期初+本期欠款-本期退货的欠款金额-本期收款 + lastMoney = firstMoney.add(totalPayItem.getDebtMoney()).subtract(totalPayItem.getReturnDebtMoney()).subtract(totalPayItem.getBackMoney()); + } + map.put("firstMoney", firstMoney); //期初 + map.put("lastMoney", lastMoney); //期末 + } + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据编号查询单据信息 + * @param number + * @param request + * @return + */ + @GetMapping(value = "/getDetailByNumber") + @ApiOperation(value = "根据编号查询单据信息") + public BaseResponseInfo getDetailByNumber(@RequestParam("number") String number, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + DepotHeadVo4List dhl = new DepotHeadVo4List(); + try { + List list = depotHeadService.getDetailByNumber(number, request); + if(!list.isEmpty()) { + dhl = list.get(0); + } + res.code = 200; + res.data = dhl; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据原单号查询关联的单据列表 + * @param number + * @param request + * @return + */ + @GetMapping(value = "/getBillListByLinkNumber") + @ApiOperation(value = "根据原单号查询关联的单据列表") + public BaseResponseInfo getBillListByLinkNumber(@RequestParam("number") String number, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + DepotHead dh = new DepotHead(); + try { + List list = depotHeadService.getBillListByLinkNumber(number); + res.code = 200; + res.data = list; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 新增单据主表及单据子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/addDepotHeadAndDetail") + @ApiOperation(value = "新增单据主表及单据子表信息") + public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + depotHeadService.addDepotHeadAndDetail(beanJson, rows, request); + return result; + } + + /** + * 更新单据主表及单据子表信息 + * @param body + * @param request + * @return + * @throws Exception + */ + @PutMapping(value = "/updateDepotHeadAndDetail") + @ApiOperation(value = "更新单据主表及单据子表信息") + public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + String beanJson = body.getInfo(); + String rows = body.getRows(); + depotHeadService.updateDepotHeadAndDetail(beanJson,rows,request); + return result; + } + + /** + * 统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额 + * @param request + * @return + */ + @GetMapping(value = "/getBuyAndSaleStatistics") + @ApiOperation(value = "统计今日采购额、昨日采购额、本月采购额、今年采购额|销售额|零售额") + public BaseResponseInfo getBuyAndSaleStatistics(@RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String today = Tools.getNow() + BusinessConstants.DAY_FIRST_TIME; + String monthFirstDay = Tools.firstDayOfMonth(Tools.getCurrentMonth()) + BusinessConstants.DAY_FIRST_TIME; + String yesterdayBegin = Tools.getYesterday() + BusinessConstants.DAY_FIRST_TIME; + String yesterdayEnd = Tools.getYesterday() + BusinessConstants.DAY_LAST_TIME; + String yearBegin = Tools.getYearBegin() + BusinessConstants.DAY_FIRST_TIME; + String yearEnd = Tools.getYearEnd() + BusinessConstants.DAY_LAST_TIME; + Map map = depotHeadService.getBuyAndSaleStatistics(today, monthFirstDay, + yesterdayBegin, yesterdayEnd, yearBegin, yearEnd, roleType, request); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据当前用户获取操作员数组,用于控制当前用户的数据权限,限制可以看到的单据范围 + * 注意:该接口提供给部分插件使用,勿删 + * @param request + * @return + */ + @GetMapping(value = "/getCreatorByCurrentUser") + @ApiOperation(value = "根据当前用户获取操作员数组") + public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + String creator = ""; + String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString(); + if(StringUtil.isNotEmpty(roleType)) { + creator = depotHeadService.getCreatorByRoleType(roleType); + } + res.code = 200; + res.data = creator; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 查询存在欠款的单据 + * @param search + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/debtList") + @ApiOperation(value = "查询存在欠款的单据") + public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, + @RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + String organIdStr = StringUtil.getInfo(search, "organId"); + Long organId = Long.parseLong(organIdStr); + String materialParam = StringUtil.getInfo(search, "materialParam"); + String number = StringUtil.getInfo(search, "number"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String roleType = StringUtil.getInfo(search, "roleType"); + String status = StringUtil.getInfo(search, "status"); + List list = depotHeadService.debtList(organId, materialParam, number, beginTime, endTime, roleType, + status, (currentPage-1)*pageSize, pageSize); + int total = depotHeadService.debtListCount(organId, materialParam, number, beginTime, endTime, roleType, status); + if (list != null) { + objectMap.put("rows", list); + objectMap.put("total", total); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + objectMap.put("rows", new ArrayList<>()); + objectMap.put("total", 0); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java new file mode 100644 index 00000000..5b02a93b --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java @@ -0,0 +1,970 @@ +package com.wansensoft.api.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.depot.DepotItemVo4DetailByTypeAndMId; +import com.wansensoft.entities.depot.DepotItemVo4WithInfoEx; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.depotHead.DepotHeadService; +import com.wansensoft.service.depotItem.DepotItemService; +import com.wansensoft.service.material.MaterialService; +import com.wansensoft.service.role.RoleService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.unit.UnitService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.utils.*; +import com.wansensoft.vo.DepotItemStockWarningCount; +import com.wansensoft.vo.DepotItemVoBatchNumberList; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import jxl.Sheet; +import jxl.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author ji-sheng-hua 华夏erp + */ +@RestController +@RequestMapping(value = "/depotItem") +@Api(tags = {"单据明细"}) +public class DepotItemController { + private Logger logger = LoggerFactory.getLogger(DepotItemController.class); + + private final DepotHeadService depotHeadService; + + private final DepotItemService depotItemService; + + private final MaterialService materialService; + + private final UnitService unitService; + + private final DepotService depotService; + + private final RoleService roleService; + + private final UserService userService; + + private final SystemConfigService systemConfigService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + public DepotItemController(DepotHeadService depotHeadService, DepotItemService depotItemService, MaterialService materialService, UnitService unitService, DepotService depotService, RoleService roleService, UserService userService, SystemConfigService systemConfigService) { + this.depotHeadService = depotHeadService; + this.depotItemService = depotItemService; + this.materialService = materialService; + this.unitService = unitService; + this.depotService = depotService; + this.roleService = roleService; + this.userService = userService; + this.systemConfigService = systemConfigService; + } + + /** + * 根据仓库和商品查询单据列表 + * @param mId + * @param request + * @return + */ + @GetMapping(value = "/findDetailByDepotIdsAndMaterialId") + @ApiOperation(value = "根据仓库和商品查询单据列表") + public String findDetailByDepotIdsAndMaterialId( + @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, + @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, + @RequestParam(value = "depotIds",required = false) String depotIds, + @RequestParam(value = "sku",required = false) String sku, + @RequestParam(value = "batchNumber",required = false) String batchNumber, + @RequestParam(value = "number",required = false) String number, + @RequestParam(value = "beginTime",required = false) String beginTime, + @RequestParam(value = "endTime",required = false) String endTime, + @RequestParam("materialId") Long mId, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + if(StringUtil.isNotEmpty(beginTime)) { + beginTime = beginTime + BusinessConstants.DAY_FIRST_TIME; + } + if(StringUtil.isNotEmpty(endTime)) { + endTime = endTime + BusinessConstants.DAY_LAST_TIME; + } + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List list = depotItemService.findDetailByDepotIdsAndMaterialIdList(depotIds, forceFlag, sku, + batchNumber, StringUtil.toNull(number), beginTime, endTime, mId, (currentPage-1)*pageSize, pageSize); + JSONArray dataArray = new JSONArray(); + if (list != null) { + for (DepotItemVo4DetailByTypeAndMId d: list) { + JSONObject item = new JSONObject(); + item.put("number", d.getNumber()); //编号 + item.put("barCode", d.getBarCode()); //条码 + item.put("materialName", d.getMaterialName()); //名称 + String type = d.getType(); + String subType = d.getSubType(); + if(("其它").equals(type)) { + item.put("type", subType); //进出类型 + } else { + item.put("type", subType + type); //进出类型 + } + item.put("depotName", d.getDepotName()); //仓库名称 + item.put("basicNumber", d.getBnum()); //数量 + item.put("operTime", Tools.getCenternTime(d.getOtime())); //时间 + dataArray.add(item); + } + } + if (list == null) { + objectMap.put("rows", new ArrayList()); + objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + } + objectMap.put("rows", dataArray); + objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, forceFlag, sku, + batchNumber, StringUtil.toNull(number), beginTime, endTime, mId)); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 根据商品条码和仓库id查询库存数量 + * @param depotId + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findStockByDepotAndBarCode") + @ApiOperation(value = "根据商品条码和仓库id查询库存数量") + public BaseResponseInfo findStockByDepotAndBarCode( + @RequestParam(value = "depotId",required = false) Long depotId, + @RequestParam("barCode") String barCode, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + BigDecimal stock = BigDecimal.ZERO; + List list = materialService.getMaterialByBarCode(barCode); + if(list!=null && !list.isEmpty()) { + MaterialVo4Unit materialVo4Unit = list.get(0); + if(StringUtil.isNotEmpty(materialVo4Unit.getSku())){ + stock = depotItemService.getSkuStockByParam(depotId,materialVo4Unit.getMeId(),null,null); + } else { + stock = depotItemService.getCurrentStockByParam(depotId, materialVo4Unit.getId()); + if(materialVo4Unit.getUnitId()!=null) { + Unit unit = unitService.getUnit(materialVo4Unit.getUnitId()); + String commodityUnit = materialVo4Unit.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + } + map.put("stock", stock); + res.code = 200; + res.data = map; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 单据明细列表 + * @param headerId + * @param mpList + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "单据明细列表") + public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId, + @RequestParam("mpList") String mpList, + @RequestParam(value = "linkType", required = false) String linkType, + @RequestParam(value = "isReadOnly", required = false) String isReadOnly, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + List dataList = new ArrayList<>(); + String billCategory = depotHeadService.getBillCategory(depotHeadService.getDepotHead(headerId).getSubType()); + if(headerId != 0) { + dataList = depotItemService.getDetailList(headerId); + } + String[] mpArr = mpList.split(","); + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + BigDecimal totalOperNumber = BigDecimal.ZERO; + BigDecimal totalAllPrice = BigDecimal.ZERO; + BigDecimal totalTaxMoney = BigDecimal.ZERO; + BigDecimal totalTaxLastMoney = BigDecimal.ZERO; + BigDecimal totalWeight = BigDecimal.ZERO; + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + item.put("id", diEx.getId()); + item.put("materialExtendId", diEx.getMaterialExtendId() == null ? "" : diEx.getMaterialExtendId()); + item.put("barCode", diEx.getBarCode()); + item.put("name", diEx.getMName()); + item.put("standard", diEx.getMStandard()); + item.put("model", diEx.getMModel()); + item.put("color", diEx.getMColor()); + item.put("materialOther", getOtherInfo(mpArr, diEx)); + BigDecimal stock; + Unit unitInfo = materialService.findUnit(diEx.getMaterialId()); //查询计量单位信息 + String materialUnit = diEx.getMaterialUnit(); + if(StringUtil.isNotEmpty(diEx.getSku())){ + stock = depotItemService.getSkuStockByParam(diEx.getDepotId(),diEx.getMaterialExtendId(),null,null); + } else { + stock = depotItemService.getCurrentStockByParam(diEx.getDepotId(),diEx.getMaterialId()); + if (StringUtil.isNotEmpty(unitInfo.getName())) { + stock = unitService.parseStockByUnit(stock, unitInfo, materialUnit); + } + } + item.put("stock", stock); + item.put("unit", diEx.getMaterialUnit()); + item.put("snList", diEx.getSnList()); + item.put("batchNumber", diEx.getBatchNumber()); + item.put("expirationDate", Tools.parseDateToStr(diEx.getExpirationDate())); + item.put("sku", diEx.getSku()); + item.put("enableSerialNumber", diEx.getEnableSerialNumber()); + item.put("enableBatchNumber", diEx.getEnableBatchNumber()); + item.put("operNumber", diEx.getOperNumber()); + item.put("basicNumber", diEx.getBasicNumber()); + item.put("preNumber", diEx.getOperNumber()); //原数量 + item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType)); //已入库|已出库 + item.put("purchaseDecimal", roleService.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价 + if("basic".equals(linkType)) { + //正常情况显示金额,而以销定购的情况不能显示金额 + item.put("unitPrice", roleService.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request)); + item.put("taxUnitPrice", roleService.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request)); + item.put("allPrice", roleService.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request)); + item.put("taxRate", roleService.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request)); + item.put("taxMoney", roleService.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request)); + item.put("taxLastMoney", roleService.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request)); + } + BigDecimal allWeight = diEx.getBasicNumber()==null||diEx.getWeight()==null?BigDecimal.ZERO:diEx.getBasicNumber().multiply(diEx.getWeight()); + item.put("weight", allWeight); + item.put("remark", diEx.getRemark()); + item.put("imgName", diEx.getImgName()); + if(fileUploadType == 2) { + item.put("imgSmall", "small"); + item.put("imgLarge", "large"); + } else { + item.put("imgSmall", ""); + item.put("imgLarge", ""); + } + item.put("linkId", diEx.getLinkId()); + item.put("depotId", diEx.getDepotId() == null ? "" : diEx.getDepotId()); + item.put("depotName", diEx.getDepotId() == null ? "" : diEx.getDepotName()); + item.put("anotherDepotId", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotId()); + item.put("anotherDepotName", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotName()); + item.put("mType", diEx.getMaterialType()); + item.put("op", 1); + dataArray.add(item); + //合计数据汇总 + totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber()); + totalAllPrice = totalAllPrice.add(diEx.getAllPrice()==null?BigDecimal.ZERO:diEx.getAllPrice()); + totalTaxMoney = totalTaxMoney.add(diEx.getTaxMoney()==null?BigDecimal.ZERO:diEx.getTaxMoney()); + totalTaxLastMoney = totalTaxLastMoney.add(diEx.getTaxLastMoney()==null?BigDecimal.ZERO:diEx.getTaxLastMoney()); + totalWeight = totalWeight.add(allWeight); + } + if(StringUtil.isNotEmpty(isReadOnly) && "1".equals(isReadOnly)) { + JSONObject footItem = new JSONObject(); + footItem.put("operNumber", totalOperNumber); + footItem.put("allPrice", roleService.parseBillPriceByLimit(totalAllPrice, billCategory, priceLimit, request)); + footItem.put("taxMoney", roleService.parseBillPriceByLimit(totalTaxMoney, billCategory, priceLimit, request)); + footItem.put("taxLastMoney", roleService.parseBillPriceByLimit(totalTaxLastMoney, billCategory, priceLimit, request)); + footItem.put("weight", totalWeight); + dataArray.add(footItem); + } + outer.put("rows", dataArray); + res.code = 200; + res.data = outer; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 获取扩展信息 + * + * @return + */ + public String getOtherInfo(String[] mpArr, DepotItemVo4WithInfoEx diEx)throws Exception { + String materialOther = ""; + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + materialOther = materialOther + ((diEx.getMMfrs() == null || diEx.getMMfrs().equals("")) ? "" : "(" + diEx.getMMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + materialOther = materialOther + ((diEx.getMOtherField1() == null || diEx.getMOtherField1().equals("")) ? "" : "(" + diEx.getMOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + materialOther = materialOther + ((diEx.getMOtherField2() == null || diEx.getMOtherField2().equals("")) ? "" : "(" + diEx.getMOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + materialOther = materialOther + ((diEx.getMOtherField3() == null || diEx.getMOtherField3().equals("")) ? "" : "(" + diEx.getMOtherField3() + ")"); + } + } + return materialOther; + } + + /** + * 进销存统计 + * @param currentPage + * @param pageSize + * @param depotIds + * @param monthTime + * @param materialParam + * @param mpList + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/findByAll") + @ApiOperation(value = "查找所有的明细") + public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "depotIds",required = false) String depotIds, + @RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + List categoryIdList = new ArrayList<>(); + if(categoryId != null){ + categoryIdList = materialService.getListByParentId(categoryId); + } + String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME; + String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List depotList = parseListByDepotIds(depotIds); + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + categoryIdList, timeB,(currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.findByAllCount(StringUtil.toNull(materialParam), categoryIdList, timeB); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + Long mId = diEx.getMId(); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("unitId", diEx.getUnitId()); + item.put("unitName", null!=diEx.getUnitId() ? diEx.getMaterialUnit()+"[多单位]" : diEx.getMaterialUnit()); + BigDecimal prevSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,timeA); + Map intervalMap = depotItemService.getIntervalMapByParamWithDepotList(depotList,mId,timeA,timeB); + BigDecimal inSum = intervalMap.get("inSum"); + BigDecimal outSum = intervalMap.get("outSum"); + BigDecimal thisSum = prevSum.add(inSum).subtract(outSum); + item.put("prevSum", prevSum); + item.put("inSum", inSum); + item.put("outSum", outSum); + item.put("thisSum", thisSum); + //将小单位的库存换算为大单位的库存 + item.put("bigUnitStock", materialService.getBigUnitStock(thisSum, diEx.getUnitId())); + item.put("unitPrice", diEx.getPurchaseDecimal()); + item.put("thisAllPrice", thisSum.multiply(diEx.getPurchaseDecimal())); + dataArray.add(item); + } + } + map.put("rows", dataArray); + res.code = 200; + res.data = map; + } catch (BusinessRunTimeException e) { + res.code = e.getCode(); + res.data = e.getData().get("message"); + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 进销存统计总计金额 + * @param depotIds + * @param monthTime + * @param materialParam + * @param request + * @return + */ + @GetMapping(value = "/totalCountMoney") + @ApiOperation(value = "统计总计金额") + public BaseResponseInfo totalCountMoney(@RequestParam(value = "depotIds",required = false) String depotIds, + @RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam("monthTime") String monthTime, + @RequestParam("materialParam") String materialParam, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + List categoryIdList = new ArrayList<>(); + if(categoryId != null){ + categoryIdList = materialService.getListByParentId(categoryId); + } + String endTime = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME; + List depotList = parseListByDepotIds(depotIds); + List dataList = depotItemService.findByAll(StringUtil.toNull(materialParam), + categoryIdList, endTime, null, null); + BigDecimal thisAllStock = BigDecimal.ZERO; + BigDecimal thisAllPrice = BigDecimal.ZERO; + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + Long mId = diEx.getMId(); + BigDecimal thisSum = depotItemService.getStockByParamWithDepotList(depotList,mId,null,endTime); + thisAllStock = thisAllStock.add(thisSum); + BigDecimal unitPrice = diEx.getPurchaseDecimal(); + if(unitPrice == null) { + unitPrice = BigDecimal.ZERO; + } + thisAllPrice = thisAllPrice.add(thisSum.multiply(unitPrice)); + } + } + map.put("totalStock", thisAllStock); + map.put("totalCount", thisAllPrice); + res.code = 200; + res.data = map; + } catch (BusinessRunTimeException e) { + res.code = e.getCode(); + res.data = e.getData().get("message"); + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + private List parseListByDepotIds(@RequestParam("depotIds") String depotIds) throws Exception { + List depotList = new ArrayList<>(); + if(StringUtil.isNotEmpty(depotIds)) { + depotList = StringUtil.strToLongList(depotIds); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + //如果有权限的仓库数量太多则提示要选择仓库 + if(depotList.size()>20) { + throw new BusinessRunTimeException(ExceptionConstants.REPORT_TWO_MANY_DEPOT_FAILED_CODE, + ExceptionConstants.REPORT_TWO_MANY_DEPOT_FAILED_MSG); + } + } + return depotList; + } + + /** + * 采购统计 + * @param currentPage + * @param pageSize + * @param beginTime + * @param endTime + * @param materialParam + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/buyIn") + @ApiOperation(value = "采购统计") + public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "organId", required = false) Long organId, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + @RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + try { + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + String [] organArray = null; + List depotList = depotService.parseDepotList(depotId); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam), + "buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam), + "buy", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + BigDecimal InSum = depotItemService.buyOrSale("入库", "采购", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal OutSum = depotItemService.buyOrSale("出库", "采购退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal InSumPrice = depotItemService.buyOrSale("入库", "采购", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal OutSumPrice = depotItemService.buyOrSale("出库", "采购退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal InOutSumPrice = InSumPrice.subtract(OutSumPrice); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("materialUnit", diEx.getMaterialUnit()); + item.put("unitName", diEx.getUnitName()); + item.put("inSum", InSum); + item.put("outSum", OutSum); + item.put("inSumPrice", InSumPrice); + item.put("outSumPrice", OutSumPrice); + item.put("inOutSumPrice",InOutSumPrice);//实际采购金额 + dataArray.add(item); + } + } + BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "采购", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "采购退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal realityPriceTotal = inSumPriceTotal.subtract(outSumPriceTotal); + map.put("rows", dataArray); + map.put("realityPriceTotal", realityPriceTotal); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 零售统计 + * @param currentPage + * @param pageSize + * @param beginTime + * @param endTime + * @param materialParam + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/retailOut") + @ApiOperation(value = "零售统计") + public BaseResponseInfo retailOut(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "organId", required = false) Long organId, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + @RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + try { + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + String [] organArray = null; + List depotList = depotService.parseDepotList(depotId); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam), + "sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam), + "sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + BigDecimal OutSumRetail = depotItemService.buyOrSale("出库", "零售", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal InSumRetail = depotItemService.buyOrSale("入库", "零售退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal OutSumRetailPrice = depotItemService.buyOrSale("出库", "零售", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal InSumRetailPrice = depotItemService.buyOrSale("入库", "零售退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal OutInSumPrice = OutSumRetailPrice.subtract(InSumRetailPrice); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("materialUnit", diEx.getMaterialUnit()); + item.put("unitName", diEx.getUnitName()); + item.put("outSum", OutSumRetail); + item.put("inSum", InSumRetail); + item.put("outSumPrice", OutSumRetailPrice); + item.put("inSumPrice", InSumRetailPrice); + item.put("outInSumPrice",OutInSumPrice);//实际销售金额 + dataArray.add(item); + } + } + BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "零售", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "零售退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal); + map.put("rows", dataArray); + map.put("realityPriceTotal", realityPriceTotal); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + + /** + * 销售统计 + * @param currentPage + * @param pageSize + * @param beginTime + * @param endTime + * @param materialParam + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/saleOut") + @ApiOperation(value = "销售统计") + public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("beginTime") String beginTime, + @RequestParam("endTime") String endTime, + @RequestParam(value = "organId", required = false) Long organId, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("materialParam") String materialParam, + @RequestParam("mpList") String mpList, + @RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + try { + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + String [] organArray = depotHeadService.getOrganArray("销售", ""); + List depotList = depotService.parseDepotList(depotId); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam), + "sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize); + String[] mpArr = mpList.split(","); + int total = depotItemService.getListWithBugOrSaleCount(StringUtil.toNull(materialParam), + "sale", beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); + map.put("total", total); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (DepotItemVo4WithInfoEx diEx : dataList) { + JSONObject item = new JSONObject(); + BigDecimal OutSum = depotItemService.buyOrSale("出库", "销售", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal InSum = depotItemService.buyOrSale("入库", "销售退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "number"); + BigDecimal OutSumPrice = depotItemService.buyOrSale("出库", "销售", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal InSumPrice = depotItemService.buyOrSale("入库", "销售退货", diEx.getMId(), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal OutInSumPrice = OutSumPrice.subtract(InSumPrice); + item.put("barCode", diEx.getBarCode()); + item.put("materialName", diEx.getMName()); + item.put("materialModel", diEx.getMModel()); + item.put("materialStandard", diEx.getMStandard()); + //扩展信息 + String materialOther = getOtherInfo(mpArr, diEx); + item.put("materialOther", materialOther); + item.put("materialColor", diEx.getMColor()); + item.put("materialUnit", diEx.getMaterialUnit()); + item.put("unitName", diEx.getUnitName()); + item.put("outSum", OutSum); + item.put("inSum", InSum); + item.put("outSumPrice", OutSumPrice); + item.put("inSumPrice", InSumPrice); + item.put("outInSumPrice",OutInSumPrice);//实际销售金额 + dataArray.add(item); + } + } + BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "销售", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "销售退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price"); + BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal); + map.put("rows", dataArray); + map.put("realityPriceTotal", realityPriceTotal); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 获取单位 + * @param materialUnit + * @param uName + * @return + */ + public String getUName(String materialUnit, String uName) { + String unitName = null; + if(StringUtil.isNotEmpty(materialUnit)) { + unitName = materialUnit; + } else if(StringUtil.isNotEmpty(uName)) { + unitName = uName; + } + return unitName; + } + + /** + * 库存预警报表 + * @param currentPage + * @param pageSize + * @return + */ + @GetMapping(value = "/findStockWarningCount") + @ApiOperation(value = "库存预警报表") + public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("materialParam") String materialParam, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("mpList") String mpList)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List depotList = new ArrayList<>(); + if(depotId != null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + String[] mpArr = mpList.split(","); + List list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize, materialParam, depotList); + //存放数据json数组 + if (null != list) { + for (DepotItemStockWarningCount disw : list) { + DepotItemVo4WithInfoEx diEx = new DepotItemVo4WithInfoEx(); + diEx.setMMfrs(disw.getMMfrs()); + diEx.setMOtherField1(disw.getMOtherField1()); + diEx.setMOtherField2(disw.getMOtherField2()); + diEx.setMOtherField3(disw.getMOtherField3()); + disw.setMaterialOther(getOtherInfo(mpArr, diEx)); + disw.setMaterialUnit(getUName(disw.getMaterialUnit(), disw.getUnitName())); + if(null!=disw.getLowSafeStock() && disw.getCurrentNumber().compareTo(disw.getLowSafeStock())<0) { + disw.setLowCritical(disw.getLowSafeStock().subtract(disw.getCurrentNumber())); + } + if(null!=disw.getHighSafeStock() && disw.getCurrentNumber().compareTo(disw.getHighSafeStock())>0) { + disw.setHighCritical(disw.getCurrentNumber().subtract(disw.getHighSafeStock())); + } + } + } + int total = depotItemService.findStockWarningCountTotal(materialParam, depotList); + map.put("total", total); + map.put("rows", list); + res.code = 200; + res.data = map; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 统计采购、销售、零售的总金额 + * @param request + * @param response + * @return + * @throws Exception + */ + @GetMapping(value = "/buyOrSalePrice") + @ApiOperation(value = "统计采购、销售、零售的总金额") + public BaseResponseInfo buyOrSalePrice(@RequestParam(value = "roleType", required = false) String roleType, + HttpServletRequest request, HttpServletResponse response)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + List list = Tools.getLastMonths(6); + JSONArray buyPriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutPrice("入库", "采购", month, roleType); + BigDecimal inPrice = depotItemService.inOrOutPrice("出库", "采购退货", month, roleType); + obj.put("x", month); + obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "buy", priceLimit, "***", request)); + buyPriceList.add(obj); + } + map.put("buyPriceList", buyPriceList); + JSONArray salePriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutPrice("出库", "销售", month, roleType); + BigDecimal inPrice = depotItemService.inOrOutPrice("入库", "销售退货", month, roleType); + obj.put("x", month); + obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "sale", priceLimit, "***", request)); + salePriceList.add(obj); + } + map.put("salePriceList", salePriceList); + JSONArray retailPriceList = new JSONArray(); + for(String month: list) { + JSONObject obj = new JSONObject(); + BigDecimal outPrice = depotItemService.inOrOutRetailPrice("出库", "零售", month, roleType); + BigDecimal inPrice = depotItemService.inOrOutRetailPrice("入库", "零售退货", month, roleType); + obj.put("x", month); + obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "retail", priceLimit, "***", request)); + retailPriceList.add(obj); + } + map.put("retailPriceList", retailPriceList); + res.code = 200; + res.data = map; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "统计失败"; + } + return res; + } + + /** + * 获取批次商品列表信息 + * @param request + * @return + */ + @GetMapping(value = "/getBatchNumberList") + @ApiOperation(value = "获取批次商品列表信息") + public BaseResponseInfo getBatchNumberList(@RequestParam("name") String name, + @RequestParam("depotItemId") Long depotItemId, + @RequestParam("depotId") Long depotId, + @RequestParam("barCode") String barCode, + @RequestParam(value = "batchNumber", required = false) String batchNumber, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + String number = ""; + if(depotItemId != null) { + DepotItem depotItem = depotItemService.getDepotItem(depotItemId); + number = depotHeadService.getDepotHead(depotItem.getHeaderId()).getNumber(); + } + List list = depotItemService.getBatchNumberList(number, name, depotId, barCode, batchNumber); + map.put("rows", list); + map.put("total", list.size()); + res.code = 200; + res.data = map; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * Excel导入明细 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importItemExcel") + public BaseResponseInfo importItemExcel(MultipartFile file, + @RequestParam(required = false, value = "prefixNo") String prefixNo, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + Map data = new HashMap<>(); + String message = ""; + try { + String barCodes = ""; + //文件合法性校验 + Sheet src = null; + try { + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + src = workbook.getSheet(0); + } catch (Exception e) { + message = "导入文件不合法,请检查"; + data.put("message", message); + res.code = 400; + res.data = data; + } + if(src.getRows()>1000) { + message = "导入失败,明细不能超出1000条"; + res.code = 500; + data.put("message", message); + res.data = data; + } else { + List> detailList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + String barCode = ExcelUtils.getContent(src, i, 0); + String num = ExcelUtils.getContent(src, i, 2); + String unitPrice = ExcelUtils.getContent(src, i, 3); + String taxRate = ExcelUtils.getContent(src, i, 4); + String remark = ExcelUtils.getContent(src, i, 5); + Map materialMap = new HashMap<>(); + materialMap.put("barCode", barCode); + materialMap.put("num", num); + materialMap.put("unitPrice", unitPrice); + materialMap.put("taxRate", taxRate); + materialMap.put("remark", remark); + detailList.add(materialMap); + barCodes += "'" + barCode + "',"; + } + if (StringUtil.isNotEmpty(barCodes)) { + barCodes = barCodes.substring(0, barCodes.length() - 1); + } + JSONObject map = depotItemService.parseMapByExcelData(barCodes, detailList, prefixNo); + if (map != null) { + res.code = 200; + } else { + res.code = 500; + } + res.data = map; + } + } catch (BusinessRunTimeException e) { + res.code = 500; + data.put("message", e.getData().get("message")); + res.data = data; + } catch (Exception e) { + message = "导入失败,请检查表格内容"; + res.code = 500; + data.put("message", message); + res.data = data; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java index 2efb031b..ab911f92 100644 --- a/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.financial; diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java index 8758b0c7..f8eeb9e3 100644 --- a/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.financial; diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java index 8620d068..5fcdf775 100644 --- a/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.financial; diff --git a/api/src/main/java/com/wansensoft/api/function/FunctionController.java b/api/src/main/java/com/wansensoft/api/function/FunctionController.java new file mode 100644 index 00000000..f71aff99 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/function/FunctionController.java @@ -0,0 +1,273 @@ +package com.wansensoft.api.function; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.function.Function; +import com.wansensoft.entities.system.SystemConfig; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.service.functions.FunctionService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.utils.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/function") +@Api(tags = {"功能管理"}) +public class FunctionController { + private Logger logger = LoggerFactory.getLogger(FunctionController.class); + + private final FunctionService functionService; + + private final UserBusinessService userBusinessService; + + private final SystemConfigService systemConfigService; + + public FunctionController(FunctionService functionService, UserBusinessService userBusinessService, SystemConfigService systemConfigService) { + this.functionService = functionService; + this.userBusinessService = userBusinessService; + this.systemConfigService = systemConfigService; + } + + @GetMapping(value = "/checkIsNumberExist") + @ApiOperation(value = "检查编号是否存在") + public String checkIsNumberExist(@RequestParam Long id, + @RequestParam(value ="number", required = false) String number, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int exist = functionService.checkIsNumberExist(id, number); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 根据父编号查询菜单 + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/findMenuByPNumber") + @ApiOperation(value = "根据父编号查询菜单") + public JSONArray findMenuByPNumber(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + String pNumber = jsonObject.getString("pNumber"); + String userId = jsonObject.getString("userId"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + try { + Long roleId = 0L; + String fc = ""; + List roleList = userBusinessService.getBasicData(userId, "UserRole"); + if(roleList!=null && !roleList.isEmpty()){ + String value = roleList.get(0).getValue(); + if(StringUtil.isNotEmpty(value)){ + String roleIdStr = value.replace("[", "").replace("]", ""); + roleId = Long.parseLong(roleIdStr); + } + } + //当前用户所拥有的功能列表,格式如:[1][2][5] + List funList = userBusinessService.getBasicData(roleId.toString(), "RoleFunctions"); + if(funList!=null && !funList.isEmpty()){ + fc = funList.get(0).getValue(); + } + //获取系统配置信息-是否开启多级审核 + String approvalFlag = "0"; + List list = systemConfigService.getSystemConfig(); + if(!list.isEmpty()) { + approvalFlag = list.get(0).getMultiLevelApprovalFlag(); + } + List dataList = functionService.getRoleFunction(pNumber); + if (!dataList.isEmpty()) { + dataArray = getMenuByFunction(dataList, fc, approvalFlag); + //增加首页菜单项 + JSONObject homeItem = new JSONObject(); + homeItem.put("id", 0); + homeItem.put("text", "首页"); + homeItem.put("icon", "home"); + homeItem.put("url", "/dashboard/analysis"); + homeItem.put("component", "/layouts/TabLayout"); + dataArray.add(0,homeItem); + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>>>>>>>>>>>查找异常", e); + } + return dataArray; + } + + public JSONArray getMenuByFunction(List dataList, String fc, String approvalFlag) throws Exception { + JSONArray dataArray = new JSONArray(); + for (Function function : dataList) { + //如果关闭多级审核,遇到任务审核菜单直接跳过 + if("0".equals(approvalFlag) && "/workflow".equals(function.getUrl())) { + continue; + } + JSONObject item = new JSONObject(); + List newList = functionService.getRoleFunction(function.getNumber()); + item.put("id", function.getId()); + item.put("text", function.getName()); + item.put("icon", function.getIcon()); + item.put("url", function.getUrl()); + item.put("component", function.getComponent()); + if (!newList.isEmpty()) { + JSONArray childrenArr = getMenuByFunction(newList, fc, approvalFlag); + if(!childrenArr.isEmpty()) { + item.put("children", childrenArr); + dataArray.add(item); + } + } else { + if (fc.contains("[" + function.getId().toString() + "]")) { + dataArray.add(item); + } + } + } + return dataArray; + } + + /** + * 角色对应功能显示 + * @param request + * @return + */ + @GetMapping(value = "/findRoleFunction") + @ApiOperation(value = "角色对应功能显示") + public JSONArray findRoleFunction(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, + HttpServletRequest request)throws Exception { + JSONArray arr = new JSONArray(); + try { + List dataListFun = functionService.findRoleFunction("0"); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.put("id", 0); + outer.put("key", 0); + outer.put("value", 0); + outer.put("title", "功能列表"); + outer.put("attributes", "功能列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataListFun) { + //根据条件从列表里面移除"系统管理" + List dataList = new ArrayList<>(); + for (Function fun : dataListFun) { + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if (tenantId!=0L) { + if(!("系统管理").equals(fun.getName())) { + dataList.add(fun); + } + } else { + //超管 + dataList.add(fun); + } + } + dataArray = getFunctionList(dataList, type, keyId); + outer.put("children", dataArray); + } + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + public JSONArray getFunctionList(List dataList, String type, String keyId) throws Exception { + JSONArray dataArray = new JSONArray(); + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + if (null != dataList) { + for (Function function : dataList) { + JSONObject item = new JSONObject(); + item.put("id", function.getId()); + item.put("key", function.getId()); + item.put("value", function.getId()); + item.put("title", function.getName()); + item.put("attributes", function.getName()); + List funList = functionService.findRoleFunction(function.getNumber()); + if(!funList.isEmpty()) { + JSONArray funArr = getFunctionList(funList, type, keyId); + item.put("children", funArr); + dataArray.add(item); + } else { + Boolean flag = ubValue.contains("[" + function.getId().toString() + "]"); + item.put("checked", flag); + dataArray.add(item); + } + } + } + return dataArray; + } + + /** + * 根据id列表查找功能信息 + * @param roleId + * @param request + * @return + */ + @GetMapping(value = "/findRoleFunctionsById") + @ApiOperation(value = "根据id列表查找功能信息") + public BaseResponseInfo findByIds(@RequestParam("roleId") Long roleId, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = userBusinessService.getBasicData(roleId.toString(), "RoleFunctions"); + if(null!=list && !list.isEmpty()) { + //按钮 + Map btnMap = new HashMap<>(); + String btnStr = list.get(0).getBtnStr(); + if(StringUtil.isNotEmpty(btnStr)) { + JSONArray btnArr = JSONArray.parseArray(btnStr); + for(Object obj: btnArr) { + JSONObject btnObj = JSONObject.parseObject(obj.toString()); + if(btnObj.get("funId")!=null && btnObj.get("btnStr")!=null) { + btnMap.put(btnObj.getLong("funId"), btnObj.getString("btnStr")); + } + } + } + //菜单 + String funIds = list.get(0).getValue(); + funIds = funIds.substring(1, funIds.length() - 1); + funIds = funIds.replace("][",","); + List dataList = functionService.findByIds(funIds); + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + for (Function function : dataList) { + JSONObject item = new JSONObject(); + item.put("id", function.getId()); + item.put("name", function.getName()); + item.put("pushBtn", function.getPushBtn()); + item.put("btnStr", btnMap.get(function.getId())); + dataArray.add(item); + } + outer.put("rows", dataArray); + res.code = 200; + res.data = outer; + } + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java new file mode 100644 index 00000000..a2de78c1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java @@ -0,0 +1,82 @@ +package com.wansensoft.api.inOutItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.inOutItem.InOutItem; +import com.wansensoft.service.inOutItem.InOutItemService; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/inOutItem") +@Api(tags = {"收支项目"}) +public class InOutItemController { + private Logger logger = LoggerFactory.getLogger(InOutItemController.class); + + private final InOutItemService inOutItemService; + + public InOutItemController(InOutItemService inOutItemService) { + this.inOutItemService = inOutItemService; + } + + /** + * 查找收支项目信息-下拉框 + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找收支项目信息") + public String findBySelect(@RequestParam("type") String type, HttpServletRequest request) throws Exception{ + String res = null; + try { + List dataList = inOutItemService.findBySelect(type); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (InOutItem inOutItem : dataList) { + JSONObject item = new JSONObject(); + item.put("id", inOutItem.getId()); + //收支项目名称 + item.put("name", inOutItem.getName()); + dataArray.add(item); + } + } + res = dataArray.toJSONString(); + } catch(Exception e){ + e.printStackTrace(); + res = "获取数据失败"; + } + return res; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = inOutItemService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialAttributeController.java b/api/src/main/java/com/wansensoft/api/material/MaterialAttributeController.java new file mode 100644 index 00000000..31d76023 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/material/MaterialAttributeController.java @@ -0,0 +1,73 @@ +package com.wansensoft.api.material; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.material.MaterialAttribute; +import com.wansensoft.service.materialAttribute.MaterialAttributeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +@RestController +@RequestMapping(value = "/materialAttribute") +@Api(tags = {"商品属性"}) +public class MaterialAttributeController { + private Logger logger = LoggerFactory.getLogger(MaterialAttributeController.class); + + private final MaterialAttributeService materialAttributeService; + + public MaterialAttributeController(MaterialAttributeService materialAttributeService) { + this.materialAttributeService = materialAttributeService; + } + + /** + * 获取商品属性的名称列表 + * @param request + * @return + */ + @GetMapping(value = "/getNameList") + @ApiOperation(value = "获取商品属性的名称列表") + public JSONArray getNameList(HttpServletRequest request)throws Exception { + JSONArray dataArray = new JSONArray(); + try { + List materialAttributeList = materialAttributeService.getMaterialAttribute(); + if (null != materialAttributeList) { + for (MaterialAttribute materialAttribute : materialAttributeList) { + JSONObject item = new JSONObject(); + item.put("value", materialAttribute.getId().toString()); + item.put("name", materialAttribute.getAttributeName()); + dataArray.add(item); + } + } + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } + + /** + * 获取id查询属性的值列表 + * @param request + * @return + */ + @GetMapping(value = "/getValueListById") + @ApiOperation(value = "获取id查询属性的值列表") + public JSONArray getValueListById(@RequestParam("id") Long id, + HttpServletRequest request)throws Exception { + JSONArray dataArray = new JSONArray(); + try { + dataArray = materialAttributeService.getValueArrById(id); + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialCategoryController.java b/api/src/main/java/com/wansensoft/api/material/MaterialCategoryController.java new file mode 100644 index 00000000..a543f109 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/material/MaterialCategoryController.java @@ -0,0 +1,150 @@ +package com.wansensoft.api.material; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.material.MaterialCategory; +import com.wansensoft.service.materialCategory.MaterialCategoryService; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.vo.TreeNode; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + + +@RestController +@RequestMapping(value = "/materialCategory") +@Api(tags = {"商品类别"}) +public class MaterialCategoryController { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); + + private final MaterialCategoryService materialCategoryService; + + public MaterialCategoryController(MaterialCategoryService materialCategoryService) { + this.materialCategoryService = materialCategoryService; + } + + /** + * 获取全部商品类别 + * @param parentId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "获取全部商品类别") + public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + List materialCategoryList = materialCategoryService.getAllList(parentId); + res.code = 200; + res.data = materialCategoryList; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据id来查询商品名称 + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询商品名称") + public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List dataList = materialCategoryService.findById(id); + JSONObject outer = new JSONObject(); + if (null != dataList) { + for (MaterialCategory mc : dataList) { + outer.put("id", mc.getId()); + outer.put("name", mc.getName()); + outer.put("parentId", mc.getParentId()); + List dataParentList = materialCategoryService.findById(mc.getParentId()); + if(dataParentList!=null&& !dataParentList.isEmpty()){ + outer.put("parentName", dataParentList.get(0).getName()); + } + outer.put("sort", mc.getSort()); + outer.put("serialNo", mc.getSerialNo()); + outer.put("remark", mc.getRemark()); + } + } + res.code = 200; + res.data = outer; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + /** + * description: + * 获取商品类别树数据 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getMaterialCategoryTree") + @ApiOperation(value = "获取商品类别树数据") + public JSONArray getMaterialCategoryTree(@RequestParam(value = "id", required = false) Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List materialCategoryTree = materialCategoryService.getMaterialCategoryTree(id); + if(materialCategoryTree!=null&& !materialCategoryTree.isEmpty()){ + for(TreeNode node:materialCategoryTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + /** + * description: + * 新增商品类别数据 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/addMaterialCategory") + @ApiOperation(value = "新增商品类别数据") + public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.addMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_MSG); + } + return result; + } + /** + * description: + * 修改商品类别数据 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/editMaterialCategory") + @ApiOperation(value = "修改商品类别数据") + public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.editMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_EDIT_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_EDIT_FAILED_MSG); + } + return result; + } +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialController.java b/api/src/main/java/com/wansensoft/api/material/MaterialController.java new file mode 100644 index 00000000..8352995c --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/material/MaterialController.java @@ -0,0 +1,656 @@ +package com.wansensoft.api.material; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.depotItem.DepotItemService; +import com.wansensoft.service.material.MaterialService; +import com.wansensoft.service.unit.UnitService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/material") +@Api(tags = {"商品管理"}) +public class MaterialController { + private Logger logger = LoggerFactory.getLogger(MaterialController.class); + + private final MaterialService materialService; + + private final DepotItemService depotItemService; + + private final UnitService unitService; + + private final DepotService depotService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + public MaterialController(MaterialService materialService, DepotItemService depotItemService, UnitService unitService, DepotService depotService) { + this.materialService = materialService; + this.depotItemService = depotItemService; + this.unitService = unitService; + this.depotService = depotService; + } + + /** + * 检查商品是否存在 + * @param id + * @param name + * @param model + * @param color + * @param standard + * @param mfrs + * @param otherField1 + * @param otherField2 + * @param otherField3 + * @param unit + * @param unitId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsExist") + @ApiOperation(value = "检查商品是否存在") + public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, + @RequestParam("model") String model, @RequestParam("color") String color, + @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, + @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, + @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + int exist = materialService.checkIsExist(id, name, StringUtil.toNull(model), StringUtil.toNull(color), + StringUtil.toNull(standard), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), + StringUtil.toNull(otherField2), StringUtil.toNull(otherField3), StringUtil.toNull(unit), unitId); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态-启用或者禁用") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = materialService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 根据id来查询商品名称 + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询商品名称") + public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = materialService.findById(id); + res.code = 200; + res.data = list; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据meId来查询商品名称 + * @param meId + * @param request + * @return + */ + @GetMapping(value = "/findByIdWithBarCode") + @ApiOperation(value = "根据meId来查询商品名称") + public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId, + @RequestParam("mpList") String mpList, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + String[] mpArr = mpList.split(","); + MaterialVo4Unit mu = new MaterialVo4Unit(); + List list = materialService.findByIdWithBarCode(meId); + if(list!=null && !list.isEmpty()) { + mu = list.get(0); + mu.setMaterialOther(materialService.getMaterialOtherByParam(mpArr, mu)); + } + res.code = 200; + res.data = mu; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据关键词查找商品信息-条码、名称、规格、型号 + * @param q + * @param request + * @return + */ + @GetMapping(value = "/getMaterialByParam") + @ApiOperation(value = "根据关键词查找商品信息") + public BaseResponseInfo getMaterialByParam(@RequestParam("q") String q, + HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + JSONArray arr = materialService.getMaterialByParam(q); + res.code = 200; + res.data = arr; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 查找商品信息-下拉框 + * @param mpList + * @param request + * @return + */ + @GetMapping(value = "/findBySelect") + @ApiOperation(value = "查找商品信息") + public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam(value = "q", required = false) String q, + @RequestParam(value = "mpList", required = false) String mpList, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber, + @RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request) throws Exception{ + JSONObject object = new JSONObject(); + try { + String[] mpArr = new String[]{}; + if(StringUtil.isNotEmpty(mpList)){ + mpArr= mpList.split(","); + } + List dataList = materialService.findBySelectWithBarCode(categoryId, q, enableSerialNumber, + enableBatchNumber, (currentPage-1)*pageSize, pageSize); + int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber, + enableBatchNumber); + object.put("total", total); + JSONArray dataArray = new JSONArray(); + //存放数据json数组 + if (null != dataList) { + for (MaterialVo4Unit material : dataList) { + JSONObject item = new JSONObject(); + item.put("id", material.getMeId()); //商品扩展表的id + String ratioStr = ""; //比例 + Unit unit = new Unit(); + if (material.getUnitId() == null) { + ratioStr = ""; + } else { + unit = unitService.getUnit(material.getUnitId()); + //拼接副单位的比例 + String commodityUnit = material.getCommodityUnit(); + if(commodityUnit.equals(unit.getBasicUnit())) { + ratioStr = "[基本]"; + } + if(commodityUnit.equals(unit.getOtherUnit()) && unit.getRatio()!=null) { + ratioStr = "[" + unit.getRatio().stripTrailingZeros().toPlainString() + unit.getBasicUnit() + "]"; + } + if(commodityUnit.equals(unit.getOtherUnitTwo()) && unit.getRatioTwo()!=null) { + ratioStr = "[" + unit.getRatioTwo().stripTrailingZeros().toPlainString() + unit.getBasicUnit() + "]"; + } + if(commodityUnit.equals(unit.getOtherUnitThree()) && unit.getRatioThree()!=null) { + ratioStr = "[" + unit.getRatioThree().stripTrailingZeros().toPlainString() + unit.getBasicUnit() + "]"; + } + } + item.put("mBarCode", material.getMBarCode()); + item.put("name", material.getName()); + item.put("categoryName", material.getCategoryName()); + item.put("standard", material.getStandard()); + item.put("model", material.getModel()); + item.put("color", material.getColor()); + item.put("unit", material.getCommodityUnit() + ratioStr); + item.put("sku", material.getSku()); + item.put("enableSerialNumber", material.getEnableSerialNumber()); + item.put("enableBatchNumber", material.getEnableBatchNumber()); + BigDecimal stock; + if(StringUtil.isNotEmpty(material.getSku())){ + stock = depotItemService.getSkuStockByParam(depotId,material.getMeId(),null,null); + } else { + stock = depotItemService.getCurrentStockByParam(depotId, material.getId()); + if (material.getUnitId()!=null){ + String commodityUnit = material.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + item.put("stock", stock); + item.put("expand", materialService.getMaterialOtherByParam(mpArr, material)); + item.put("imgName", material.getImgName()); + if(fileUploadType == 2) { + item.put("imgSmall", "small"); + item.put("imgLarge", "large"); + } else { + item.put("imgSmall", ""); + item.put("imgLarge", ""); + } + dataArray.add(item); + } + } + object.put("rows", dataArray); + } catch (Exception e) { + e.printStackTrace(); + } + return object; + } + + /** + * 根据商品id查找商品信息 + * @param meId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialByMeId") + @ApiOperation(value = "根据商品id查找商品信息") + public JSONObject getMaterialByMeId(@RequestParam(value = "meId", required = false) Long meId, + @RequestParam("mpList") String mpList, + HttpServletRequest request) throws Exception{ + JSONObject item = new JSONObject(); + try { + String[] mpArr = mpList.split(","); + List materialList = materialService.getMaterialByMeId(meId); + if(materialList!=null && materialList.size()!=1) { + return item; + } else if(materialList.size() == 1) { + MaterialVo4Unit material = materialList.get(0); + item.put("Id", material.getMeId()); //商品扩展表的id + String ratio; //比例 + if (material.getUnitId() == null) { + ratio = ""; + } else { + ratio = material.getUnitName(); + ratio = ratio.substring(ratio.indexOf("(")); + } + //名称/型号/扩展信息/包装 + String MaterialName = ""; + MaterialName = MaterialName + material.getMBarCode() + "_" + material.getName() + + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")"); + String expand = materialService.getMaterialOtherByParam(mpArr, material); //扩展信息 + MaterialName = MaterialName + expand + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio; + item.put("MaterialName", MaterialName); + item.put("name", material.getName()); + item.put("expand", expand); + item.put("model", material.getModel()); + item.put("standard", material.getStandard()); + item.put("unit", material.getUnit() + ratio); + } + } catch (Exception e) { + e.printStackTrace(); + } + return item; + } + + /** + * 生成excel表格 + * @param categoryId + * @param materialParam + * @param color + * @param weight + * @param expiryNum + * @param enabled + * @param enableSerialNumber + * @param enableBatchNumber + * @param remark + * @param mpList + * @param request + * @param response + */ + @GetMapping(value = "/exportExcel") + @ApiOperation(value = "生成excel表格") + public void exportExcel(@RequestParam(value = "categoryId", required = false) String categoryId, + @RequestParam(value = "materialParam", required = false) String materialParam, + @RequestParam(value = "color", required = false) String color, + @RequestParam(value = "materialOther", required = false) String materialOther, + @RequestParam(value = "weight", required = false) String weight, + @RequestParam(value = "expiryNum", required = false) String expiryNum, + @RequestParam(value = "enabled", required = false) String enabled, + @RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber, + @RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber, + @RequestParam(value = "remark", required = false) String remark, + @RequestParam(value = "mpList", required = false) String mpList, + HttpServletRequest request, HttpServletResponse response) { + try { + materialService.exportExcel(StringUtil.toNull(categoryId), StringUtil.toNull(materialParam), StringUtil.toNull(color), + StringUtil.toNull(materialOther), StringUtil.toNull(weight), + StringUtil.toNull(expiryNum), StringUtil.toNull(enabled), StringUtil.toNull(enableSerialNumber), + StringUtil.toNull(enableBatchNumber), StringUtil.toNull(remark), response); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * excel表格导入产品(含初始库存) + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importExcel") + @ApiOperation(value = "excel表格导入产品") + public BaseResponseInfo importExcel(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + res = materialService.importExcel(file, request); + } catch (Exception e) { + e.printStackTrace(); + } + return res; + } + + /** + * 获取商品序列号 + * @param q + * @param currentPage + * @param pageSize + * @param request + * @param response + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialEnableSerialNumberList") + @ApiOperation(value = "获取商品序列号") + public JSONObject getMaterialEnableSerialNumberList( + @RequestParam(value = "q", required = false) String q, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request, + HttpServletResponse response)throws Exception { + JSONObject object= new JSONObject(); + try { + List list = materialService.getMaterialEnableSerialNumberList(q, (currentPage-1)*pageSize, pageSize); + Long count = materialService.getMaterialEnableSerialNumberCount(q); + object.put("rows", list); + object.put("total", count); + } catch (Exception e) { + e.printStackTrace(); + } + return object; + } + + /** + * 获取最大条码 + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaxBarCode") + @ApiOperation(value = "获取最大条码") + public BaseResponseInfo getMaxBarCode() throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + String barCode = materialService.getMaxBarCode(); + map.put("barCode", barCode); + res.code = 200; + res.data = map; + return res; + } + + /** + * 商品名称模糊匹配 + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialNameList") + @ApiOperation(value = "商品名称模糊匹配") + public JSONArray getMaterialNameList() throws Exception { + JSONArray arr = new JSONArray(); + try { + List list = materialService.getMaterialNameList(); + for (String s : list) { + JSONObject item = new JSONObject(); + item.put("value", s); + item.put("text", s); + arr.add(item); + } + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 根据条码查询商品信息 + * @return + * @throws Exception + */ + @GetMapping(value = "/getMaterialByBarCode") + @ApiOperation(value = "根据条码查询商品信息") + public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode, + @RequestParam(value = "organId", required = false) Long organId, + @RequestParam(value = "depotId", required = false) Long depotId, + @RequestParam("mpList") String mpList, + @RequestParam(required = false, value = "prefixNo") String prefixNo, + HttpServletRequest request) throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String[] mpArr = mpList.split(","); + //支持序列号查询,先根据序列号查询条码,如果查不到就直接查条码 + MaterialExtend materialExtend = materialService.getMaterialExtendBySerialNumber(barCode); + if(materialExtend!=null && StringUtil.isNotEmpty(materialExtend.getBarCode())) { + barCode = materialExtend.getBarCode(); + } + List list = materialService.getMaterialByBarCode(barCode); + if(list!=null && !list.isEmpty()) { + for(MaterialVo4Unit mvo: list) { + mvo.setMaterialOther(materialService.getMaterialOtherByParam(mpArr, mvo)); + if ("LSCK".equals(prefixNo) || "LSTH".equals(prefixNo)) { + //零售价 + mvo.setBillPrice(mvo.getCommodityDecimal()); + } else if ("CGDD".equals(prefixNo) || "CGRK".equals(prefixNo) || "CGTH".equals(prefixNo) + || "QTRK".equals(prefixNo) || "DBCK".equals(prefixNo) || "ZZD".equals(prefixNo) || "CXD".equals(prefixNo) + || "PDLR".equals(prefixNo) || "PDFP".equals(prefixNo)) { + //采购价 + mvo.setBillPrice(mvo.getPurchaseDecimal()); + } else if ("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) { + //销售价 + if(organId == null) { + mvo.setBillPrice(mvo.getWholesaleDecimal()); + } else { + //查询最后一单的销售价,实现不同的客户不同的销售价 + BigDecimal lastUnitPrice = depotItemService.getLastUnitPriceByParam(organId, mvo.getMeId(), prefixNo); + mvo.setBillPrice(lastUnitPrice!=null? lastUnitPrice : mvo.getWholesaleDecimal()); + } + } + //仓库id + if (depotId == null) { + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for (Object obj : depotArr) { + JSONObject depotObj = JSONObject.parseObject(obj.toString()); + if (depotObj.get("isDefault") != null) { + Boolean isDefault = depotObj.getBoolean("isDefault"); + if (isDefault) { + Long id = depotObj.getLong("id"); + if (!"CGDD".equals(prefixNo) && !"XSDD".equals(prefixNo)) { + //除订单之外的单据才有仓库 + mvo.setDepotId(id); + } + getStockByMaterialInfo(mvo); + } + } + } + } else { + mvo.setDepotId(depotId); + getStockByMaterialInfo(mvo); + } + } + } + res.code = 200; + res.data = list; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据商品信息获取库存,进行赋值 + * @param mvo + * @throws Exception + */ + private void getStockByMaterialInfo(MaterialVo4Unit mvo) { + BigDecimal stock; + if (StringUtil.isNotEmpty(mvo.getSku())) { + stock = depotItemService.getSkuStockByParam(mvo.getDepotId(), mvo.getMeId(), null, null); + } else { + stock = depotItemService.getCurrentStockByParam(mvo.getDepotId(), mvo.getId()); + if (mvo.getUnitId() != null) { + Unit unit = unitService.getUnit(mvo.getUnitId()); + String commodityUnit = mvo.getCommodityUnit(); + stock = unitService.parseStockByUnit(stock, unit, commodityUnit); + } + } + mvo.setStock(stock); + } + + /** + * 商品库存查询 + * @param currentPage + * @param pageSize + * @param depotIds + * @param categoryId + * @param materialParam + * @param mpList + * @param column + * @param order + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getListWithStock") + @ApiOperation(value = "商品库存查询") + public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer currentPage, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "depotIds", required = false) String depotIds, + @RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam(value = "position", required = false) String position, + @RequestParam("materialParam") String materialParam, + @RequestParam("zeroStock") Integer zeroStock, + @RequestParam("mpList") String mpList, + @RequestParam("column") String column, + @RequestParam("order") String order, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + List idList = new ArrayList<>(); + List depotList = new ArrayList<>(); + if(categoryId != null){ + idList = materialService.getListByParentId(categoryId); + } + if(StringUtil.isNotEmpty(depotIds)) { + depotList = StringUtil.strToLongList(depotIds); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = depotService.findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + List dataList = materialService.getListWithStock(depotList, idList, StringUtil.toNull(position), StringUtil.toNull(materialParam), + zeroStock, StringUtil.safeSqlParse(column), StringUtil.safeSqlParse(order), (currentPage-1)*pageSize, pageSize); + int total = materialService.getListWithStockCount(depotList, idList, StringUtil.toNull(position), StringUtil.toNull(materialParam), zeroStock); + MaterialVo4Unit materialVo4Unit= materialService.getTotalStockAndPrice(depotList, idList, StringUtil.toNull(position), StringUtil.toNull(materialParam)); + map.put("total", total); + map.put("currentStock", materialVo4Unit.getCurrentStock()!=null?materialVo4Unit.getCurrentStock():BigDecimal.ZERO); + map.put("currentStockPrice", materialVo4Unit.getCurrentStockPrice()!=null?materialVo4Unit.getCurrentStockPrice():BigDecimal.ZERO); + map.put("currentWeight", materialVo4Unit.getCurrentWeight()!=null?materialVo4Unit.getCurrentWeight():BigDecimal.ZERO); + map.put("rows", dataList); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 批量设置商品当前的实时库存(按每个仓库) + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping(value = "/batchSetMaterialCurrentStock") + @ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)") + public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, + HttpServletRequest request) { + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = materialService.batchSetMaterialCurrentStock(ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 批量更新商品信息 + * @param jsonObject + * @return + * @throws Exception + */ + @PostMapping(value = "/batchUpdate") + @ApiOperation(value = "批量更新商品信息") + public String batchUpdate(@RequestBody JSONObject jsonObject, + HttpServletRequest request) { + Map objectMap = new HashMap<>(); + int res = materialService.batchUpdate(jsonObject); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialExtendController.java b/api/src/main/java/com/wansensoft/api/material/MaterialExtendController.java new file mode 100644 index 00000000..2f37306a --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/material/MaterialExtendController.java @@ -0,0 +1,128 @@ +package com.wansensoft.api.material; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.service.materialExtend.MaterialExtendService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.MaterialExtendVo4List; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/materialsExtend") +@Api(tags = {"商品价格扩展"}) +public class MaterialExtendController { + private Logger logger = LoggerFactory.getLogger(MaterialExtendController.class); + + private final MaterialExtendService materialExtendService; + + public MaterialExtendController(MaterialExtendService materialExtendService) { + this.materialExtendService = materialExtendService; + } + + @GetMapping(value = "/getDetailList") + @ApiOperation(value = "价格信息列表") + public BaseResponseInfo getDetailList(@RequestParam("materialId") Long materialId, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List dataList = new ArrayList<>(); + if(materialId!=0) { + dataList = materialExtendService.getDetailList(materialId); + } + JSONObject outer = new JSONObject(); + outer.put("total", dataList.size()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + for (MaterialExtendVo4List md : dataList) { + JSONObject item = new JSONObject(); + item.put("id", md.getId()); + item.put("barCode", md.getBarCode()); + item.put("commodityUnit", md.getCommodityUnit()); + if (StringUtil.isNotEmpty(md.getSku())) { + item.put("sku", md.getSku()); + } + item.put("purchaseDecimal", md.getPurchaseDecimal()); + item.put("commodityDecimal", md.getCommodityDecimal()); + item.put("wholesaleDecimal", md.getWholesaleDecimal()); + item.put("lowDecimal", md.getLowDecimal()); + dataArray.add(item); + } + outer.put("rows", dataArray); + res.code = 200; + res.data = outer; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据条码查询商品信息 + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getInfoByBarCode") + @ApiOperation(value = "根据条码查询商品信息") + public BaseResponseInfo getInfoByBarCode(@RequestParam("barCode") String barCode, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode); + res.code = 200; + res.data = materialExtend; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 校验条码是否存在 + * @param id + * @param barCode + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsBarCodeExist") + @ApiOperation(value = "校验条码是否存在") + public BaseResponseInfo checkIsBarCodeExist(@RequestParam("id") Long id, + @RequestParam("barCode") String barCode, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + int exist = materialExtendService.checkIsBarCodeExist(id, barCode); + if(exist > 0) { + map.put("status", true); + } else { + map.put("status", false); + } + res.code = 200; + res.data = map; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialPropertyController.java b/api/src/main/java/com/wansensoft/api/material/MaterialPropertyController.java new file mode 100644 index 00000000..680b5a26 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/material/MaterialPropertyController.java @@ -0,0 +1,41 @@ +package com.wansensoft.api.material; + +import com.wansensoft.entities.material.MaterialProperty; +import com.wansensoft.service.materialProperty.MaterialPropertyService; +import com.wansensoft.utils.BaseResponseInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +@RestController +@RequestMapping(value = "/materialProperty") +@Api(tags = {"商品扩展字段"}) +public class MaterialPropertyController { + + private final MaterialPropertyService materialPropertyService; + + public MaterialPropertyController(MaterialPropertyService materialPropertyService) { + this.materialPropertyService = materialPropertyService; + } + + @GetMapping(value = "/getAllList") + @ApiOperation(value = "查询全部商品扩展字段信息") + public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{ + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = materialPropertyService.getMaterialProperty(); + res.code = 200; + res.data = list; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + +} diff --git a/api/src/main/java/com/wansensoft/api/msg/MsgController.java b/api/src/main/java/com/wansensoft/api/msg/MsgController.java new file mode 100644 index 00000000..fde11955 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/msg/MsgController.java @@ -0,0 +1,148 @@ +package com.wansensoft.api.msg; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.msg.MsgEx; +import com.wansensoft.service.msg.MsgService; +import com.wansensoft.utils.BaseResponseInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/msg") +@Api(tags = {"消息管理"}) +public class MsgController { + private Logger logger = LoggerFactory.getLogger(MsgController.class); + + private final MsgService msgService; + + public MsgController(MsgService msgService) { + this.msgService = msgService; + } + + /** + * 根据状态查询消息 + * @param status + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgByStatus") + @ApiOperation(value = "根据状态查询消息") + public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = msgService.getMsgByStatus(status); + res.code = 200; + res.data = list; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 批量更新状态 + * @param jsonObject + * @param request + * @return + * @throws Exception + */ + @PostMapping("/batchUpdateStatus") + @ApiOperation(value = "批量更新状态") + public BaseResponseInfo batchUpdateStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String ids = jsonObject.getString("ids"); + String status = jsonObject.getString("status"); + msgService.batchUpdateStatus(ids, status); + res.code = 200; + res.data = "更新成功"; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据状态查询数量 + * @param status + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgCountByStatus") + @ApiOperation(value = "根据状态查询数量") + public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map map = new HashMap(); + Long count = msgService.getMsgCountByStatus(status); + map.put("count", count); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据类型查询数量 + * @param type + * @param request + * @return + * @throws Exception + */ + @GetMapping("/getMsgCountByType") + @ApiOperation(value = "根据类型查询数量") + public BaseResponseInfo getMsgCountByType(@RequestParam("type") String type, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map map = new HashMap<>(); + Integer count = msgService.getMsgCountByType(type); + map.put("count", count); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 全部设置未已读 + * @param request + * @return + * @throws Exception + */ + @PostMapping("/readAllMsg") + @ApiOperation(value = "全部设置未已读") + public BaseResponseInfo readAllMsg(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + msgService.readAllMsg(); + res.code = 200; + res.data = "操作成功!"; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/organization/OrganizationController.java b/api/src/main/java/com/wansensoft/api/organization/OrganizationController.java new file mode 100644 index 00000000..a3f1d9bd --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/organization/OrganizationController.java @@ -0,0 +1,130 @@ +package com.wansensoft.api.organization; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.organization.Organization; +import com.wansensoft.service.organization.OrganizationService; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.vo.TreeNode; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.text.SimpleDateFormat; +import java.util.List; + + +@RestController +@RequestMapping(value = "/organization") +@Api(tags = {"机构管理"}) +public class OrganizationController { + private Logger logger = LoggerFactory.getLogger(OrganizationController.class); + + private final OrganizationService organizationService; + + public OrganizationController(OrganizationService organizationService) { + this.organizationService = organizationService; + } + + /** + * 根据id来查询机构信息 + * @param id + * @param request + * @return + */ + @GetMapping(value = "/findById") + @ApiOperation(value = "根据id来查询机构信息") + public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + List dataList = organizationService.findById(id); + JSONObject outer = new JSONObject(); + if (null != dataList) { + for (Organization org : dataList) { + outer.put("id", org.getId()); + outer.put("orgAbr", org.getOrgAbr()); + outer.put("parentId", org.getParentId()); + List dataParentList = organizationService.findByParentId(org.getParentId()); + if(dataParentList!=null&& !dataParentList.isEmpty()){ + //父级机构名称显示简称 + outer.put("orgParentName", dataParentList.get(0).getOrgAbr()); + } + outer.put("orgNo", org.getOrgNo()); + outer.put("sort", org.getSort()); + outer.put("remark", org.getRemark()); + } + } + res.code = 200; + res.data = outer; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * description: + * 获取机构树数据 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getOrganizationTree") + @ApiOperation(value = "获取机构树数据") + public JSONArray getOrganizationTree(@RequestParam(value = "id", required = false) Long id) throws Exception{ + JSONArray arr=new JSONArray(); + List organizationTree = organizationService.getOrganizationTree(id); + if(organizationTree!=null&& !organizationTree.isEmpty()){ + for(TreeNode node:organizationTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj); + } + } + return arr; + } + /** + * description: + * 新增机构信息 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/addOrganization") + @ApiOperation(value = "新增机构信息") + public Object addOrganization(@RequestParam("info") String beanJson) { + JSONObject result = ExceptionConstants.standardSuccess(); + Organization org= JSON.parseObject(beanJson, Organization.class); + int i= organizationService.addOrganization(org); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ADD_FAILED_CODE, + ExceptionConstants.ORGANIZATION_ADD_FAILED_MSG); + } + return result; + } + /** + * description: + * 修改机构信息 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping(value = "/editOrganization") + @ApiOperation(value = "修改机构信息") + public Object editOrganization(@RequestParam("info") String beanJson) { + JSONObject result = ExceptionConstants.standardSuccess(); + Organization org= JSON.parseObject(beanJson, Organization.class); + int i= organizationService.editOrganization(org); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_EDIT_FAILED_CODE, + ExceptionConstants.ORGANIZATION_EDIT_FAILED_MSG); + } + return result; + } +} diff --git a/api/src/main/java/com/wansensoft/api/person/PersonController.java b/api/src/main/java/com/wansensoft/api/person/PersonController.java new file mode 100644 index 00000000..fd822efc --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/person/PersonController.java @@ -0,0 +1,160 @@ +package com.wansensoft.api.person; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.person.Person; +import com.wansensoft.service.person.PersonService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/person") +@Api(tags = {"经手人管理"}) +public class PersonController { + private Logger logger = LoggerFactory.getLogger(PersonController.class); + + private final PersonService personService; + + public PersonController(PersonService personService) { + this.personService = personService; + } + + /** + * 全部数据列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "全部数据列表") + public BaseResponseInfo getAllList(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List personList = personService.getPerson(); + map.put("personList", personList); + res.code = 200; + res.data = personList; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据Id获取经手人信息 + * @param personIds + * @param request + * @return + */ + @GetMapping(value = "/getPersonByIds") + @ApiOperation(value = "根据Id获取经手人信息") + public BaseResponseInfo getPersonByIds(@RequestParam("personIds") String personIds, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + Map personMap = personService.getPersonMap(); + String names = personService.getPersonByMapAndIds(personMap, personIds); + map.put("names", names); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据类型获取经手人信息 + * @param type + * @param request + * @return + */ + @GetMapping(value = "/getPersonByType") + @ApiOperation(value = "根据类型获取经手人信息") + public BaseResponseInfo getPersonByType(@RequestParam("type") String type, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + List personList = personService.getPersonByType(type); + map.put("personList", personList); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据类型获取经手人信息 1-业务员,2-仓管员,3-财务员 + * @param typeNum + * @param request + * @return + */ + @GetMapping(value = "/getPersonByNumType") + @ApiOperation(value = "根据类型获取经手人信息1-业务员,2-仓管员,3-财务员") + public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, + HttpServletRequest request) { + JSONArray dataArray = new JSONArray(); + try { + String type = ""; + if (typeNum.equals("1")) { + type = "业务员"; + } else if (typeNum.equals("2")) { + type = "仓管员"; + } else if (typeNum.equals("3")) { + type = "财务员"; + } + List personList = personService.getPersonByType(type); + if (null != personList) { + for (Person person : personList) { + JSONObject item = new JSONObject(); + item.put("value", person.getId().toString()); + item.put("text", person.getName()); + dataArray.add(item); + } + } + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = personService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java new file mode 100644 index 00000000..9ee75785 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java @@ -0,0 +1,133 @@ +package com.wansensoft.api.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.platformConfig.PlatformConfig; +import com.wansensoft.service.platformConfig.PlatformConfigService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping(value = "/platformConfig") +@Api(tags = {"平台参数"}) +public class PlatformConfigController { + private Logger logger = LoggerFactory.getLogger(PlatformConfigController.class); + + private final PlatformConfigService platformConfigService; + + public PlatformConfigController(PlatformConfigService platformConfigService) { + this.platformConfigService = platformConfigService; + } + + /** + * 获取平台名称 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/name") + @ApiOperation(value = "获取平台名称") + public String getPlatformName(HttpServletRequest request) { + String res; + try { + String platformKey = "platform_name"; + PlatformConfig platformConfig = platformConfigService.getInfoByKey(platformKey); + res = platformConfig.getPlatformValue(); + } catch(Exception e){ + e.printStackTrace(); + res = "ERP系统"; + } + return res; + } + + /** + * 获取官方网站地址 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/url") + @ApiOperation(value = "获取官方网站地址") + public String getPlatformUrl(HttpServletRequest request) { + String res; + try { + String platformKey = "platform_url"; + PlatformConfig platformConfig = platformConfigService.getInfoByKey(platformKey); + res = platformConfig.getPlatformValue(); + } catch(Exception e){ + e.printStackTrace(); + res = "#"; + } + return res; + } + + /** + * 获取是否开启注册 + * @param request + * @return + */ + @GetMapping(value = "/getPlatform/registerFlag") + @ApiOperation(value = "获取是否开启注册") + public String getPlatformRegisterFlag(HttpServletRequest request) { + String res; + try { + String platformKey = "register_flag"; + PlatformConfig platformConfig = platformConfigService.getInfoByKey(platformKey); + res = platformConfig.getPlatformValue(); + } catch(Exception e){ + e.printStackTrace(); + res = "#"; + } + return res; + } + + /** + * 根据platformKey更新platformValue + * @param object + * @param request + * @return + */ + @PostMapping(value = "/updatePlatformConfigByKey") + @ApiOperation(value = "根据platformKey更新platformValue") + public String updatePlatformConfigByKey(@RequestBody JSONObject object, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + String platformKey = object.getString("platformKey"); + String platformValue = object.getString("platformValue"); + int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 根据platformKey查询信息 + * @param platformKey + * @param request + * @return + */ + @GetMapping(value = "/getInfoByKey") + @ApiOperation(value = "根据platformKey查询信息") + public BaseResponseInfo getInfoByKey(@RequestParam("platformKey") String platformKey, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + PlatformConfig platformConfig = platformConfigService.getInfoByKey(platformKey); + res.code = 200; + res.data = platformConfig; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java b/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java index 28f19665..2abdeff2 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java b/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java index 698ee268..ba774fe1 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductController.java b/api/src/main/java/com/wansensoft/api/product/ProductController.java index c077e3bf..07a9f9db 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java b/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java index d352e7d9..9c0092ce 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java b/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java index 441c4b6d..b25cc480 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java b/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java index 2742be77..f0df596e 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java b/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java index 42d62576..4d230eca 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java b/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java index a7cc1000..09a635c3 100644 --- a/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java +++ b/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.product; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/role/RoleController.java b/api/src/main/java/com/wansensoft/api/role/RoleController.java new file mode 100644 index 00000000..97eb4620 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/role/RoleController.java @@ -0,0 +1,93 @@ +package com.wansensoft.api.role; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.role.Role; +import com.wansensoft.service.role.RoleService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.service.userBusiness.UserBusinessServiceImpl; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/role") +@Api(tags = {"角色管理"}) +public class RoleController { + private final RoleService roleService; + + private final UserBusinessService userBusinessService; + + public RoleController(RoleService roleService, UserBusinessService userBusinessService) { + this.roleService = roleService; + this.userBusinessService = userBusinessService; + } + + /** + * 角色对应应用显示 + * @param request + * @return + */ + @GetMapping(value = "/findUserRole") + @ApiOperation(value = "查询用户的角色") + public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, + HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = roleService.findUserRole(); + if (null != dataList) { + for (Role role : dataList) { + JSONObject item = new JSONObject(); + item.put("id", role.getId()); + item.put("text", role.getName()); + Boolean flag = ubValue.contains("[" + role.getId().toString() + "]"); + if (flag) { + item.put("checked", true); + } + arr.add(item); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + @GetMapping(value = "/allList") + @ApiOperation(value = "查询全部角色列表") + public List allList(HttpServletRequest request)throws Exception { + return roleService.allList(); + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = roleService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/role/SysRoleController.java b/api/src/main/java/com/wansensoft/api/role/SysRoleController.java index c6aa4129..8a1f02d1 100644 --- a/api/src/main/java/com/wansensoft/api/role/SysRoleController.java +++ b/api/src/main/java/com/wansensoft/api/role/SysRoleController.java @@ -1,29 +1,9 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.role; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.role.AddOrUpdateRoleDTO; -import com.wansensoft.dto.role.RoleListDTO; -import com.wansensoft.service.role.ISysRoleService; -import com.wansensoft.service.role.KtSysRoleService; -import com.wansensoft.service.system.ISysMenuService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.RoleVO; -import org.springframework.web.bind.annotation.*; -import java.util.List; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; /** *

@@ -34,45 +14,7 @@ * @since 2023-09-05 */ @RestController -@RequestMapping("sysRole") +@RequestMapping("/sysRole") public class SysRoleController { - private final ISysMenuService menuService; - - private final KtSysRoleService ktSysRoleService; - - public SysRoleController(ISysMenuService menuService, KtSysRoleService ktSysRoleService) { - this.menuService = menuService; - this.ktSysRoleService = ktSysRoleService; - } - - @GetMapping("menu") - public Response queryMenu() { - return menuService.menuList(); - } - - @GetMapping("list") - public Response> getRoleList() { - return ktSysRoleService.roleList(); - } - - @PostMapping("PageList") - public Response> getRolePageList(@RequestBody RoleListDTO roleListDTO) { - return ktSysRoleService.rolePageList(roleListDTO); - } - - @PostMapping("updateStatus") - public Response updateStatus(@RequestParam(value = "id") String id, @RequestParam(value = "status") Integer status) { - return ktSysRoleService.updateStatus(id, status); - } - - @PostMapping("addOrUpdateRole") - public Response addOrUpdateRole(@RequestBody AddOrUpdateRoleDTO addOrUpdateRoleDTO) { - return ktSysRoleService.addOrUpdateRole(addOrUpdateRoleDTO); - } - - @PostMapping("deleteRole") - public Response deleteRole(@RequestParam(value = "id") String id) { - return ktSysRoleService.deleteRole(id); - } } diff --git a/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java b/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java index 61926fe3..8d72c1ed 100644 --- a/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java +++ b/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.role; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/sequence/SequenceController.java b/api/src/main/java/com/wansensoft/api/sequence/SequenceController.java new file mode 100644 index 00000000..c4f828c1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/sequence/SequenceController.java @@ -0,0 +1,51 @@ +package com.wansensoft.api.sequence; + +import com.wansensoft.service.sequence.SequenceService; +import com.wansensoft.utils.BaseResponseInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping(value = "/sequence") +@Api(tags = {"单据编号"}) +public class SequenceController { + private Logger logger = LoggerFactory.getLogger(SequenceController.class); + + private final SequenceService sequenceService; + + public SequenceController(SequenceService sequenceService) { + this.sequenceService = sequenceService; + } + + /** + * 单据编号生成接口 + * @param request + * @return + */ + @GetMapping(value = "/buildNumber") + @ApiOperation(value = "单据编号生成接口") + public BaseResponseInfo buildNumber(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap(); + try { + String number = sequenceService.buildOnlyNumber(); + map.put("defaultNumber", number); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + +} diff --git a/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java b/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java new file mode 100644 index 00000000..cc975cdc --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java @@ -0,0 +1,110 @@ +package com.wansensoft.api.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import com.wansensoft.service.depotHead.DepotHeadService; +import com.wansensoft.service.depotItem.DepotItemService; +import com.wansensoft.service.serialNumber.SerialNumberService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.Response; +import com.wansensoft.utils.Tools; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/serialNumber") +@Api(tags = {"序列号管理"}) +@Slf4j +public class SerialNumberController { + private final SerialNumberService serialNumberService; + private final DepotHeadService depotHeadService; + private final DepotItemService depotItemService; + + public SerialNumberController(SerialNumberService serialNumberService, DepotHeadService depotHeadService, DepotItemService depotItemService) { + this.serialNumberService = serialNumberService; + this.depotHeadService = depotHeadService; + this.depotItemService = depotItemService; + } + + /** + * description: + *批量添加序列号 + * @Param: materialName + * @Param: serialNumberPrefix + * @Param: batAddTotal + * @Param: remark + * @return java.lang.Object + */ + @PostMapping("/batAddSerialNumber") + @ApiOperation(value = "批量添加序列号") + public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception{ + Map objectMap = new HashMap<>(); + String materialCode = jsonObject.getString("materialCode"); + String serialNumberPrefix = jsonObject.getString("serialNumberPrefix"); + Integer batAddTotal = jsonObject.getInteger("batAddTotal"); + String remark = jsonObject.getString("remark"); + int insert = serialNumberService.batAddSerialNumber(materialCode,serialNumberPrefix,batAddTotal,remark); + if(insert > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else if(insert == -1) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 获取序列号商品 + * @param name + * @param depotId + * @param barCode + * @param currentPage + * @param pageSize + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getEnableSerialNumberList") + @ApiOperation(value = "获取序列号商品") + public BaseResponseInfo getEnableSerialNumberList(@RequestParam("name") String name, + @RequestParam("depotItemId") Long depotItemId, + @RequestParam("depotId") Long depotId, + @RequestParam("barCode") String barCode, + @RequestParam("page") Integer currentPage, + @RequestParam("rows") Integer pageSize, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + Map map = new HashMap<>(); + try { + String number = ""; + if(depotItemId != null) { + DepotItem depotItem = depotItemService.getDepotItem(depotItemId); + number = depotHeadService.getDepotHead(depotItem.getHeaderId()).getNumber(); + } + List list = serialNumberService.getEnableSerialNumberList(number, name, depotId, barCode, (currentPage-1)*pageSize, pageSize); + for(SerialNumberEx serialNumberEx: list) { + serialNumberEx.setCreateTimeStr(Tools.getCenternTime(serialNumberEx.getCreateTime())); + } + Long total = serialNumberService.getEnableSerialNumberCount(number, name, depotId, barCode); + map.put("rows", list); + map.put("total", total); + res.code = 200; + res.data = map; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + log.error(e.getMessage()); + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java new file mode 100644 index 00000000..340dc6c8 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java @@ -0,0 +1,385 @@ +package com.wansensoft.api.supplier; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.service.supplier.SupplierService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ExcelUtils; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/supplier") +@Api(tags = {"商家管理"}) +public class SupplierController { + + private final SupplierService supplierService; + + private final UserBusinessService userBusinessService; + + private final SystemConfigService systemConfigService; + + private final UserService userService; + + public SupplierController(SupplierService supplierService, UserBusinessService userBusinessService, SystemConfigService systemConfigService, UserService userService) { + this.supplierService = supplierService; + this.userBusinessService = userBusinessService; + this.systemConfigService = systemConfigService; + this.userService = userService; + } + + @GetMapping(value = "/checkIsNameAndTypeExist") + @ApiOperation(value = "检查名称和类型是否存在") + public String checkIsNameAndTypeExist(@RequestParam Long id, + @RequestParam(value ="name", required = false) String name, + @RequestParam(value ="type") String type, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + int exist = supplierService.checkIsNameAndTypeExist(id, name, type); + if(exist > 0) { + objectMap.put("status", true); + } else { + objectMap.put("status", false); + } + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 查找客户信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_cus") + @ApiOperation(value = "查找客户信息") + public JSONArray findBySelectCus(HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + String type = "UserCustomer"; + Long userId = userService.getUserId(request); + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); + List supplierList = supplierService.findBySelectCus(); + JSONArray dataArray = new JSONArray(); + if (null != supplierList) { + boolean customerFlag = systemConfigService.getCustomerFlag(); + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]"); + if (!customerFlag || flag) { + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier()); //客户名称 + dataArray.add(item); + } + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 查找供应商信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_sup") + @ApiOperation(value = "查找供应商信息") + public JSONArray findBySelectSup(HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + List supplierList = supplierService.findBySelectSup(); + JSONArray dataArray = new JSONArray(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + //供应商名称 + item.put("supplier", supplier.getSupplier()); + dataArray.add(item); + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 查找往来单位,含供应商和客户信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_organ") + @ApiOperation(value = "查找往来单位,含供应商和客户信息") + public JSONArray findBySelectOrgan(HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + JSONArray dataArray = new JSONArray(); + //1、获取供应商信息 + List supplierList = supplierService.findBySelectSup(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier() + "[供应商]"); //供应商名称 + dataArray.add(item); + } + } + //2、获取客户信息 + String type = "UserCustomer"; + Long userId = userService.getUserId(request); + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); + List customerList = supplierService.findBySelectCus(); + if (null != customerList) { + boolean customerFlag = systemConfigService.getCustomerFlag(); + for (Supplier supplier : customerList) { + JSONObject item = new JSONObject(); + Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]"); + if (!customerFlag || flag) { + item.put("id", supplier.getId()); + item.put("supplier", supplier.getSupplier() + "[客户]"); //客户名称 + dataArray.add(item); + } + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 查找会员信息-下拉框 + * @param request + * @return + */ + @PostMapping(value = "/findBySelect_retail") + @ApiOperation(value = "查找会员信息") + public JSONArray findBySelectRetail(HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + List supplierList = supplierService.findBySelectRetail(); + JSONArray dataArray = new JSONArray(); + if (null != supplierList) { + for (Supplier supplier : supplierList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + //客户名称 + item.put("supplier", supplier.getSupplier()); + item.put("advanceIn", supplier.getAdvanceIn()); //预付款金额 + dataArray.add(item); + } + } + arr = dataArray; + } catch(Exception e){ + e.printStackTrace(); + } + return arr; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = supplierService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 用户对应客户显示 + * @param type + * @param keyId + * @param request + * @return + */ + @GetMapping(value = "/findUserCustomer") + @ApiOperation(value = "用户对应客户显示") + public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId, + HttpServletRequest request) { + JSONArray arr = new JSONArray(); + try { + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId); + List dataList = supplierService.findUserCustomer(); + //开始拼接json数据 + JSONObject outer = new JSONObject(); + outer.put("id", 0); + outer.put("key", 0); + outer.put("value", 0); + outer.put("title", "客户列表"); + outer.put("attributes", "客户列表"); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if (null != dataList) { + for (Supplier supplier : dataList) { + JSONObject item = new JSONObject(); + item.put("id", supplier.getId()); + item.put("key", supplier.getId()); + item.put("value", supplier.getId()); + item.put("title", supplier.getSupplier()); + item.put("attributes", supplier.getSupplier()); + boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]"); + if (flag) { + item.put("checked", true); + } + dataArray.add(item); + } + } + outer.put("children", dataArray); + arr.add(outer); + } catch (Exception e) { + e.printStackTrace(); + } + return arr; + } + + /** + * 根据客户或供应商查询期初、期初已收等信息 + * @param organId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getBeginNeedByOrganId") + @ApiOperation(value = "根据客户或供应商查询期初、期初已收等信息") + public BaseResponseInfo getBeginNeedByOrganId(@RequestParam("organId") Long organId, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map map = supplierService.getBeginNeedByOrganId(organId); + res.code = 200; + res.data = map; + } catch (Exception e) { + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 导入供应商 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importVendor") + @ApiOperation(value = "导入供应商") + public BaseResponseInfo importVendor(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importVendor(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + res.code = 500; + res.data = "导入失败"; + } + return res; + } + + /** + * 导入客户 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importCustomer") + @ApiOperation(value = "导入客户") + public BaseResponseInfo importCustomer(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importCustomer(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + res.code = 500; + res.data = "导入失败"; + } + return res; + } + + /** + * 导入会员 + * @param file + * @param request + * @param response + * @return + */ + @PostMapping(value = "/importMember") + @ApiOperation(value = "导入会员") + public BaseResponseInfo importMember(MultipartFile file, + HttpServletRequest request, HttpServletResponse response) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + supplierService.importMember(file, request); + res.code = 200; + res.data = "导入成功"; + } catch(Exception e){ + res.code = 500; + res.data = "导入失败"; + } + return res; + } + + /** + * 生成excel表格 + * @param supplier + * @param type + * @param phonenum + * @param telephone + * @param request + * @param response + * @return + */ + @GetMapping(value = "/exportExcel") + public void exportExcel(@RequestParam(value = "supplier", required = false) String supplier, + @RequestParam("type") String type, + @RequestParam(value = "phonenum", required = false) String phonenum, + @RequestParam(value = "telephone", required = false) String telephone, + HttpServletRequest request, HttpServletResponse response) { + try { + List dataList = supplierService.findByAll(supplier, type, phonenum, telephone); + File file = supplierService.exportExcel(dataList, type); + ExcelUtils.downloadExcel(file, file.getName(), response); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysConfigController.java b/api/src/main/java/com/wansensoft/api/system/SysConfigController.java index e27e99e3..b2bde5e1 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysConfigController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysConfigController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SysDepartmentController.java b/api/src/main/java/com/wansensoft/api/system/SysDepartmentController.java deleted file mode 100644 index 148b3eb0..00000000 --- a/api/src/main/java/com/wansensoft/api/system/SysDepartmentController.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.api.system; - -import com.wansensoft.dto.organization.DeptListDTO; -import com.wansensoft.service.system.ISysDepartmentService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.DeptListVO; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - *

- * 机构表 前端控制器 - *

- */ -@RestController -@RequestMapping("/dept") -public class SysDepartmentController { - - private final ISysDepartmentService departmentService; - - public SysDepartmentController(ISysDepartmentService departmentService) { - this.departmentService = departmentService; - } - - @GetMapping("list") - public Response list(@RequestBody DeptListDTO deptListDto) { - return departmentService.deptList(deptListDto); - } - - @GetMapping("userDeptRel") - public Response> getUserDeptRel() { - return departmentService.getUserDeptRel(); - } -} diff --git a/api/src/main/java/com/wansensoft/api/system/SysLogController.java b/api/src/main/java/com/wansensoft/api/system/SysLogController.java index 45a78403..410facea 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysLogController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysLogController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SysMenuController.java b/api/src/main/java/com/wansensoft/api/system/SysMenuController.java index a2240748..c6112779 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysMenuController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysMenuController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SysMsgController.java b/api/src/main/java/com/wansensoft/api/system/SysMsgController.java index cfb1367e..88d055c7 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysMsgController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysMsgController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java b/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java new file mode 100644 index 00000000..c4b7c9b8 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 机构表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-organization") +public class SysOrganizationController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java b/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java index 7648fbf4..681508ce 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java b/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java index 1a30dcd7..ee2ea359 100644 --- a/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java +++ b/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.system; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/system/SystemConfigController.java b/api/src/main/java/com/wansensoft/api/system/SystemConfigController.java new file mode 100644 index 00000000..29001b79 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SystemConfigController.java @@ -0,0 +1,267 @@ +package com.wansensoft.api.system; + +import com.wansensoft.entities.system.SystemConfig; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.StringUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.AntPathMatcher; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.HandlerMapping; + +import javax.imageio.ImageIO; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.List; + +@RestController +@RequestMapping(value = "/systemConfig") +@Api(tags = {"系统参数"}) +public class SystemConfigController { + private Logger logger = LoggerFactory.getLogger(SystemConfigController.class); + + private final SystemConfigService systemConfigService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + @Value(value="${file.path}") + private String filePath; + + @Value(value="10485760") + private Long maxFileSize; + + @Value(value="10485760") + private Long maxRequestSize; + + public SystemConfigController(SystemConfigService systemConfigService) { + this.systemConfigService = systemConfigService; + } + + /** + * 获取当前租户的配置信息 + * @param request + * @return + */ + @GetMapping(value = "/getCurrentInfo") + @ApiOperation(value = "获取当前租户的配置信息") + public BaseResponseInfo getCurrentInfo(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try{ + List list = systemConfigService.getSystemConfig(); + res.code = 200; + if(!list.isEmpty()) { + res.data = list.get(0); + } + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 获取文件大小限制 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/fileSizeLimit") + @ApiOperation(value = "获取文件大小限制") + public BaseResponseInfo fileSizeLimit(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try{ + long limit = 0L; + if(maxFileSize UTF-8 进行编码转换 + String imgPath = extractPathFromPattern(request); + if(StringUtil.isEmpty(imgPath) || imgPath=="null"){ + return; + } + // 其余处理略 + InputStream inputStream = null; + OutputStream outputStream = null; + try { + imgPath = imgPath.replace("..", ""); + if (imgPath.endsWith(",")) { + imgPath = imgPath.substring(0, imgPath.length() - 1); + } + String fileUrl = ""; + if(fileUploadType == 1) { + fileUrl = systemConfigService.getFileUrlLocal(imgPath); + inputStream = new BufferedInputStream(new FileInputStream(fileUrl)); + } else if(fileUploadType == 2) { + fileUrl = systemConfigService.getFileUrlAliOss(imgPath); + URL url = new URL(fileUrl); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5 * 1000); + inputStream = conn.getInputStream();// 通过输入流获取图片数据 + } + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + logger.error("预览文件失败" + e.getMessage()); + response.setStatus(404); + } catch (Exception e) { + response.setStatus(404); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + } + } + + /** + * 预览缩略图&下载文件 + * @param request + * @param response + */ + @GetMapping(value = "/static/mini/**") + @ApiOperation(value = "预览缩略图&下载文件") + public void viewMini(HttpServletRequest request, HttpServletResponse response) { + // ISO-8859-1 ==> UTF-8 进行编码转换 + String imgPath = extractPathFromPattern(request); + if(StringUtil.isEmpty(imgPath) || imgPath=="null"){ + return; + } + InputStream inputStream = null; + OutputStream outputStream = null; + try { + imgPath = imgPath.replace("..", ""); + if (imgPath.endsWith(",")) { + imgPath = imgPath.substring(0, imgPath.length() - 1); + } + String fileUrl = ""; + if(fileUploadType == 1) { + fileUrl = systemConfigService.getFileUrlLocal(imgPath); + inputStream = new BufferedInputStream(new FileInputStream(fileUrl)); + } else if(fileUploadType == 2) { + fileUrl = systemConfigService.getFileUrlAliOss(imgPath); + URL url = new URL(fileUrl); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5 * 1000); + inputStream = conn.getInputStream();// 通过输入流获取图片数据 + } + int index = fileUrl.lastIndexOf("."); + String ext = fileUrl.substring(index + 1); + BufferedImage image = systemConfigService.getImageMini(inputStream, 80); + outputStream = response.getOutputStream(); + ImageIO.write(image, ext, outputStream); + response.flushBuffer(); + } catch (Exception e) { + response.setStatus(404); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + } + } + + /** + * 把指定URL后的字符串全部截断当成参数 + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * @param request + * @return + */ + private static String extractPathFromPattern(final HttpServletRequest request) { + String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); + String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); + return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); + } +} diff --git a/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java b/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java index da9a86ef..7ebafe9b 100644 --- a/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java +++ b/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.tenant; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/tenant/TenantController.java b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java new file mode 100644 index 00000000..1c7ee3b2 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java @@ -0,0 +1,45 @@ +package com.wansensoft.api.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.tenant.TenantService; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping(value = "/tenant") +@Api(tags = {"租户管理"}) +public class TenantController { + private final TenantService tenantService; + + public TenantController(TenantService tenantService) { + this.tenantService = tenantService; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = tenantService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/unit/UnitController.java b/api/src/main/java/com/wansensoft/api/unit/UnitController.java new file mode 100644 index 00000000..af0a04a0 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/unit/UnitController.java @@ -0,0 +1,71 @@ +package com.wansensoft.api.unit; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.service.unit.UnitService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/unit") +@Api(tags = {"单位管理"}) +public class UnitController { + + private final UnitService unitService; + + public UnitController(UnitService unitService) { + this.unitService = unitService; + } + + /** + * 单位列表 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "单位列表") + public BaseResponseInfo getAllList(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List unitList = unitService.getUnit(); + res.code = 200; + res.data = unitList; + } catch(Exception e){ + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Boolean status = jsonObject.getBoolean("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = unitService.batchSetStatus(status, ids); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } +} diff --git a/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java b/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java index e3d25d6d..bfd60bd6 100644 --- a/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java +++ b/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.user; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/user/SysUserController.java b/api/src/main/java/com/wansensoft/api/user/SysUserController.java index 8c4fb41f..ea0be66d 100644 --- a/api/src/main/java/com/wansensoft/api/user/SysUserController.java +++ b/api/src/main/java/com/wansensoft/api/user/SysUserController.java @@ -1,28 +1,9 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.user; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.user.*; -import com.wansensoft.service.user.ISysUserService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.UserInfoVO; -import com.wansensoft.vo.UserListVO; -import com.wansensoft.vo.UserRoleVO; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMapping; -import java.util.List; +import org.springframework.web.bind.annotation.RestController; /** *

@@ -33,72 +14,7 @@ * @since 2023-09-05 */ @RestController -@RequestMapping("/user") +@RequestMapping("/sysUser") public class SysUserController { - private final ISysUserService userService; - - public SysUserController(ISysUserService userService) { - this.userService = userService; - } - - @PostMapping("register") - public Response accountRegister(@RequestBody AccountRegisterDTO accountRegisterDto) { - return userService.accountRegister(accountRegisterDto); - } - - @PostMapping(value = "login") - public Response accountLogin(@RequestBody AccountLoginDTO accountLoginDto) { - return userService.accountLogin(accountLoginDto); - } - - @PostMapping(value = "mobileLogin") - public Response accountLogin(@RequestBody MobileLoginDTO mobileLoginDto) { - return userService.mobileLogin(mobileLoginDto); - } - - @PostMapping(value = "updatePassword") - public Response updatePassword(@RequestBody UpdatePasswordDto updatePasswordDto) { - return userService.updatePassword(updatePasswordDto); - } - - @GetMapping(value = "info") - public Response info() { - return userService.userInfo(); - } - - @GetMapping(value = "perm") - public Response> permission() { - return userService.userRole(); - } - - @GetMapping(value = "logout") - public Response logout() { - return userService.userLogout(); - } - - @PostMapping(value = "list") - public Response> list(@RequestBody UserListDTO userListDto) { - return userService.userList(userListDto); - } - - @PostMapping(value = "update") - public Response update(@RequestBody UpdateUserDTO updateUserDTO) { - return userService.updateUser(updateUserDTO); - } - - @PostMapping(value = "addOrUpdate") - public Response addOrUpdate(@RequestBody AddOrUpdateUserDTO addOrUpdateUserDTO) { - return userService.addOrUpdate(addOrUpdateUserDTO); - } - - @PostMapping(value = "delete") - public Response deleteUser(@RequestParam(value = "ids") List ids) { - return userService.deleteUser(ids); - } - - @PostMapping(value = "resetPassword") - public Response resetPassword(@RequestParam(value = "id") Long id) { - return userService.resetPassword(id); - } } diff --git a/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java new file mode 100644 index 00000000..49505521 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java @@ -0,0 +1,109 @@ +package com.wansensoft.api.user; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/userBusiness") +@Api(tags = {"用户角色模块的关系"}) +public class UserBusinessController { + + private final UserBusinessService userBusinessService; + + public UserBusinessController(UserBusinessService userBusinessService, UserService userService) { + this.userBusinessService = userBusinessService; + } + + /** + * 获取信息 + * @param keyId + * @param type + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getBasicData") + @ApiOperation(value = "获取信息") + public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId, + @RequestParam(value = "Type") String type, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List list = userBusinessService.getBasicData(keyId, type); + Map mapData = new HashMap(); + mapData.put("userBusinessList", list); + res.code = 200; + res.data = mapData; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "查询权限失败"; + } + return res; + } + + /** + * 校验存在 + * @param type + * @param keyId + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/checkIsValueExist") + @ApiOperation(value = "校验存在") + public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, + @RequestParam(value ="keyId", required = false) String keyId, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); + Long id = userBusinessService.checkIsValueExist(type, keyId); + if(id != null) { + objectMap.put("id", id); + } else { + objectMap.put("id", null); + } + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } + + /** + * 更新角色的按钮权限 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/updateBtnStr") + @ApiOperation(value = "更新角色的按钮权限") + public BaseResponseInfo updateBtnStr(@RequestBody JSONObject jsonObject, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String roleId = jsonObject.getString("roleId"); + String btnStr = jsonObject.getString("btnStr"); + String keyId = roleId; + String type = "RoleFunctions"; + int back = userBusinessService.updateBtnStr(keyId, type, btnStr); + if(back > 0) { + res.code = 200; + res.data = "成功"; + } + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "更新权限失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/user/UserController.java b/api/src/main/java/com/wansensoft/api/user/UserController.java new file mode 100644 index 00000000..fa96b706 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/user/UserController.java @@ -0,0 +1,444 @@ +package com.wansensoft.api.user; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserEx; +import com.wansensoft.service.role.RoleService; +import com.wansensoft.service.tenant.TenantService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessParamCheckingException; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.utils.*; +import com.wansensoft.vo.TreeNodeEx; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.util.*; + +@RestController +@RequestMapping(value = "/user") +@Api(tags = {"用户管理"}) +public class UserController { + private Logger logger = LoggerFactory.getLogger(UserController.class); + + @Value("${manage.roleId}") + private Integer manageRoleId; + + private final UserService userService; + + private final RoleService roleService; + + private final TenantService tenantService; + + private final RedisService redisService; + + private static String SUCCESS = "操作成功"; + private static String ERROR = "操作失败"; + + public UserController(UserService userService, RoleService roleService, TenantService tenantService, RedisService redisService) { + this.userService = userService; + this.roleService = roleService; + this.tenantService = tenantService; + this.redisService = redisService; + } + + + @PostMapping(value = "/login") + @ApiOperation(value = "登录") + public BaseResponseInfo login(@RequestBody User userParam, + HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = userService.login(userParam, request); + res.code = 200; + res.data = data; + } catch(Exception e){ + logger.error(e.getMessage()); + res.code = 500; + res.data = "用户登录失败"; + } + return res; + } + + @PostMapping(value = "/weixinLogin") + @ApiOperation(value = "微信登录") + public BaseResponseInfo weixinLogin(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + String weixinCode = jsonObject.getString("weixinCode"); + User user = userService.getUserByWeixinCode(weixinCode); + if(user == null) { + res.code = 501; + res.data = "微信未绑定"; + } else { + Map data = userService.login(user, request); + res.code = 200; + res.data = data; + } + } catch(Exception e){ + logger.error(e.getMessage()); + res.code = 500; + res.data = "用户登录失败"; + } + return res; + } + + @PostMapping(value = "/weixinBind") + @ApiOperation(value = "绑定微信") + public String weixinBind(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); + String loginName = jsonObject.getString("loginName"); + String password = jsonObject.getString("password"); + String weixinCode = jsonObject.getString("weixinCode"); + int res = userService.weixinBind(loginName, password, weixinCode); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + @GetMapping(value = "/getUserSession") + @ApiOperation(value = "获取用户信息") + public BaseResponseInfo getSessionUser(HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + user.setPassword(null); + data.put("user", user); + res.code = 200; + res.data = data; + } catch(Exception e){ + res.code = 500; + res.data = "获取session失败"; + } + return res; + } + + @GetMapping(value = "/logout") + @ApiOperation(value = "退出") + public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse response)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + redisService.deleteObjectBySession(request,"userId"); + redisService.deleteObjectBySession(request,"roleType"); + redisService.deleteObjectBySession(request,"clientIp"); + } catch(Exception e){ + res.code = 500; + res.data = "退出失败"; + } + return res; + } + + @PostMapping(value = "/resetPwd") + @ApiOperation(value = "重置密码") + public String resetPwd(@RequestBody JSONObject jsonObject, + HttpServletRequest request) throws Exception { + Map objectMap = new HashMap<>(); + Long id = jsonObject.getLong("id"); + String password = "123456"; + String md5Pwd = Tools.md5Encryp(password); + int update = userService.resetPwd(md5Pwd, id); + if(update > 0) { + return ResponseJsonUtil.returnJson(objectMap, SUCCESS, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } + + @PutMapping(value = "/updatePwd") + @ApiOperation(value = "更新密码") + public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { + Integer flag = 0; + Map objectMap = new HashMap(); + try { + String info = ""; + Long userId = jsonObject.getLong("userId"); + String oldpwd = jsonObject.getString("oldpassword"); + String password = jsonObject.getString("password"); + User user = userService.getUser(userId); + //必须和原始密码一致才可以更新密码 + if (oldpwd.equalsIgnoreCase(user.getPassword())) { + user.setPassword(password); + flag = userService.updateUserByObj(user); //1-成功 + info = "修改成功"; + } else { + flag = 2; //原始密码输入错误 + info = "原始密码输入错误"; + } + objectMap.put("status", flag); + if(flag > 0) { + return ResponseJsonUtil.returnJson(objectMap, info, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } catch (Exception e) { + logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e); + flag = 3; + objectMap.put("status", flag); + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + } + } + + /** + * 获取全部用户数据列表 + * @param request + * @return + */ + @GetMapping(value = "/getAllList") + @ApiOperation(value = "获取全部用户数据列表") + public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap(); + List dataList = userService.getUser(); + if(dataList!=null) { + data.put("userList", dataList); + } + res.code = 200; + res.data = data; + } catch(Exception e){ + res.code = 500; + res.data = "获取失败"; + } + return res; + } + + /** + * 用户列表,用于用户下拉框 + * @param request + * @return + * @throws Exception + */ + @GetMapping(value = "/getUserList") + @ApiOperation(value = "用户列表") + public JSONArray getUserList(HttpServletRequest request)throws Exception { + JSONArray dataArray = new JSONArray(); + try { + List dataList = userService.getUser(); + if (null != dataList) { + for (User user : dataList) { + JSONObject item = new JSONObject(); + item.put("id", user.getId()); + item.put("userName", user.getUsername()); + dataArray.add(item); + } + } + } catch(Exception e){ + e.printStackTrace(); + } + return dataArray; + } + + /** + * description: + * 新增用户及机构和用户关系 + * @Param: beanJson + * @return java.lang.Object + */ + @PostMapping("/addUser") + @ApiOperation(value = "新增用户") + @ResponseBody + public Object addUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + User userInfo = userService.getCurrentUser(); + Tenant tenant = tenantService.getTenantByTenantId(userInfo.getTenantId()); + Long count = userService.countUser(null,null); + if(tenant!=null) { + if(count>= tenant.getUserNumLimit()) { + throw new BusinessParamCheckingException(ExceptionConstants.USER_OVER_LIMIT_FAILED_CODE, + ExceptionConstants.USER_OVER_LIMIT_FAILED_MSG); + } else { + UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); + userService.addUserAndOrgUserRel(ue, request); + } + } + return result; + } + + /** + * description: + * 修改用户及机构和用户关系 + * @Param: beanJson + * @return java.lang.Object + */ + @PutMapping("/updateUser") + @ApiOperation(value = "修改用户") + @ResponseBody + public Object updateUser(@RequestBody JSONObject obj, HttpServletRequest request)throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + UserEx ue= JSONObject.parseObject(obj.toJSONString(), UserEx.class); + userService.updateUserAndOrgUserRel(ue, request); + return result; + } + + /** + * 注册用户 + * @param ue + * @return + * @throws Exception + */ + @PostMapping(value = "/registerUser") + @ApiOperation(value = "注册用户") + public Object registerUser(@RequestBody UserEx ue, + HttpServletRequest request)throws Exception{ + JSONObject result = ExceptionConstants.standardSuccess(); + ue.setUsername(ue.getLoginName()); + userService.checkLoginName(ue); //检查登录名 + ue = userService.registerUser(ue,manageRoleId,request); + return result; + } + + /** + * 获取机构用户树 + * @return + * @throws Exception + */ + @RequestMapping("/getOrganizationUserTree") + @ApiOperation(value = "获取机构用户树") + public JSONArray getOrganizationUserTree()throws Exception{ + JSONArray arr=new JSONArray(); + List organizationUserTree= userService.getOrganizationUserTree(); + if(organizationUserTree!=null&&organizationUserTree.size()>0){ + for(TreeNodeEx node:organizationUserTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + + @GetMapping(value = "/getCurrentPriceLimit") + @ApiOperation(value = "查询当前用户的价格屏蔽") + public BaseResponseInfo getCurrentPriceLimit(HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + String priceLimit = roleService.getCurrentPriceLimit(request); + data.put("priceLimit", priceLimit); + res.code = 200; + res.data = data; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取session失败"; + } + return res; + } + + /** + * 获取当前用户的角色类型 + * @param request + * @return + */ + @GetMapping("/getRoleTypeByCurrentUser") + @ApiOperation(value = "获取当前用户的角色类型") + public BaseResponseInfo getRoleTypeByCurrentUser(HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap(); + String roleType = redisService.getObjectFromSessionByKey(request,"roleType").toString(); + data.put("roleType", roleType); + res.code = 200; + res.data = data; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取失败"; + } + return res; + } + + /** + * 获取随机校验码 + * @param response + * @param key + * @return + */ + @GetMapping(value = "/randomImage/{key}") + @ApiOperation(value = "获取随机校验码") + public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable String key){ + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + String codeNum = Tools.getCharAndNum(4); + String base64 = RandImageUtil.generate(codeNum); + data.put("codeNum", codeNum); + data.put("base64", base64); + res.code = 200; + res.data = data; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取失败"; + } + return res; + } + + /** + * 批量设置状态-启用或者禁用 + * @param jsonObject + * @param request + * @return + */ + @PostMapping(value = "/batchSetStatus") + @ApiOperation(value = "批量设置状态") + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Byte status = jsonObject.getByte("status"); + String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); + int res = userService.batchSetStatus(status, ids, request); + if(res > 0) { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + } else { + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + } + } + + /** + * 获取当前用户的用户数量和租户信息 + * @param request + * @return + */ + @GetMapping(value = "/infoWithTenant") + @ApiOperation(value = "获取当前用户的用户数量和租户信息") + public BaseResponseInfo randomImage(HttpServletRequest request){ + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + //获取当前用户数 + int userCurrentNum = userService.getUser().size(); + Tenant tenant = tenantService.getTenantByTenantId(user.getTenantId()); + data.put("type", tenant.getType()); //租户类型,0免费租户,1付费租户 + data.put("expireTime", Tools.parseDateToStr(tenant.getExpireTime())); + data.put("userCurrentNum", userCurrentNum); + data.put("userNumLimit", tenant.getUserNumLimit()); + data.put("tenantId", tenant.getTenantId()); + res.code = 200; + res.data = data; + } catch (Exception e) { + e.printStackTrace(); + res.code = 500; + res.data = "获取失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java index de5ce855..afeddc02 100644 --- a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.warehouse; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java index b1cafe8c..d5607a5a 100644 --- a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.warehouse; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java index 86105de1..2daeb025 100644 --- a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java @@ -1,17 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.api.warehouse; + import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/api/src/main/resources/application-dev.yml b/api/src/main/resources/application-dev.yml index be404276..428471f7 100644 --- a/api/src/main/resources/application-dev.yml +++ b/api/src/main/resources/application-dev.yml @@ -1,6 +1,6 @@ spring: datasource: - url: jdbc:mysql://localhost:3306/wansenerp2?useUnicode=true&characterEncoding=utf-8&useSSL=false + url: jdbc:mysql://localhost:3306/wansenerp?useUnicode=true&characterEncoding=utf-8&useSSL=false username: root password: PaSsw0Rd dynamic: diff --git a/api/src/main/resources/application.yml b/api/src/main/resources/application.yml index 91d848b8..d1893333 100644 --- a/api/src/main/resources/application.yml +++ b/api/src/main/resources/application.yml @@ -1,7 +1,9 @@ server: port: 9999 servlet: - context-path: /erp-api + context-path: /wansenerp-api + tomcat: + basedir: /opt/tmp/tomcat spring: profiles: @@ -32,5 +34,5 @@ mybatis-plus: #刷新mapper 调试神器 refresh-mapper: true configuration: - # log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file + log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl + # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file diff --git a/api/src/main/resources/logback-spring.xml b/api/src/main/resources/logback-spring.xml index 72371cd4..0ec7f48a 100644 --- a/api/src/main/resources/logback-spring.xml +++ b/api/src/main/resources/logback-spring.xml @@ -1,171 +1,34 @@ - - - - - - + + + - - - logback - - - - - - - - - - - - - - - - debug - - ${CONSOLE_LOG_PATTERN} - - UTF-8 + ${LOG_PATTERN} - - - - - - - ${log.path}/log_debug.log - + + ${LOG_FILE}.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - UTF-8 + ${LOG_PATTERN} - - - ${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log + ${LOG_FILE}.%d{yyyy-MM-dd}.%i.log + 10 + 1GB 100MB - - 15 - - - debug - ACCEPT - DENY - - - - - ${log.path}/log_info.log - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - UTF-8 - - - - - ${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log - - 100MB - - - 15 - - - - info - ACCEPT - DENY - - - - - - - ${log.path}/log_warn.log - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - UTF-8 - - - - ${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log - - 100MB - - - 15 - - - - warn - ACCEPT - DENY - - - - - - - - ${log.path}/log_error.log - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - UTF-8 - - - - ${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log - - 100MB - - - 15 - - - - ERROR - ACCEPT - DENY - - - - - - - - + - - - - + - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/api/src/main/resources/testMenu.json b/api/src/main/resources/testMenu.json deleted file mode 100644 index e7f9c781..00000000 --- a/api/src/main/resources/testMenu.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "code": 0, - "msg": "成功", - "data": { - "total": 1, - "data": [ - { - "path": "/dashboard", - "name": "Dashboard", - "component": "/dashboard/workbench/index", - "id": 1, - "menuType": 1, - "sort": 0, - "redirect": "", - "meta": { - "title": "首页", - "icon": "ant-design:home-outlined", - "hideMenu": false, - "hideBreadcrumb": false, - "ignoreKeepAlive": false, - "hideTab": false, - "frameSrc": "", - "carryParam": false, - "hideChildrenInMenu": false, - "affix": false, - "dynamicLevel": 20, - "realPath": "" - } - }, - { - "path": "/fms/file", - "name": "FileManagement", - "component": "/fms/file/index", - "id": 2, - "menuType": 1, - "sort": 1, - "redirect": "", - "meta": { - "title": "零售管理", - "icon": "ant-design:folder-open-outlined", - "hideMenu": false, - "hideBreadcrumb": false, - "ignoreKeepAlive": false, - "hideTab": false, - "frameSrc": "", - "carryParam": false, - "hideChildrenInMenu": false, - "affix": false, - "dynamicLevel": 20, - "realPath": "" - } - } - ] - } -} \ No newline at end of file diff --git a/api/src/main/resources/user.json b/api/src/main/resources/user.json deleted file mode 100644 index c3c67ea5..00000000 --- a/api/src/main/resources/user.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "code": "00000", - "data": { - "data": [ - { - "id": "1151247731927683073", - "username": "xiaoyang", - "name": "万森小杨", - "roleName": "", - "email": "7777777@qq.com", - "phoneNumber": "", - "status": 0, - "createTime": "2023-09-14T22:00:30" - }, - { - "id": "1151247731927683077", - "username": "admin", - "name": "管理员", - "roleName": "", - "email": "jameszow@wansen.email", - "phoneNumber": "1111", - "status": 0, - "createTime": "2023-09-14T22:00:28" - }, - { - "id": "1151247731927683082", - "username": "test", - "name": "测试用户", - "roleName": "", - "email": "666666@qq.com", - "phoneNumber": "", - "status": 0, - "createTime": "2023-09-14T22:00:32" - }, - { - "id": "1153648835588132865", - "username": "test8", - "name": "测试租户8", - "roleName": "", - "email": "testyu@wansenai.com", - "phoneNumber": "17015963215", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132870", - "username": "test77", - "name": "测试租户7", - "roleName": "", - "email": "htomassl@qq.com", - "phoneNumber": "13379815236", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132879", - "username": "test9", - "name": "测试租户9", - "roleName": "", - "email": "yuxiuaa@tecia.com", - "phoneNumber": "18015156235", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132893", - "username": "rtes55", - "name": "测试租户5", - "roleName": "", - "email": "biosss@126.com", - "phoneNumber": "15618529781", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132895", - "username": "test44", - "name": "测试租户4", - "roleName": "", - "email": "ciarsit@163.com", - "phoneNumber": "15015151623", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132897", - "username": "test33", - "name": "测试租户3", - "roleName": "", - "email": "cestuis@163.com", - "phoneNumber": "17816152316", - "status": 0, - "createTime": "null" - }, - { - "id": "1153648835588132900", - "username": "test22", - "name": "测试租户2", - "roleName": "", - "email": "hjunweiu@163.com", - "phoneNumber": "17715151623", - "status": 0, - "createTime": "null" - } - ], - "total": 11, - "size": 10, - "current": 1, - "orders": [], - "optimizeCountSql": true, - "searchCount": true, - "maxLimit": null, - "countId": null, - "pages": 2 - } -} \ No newline at end of file diff --git a/dao/pom.xml b/dao/pom.xml index 6d7ca0e6..7d5c5f6d 100644 --- a/dao/pom.xml +++ b/dao/pom.xml @@ -5,15 +5,15 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT dao - 21 - 21 + 17 + 17 UTF-8 diff --git a/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java b/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java index 620f660f..15555e02 100644 --- a/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers; import com.wansensoft.entities.IncomeExpense; @@ -19,6 +7,9 @@ *

* 收支项目 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IncomeExpenseMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java b/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java index c9ace2b7..f7ed32fd 100644 --- a/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers; import com.wansensoft.entities.Operator; @@ -19,6 +7,9 @@ *

* 经手人表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface OperatorMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java b/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java index b9dc5337..d71976b5 100644 --- a/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers; -import com.wansensoft.entities.system.SystemSupplier; +import com.wansensoft.entities.SystemSupplier; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 供应商/客户信息表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SystemSupplierMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapper.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapper.java new file mode 100644 index 00000000..af399d28 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapper.java @@ -0,0 +1,34 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.account.AccountHeadExample; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface AccountHeadMapper extends BaseMapper { + long countByExample(AccountHeadExample example); + + int deleteByExample(AccountHeadExample example); + + int deleteByPrimaryKey(Long id); + + int insertAccountHead(AccountHead record); + + int insertSelective(AccountHead record); + + List selectByExample(AccountHeadExample example); + + AccountHead selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") AccountHead record, @Param("example") AccountHeadExample example); + + int updateByExample(@Param("record") AccountHead record, @Param("example") AccountHeadExample example); + + int updateByPrimaryKeySelective(AccountHead record); + + int updateByPrimaryKey(AccountHead record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapperEx.java new file mode 100644 index 00000000..033c21c9 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountHeadMapperEx.java @@ -0,0 +1,62 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.account.AccountHeadVo4ListEx; +import com.wansensoft.entities.account.AccountItem; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface AccountHeadMapperEx extends BaseMapper { + + List selectByConditionAccountHead( + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("billNo") String billNo, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("handsPersonId") Long handsPersonId, + @Param("accountId") Long accountId, + @Param("status") String status, + @Param("remark") String remark, + @Param("number") String number, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccountHead( + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("billNo") String billNo, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Long organId, + @Param("creator") Long creator, + @Param("handsPersonId") Long handsPersonId, + @Param("accountId") Long accountId, + @Param("status") String status, + @Param("remark") String remark, + @Param("number") String number); + + List getDetailByNumber( + @Param("billNo") String billNo); + + int batchDeleteAccountHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + List getAccountHeadListByAccountIds(@Param("accountIds") String[] accountIds); + + List getAccountHeadListByOrganIds(@Param("organIds") String[] organIds); + + List getAccountHeadListByHandsPersonIds(@Param("handsPersonIds") String[] handsPersonIds); + + List getFinancialBillNoByBillIdList( + @Param("idList") List idList); + + List getFinancialBillNoByBillId( + @Param("billId") Long billId); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapper.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapper.java new file mode 100644 index 00000000..dbae5432 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapper.java @@ -0,0 +1,34 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.account.AccountItemExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface AccountItemMapper extends BaseMapper { + long countByExample(AccountItemExample example); + + int deleteByExample(AccountItemExample example); + + int deleteByPrimaryKey(Long id); + + int insertAccountItem(AccountItem record); + + int insertSelective(AccountItem record); + + List selectByExample(AccountItemExample example); + + AccountItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") AccountItem record, @Param("example") AccountItemExample example); + + int updateByExample(@Param("record") AccountItem record, @Param("example") AccountItemExample example); + + int updateByPrimaryKeySelective(AccountItem record); + + int updateByPrimaryKey(AccountItem record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapperEx.java new file mode 100644 index 00000000..451a3e01 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountItemMapperEx.java @@ -0,0 +1,44 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.vo.AccountItemVo4List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Mapper +public interface AccountItemMapperEx extends BaseMapper { + + List selectByConditionAccountItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccountItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + List getDetailList( + @Param("headerId") Long headerId); + + int batchDeleteAccountItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + List getAccountItemListByAccountIds(@Param("accountIds") String[] accountIds); + + List getAccountItemListByHeaderIds(@Param("headerIds") String[] headerIds); + + List getAccountItemListByInOutItemIds(@Param("inOutItemIds") String[] inOutItemIds); + + int batchDeleteAccountItemByHeadIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String[] ids); + + BigDecimal getEachAmountByBillId(@Param("billId") Long billId); + + BigDecimal getFinishDebtByOrganId(@Param("organId") Long organId); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountMapper.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountMapper.java new file mode 100644 index 00000000..bd14f412 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountMapper.java @@ -0,0 +1,34 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.Account; +import com.wansensoft.entities.account.AccountExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface AccountMapper extends BaseMapper { + long countByExample(AccountExample example); + + int deleteByExample(AccountExample example); + + int deleteByPrimaryKey(Long id); + + int insertAccount(Account record); + + int insertSelective(Account record); + + List selectByExample(AccountExample example); + + Account selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Account record, @Param("example") AccountExample example); + + int updateByExample(@Param("record") Account record, @Param("example") AccountExample example); + + int updateByPrimaryKeySelective(Account record); + + int updateByPrimaryKey(Account record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/account/AccountMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/account/AccountMapperEx.java new file mode 100644 index 00000000..f77527db --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/account/AccountMapperEx.java @@ -0,0 +1,42 @@ +package com.wansensoft.mappers.account; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.account.Account; +import com.wansensoft.vo.AccountVo4InOutList; +import com.wansensoft.vo.AccountVo4List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface AccountMapperEx extends BaseMapper { + + List getAccountByParam( + @Param("name") String name, + @Param("serialNo") String serialNo); + + List selectByConditionAccount( + @Param("name") String name, + @Param("serialNo") String serialNo, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByAccount( + @Param("name") String name, + @Param("serialNo") String serialNo, + @Param("remark") String remark); + + List findAccountInOutList( + @Param("accountId") Long accountId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findAccountInOutListCount( + @Param("accountId") Long accountId); + + int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapper.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapper.java new file mode 100644 index 00000000..f5116cbb --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.depot.DepotHeadExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface DepotHeadMapper extends BaseMapper { + long countByExample(DepotHeadExample example); + + int deleteByExample(DepotHeadExample example); + + int deleteByPrimaryKey(Long id); + + int insertDepotHead(DepotHead record); + + int insertSelective(DepotHead record); + + List selectByExample(DepotHeadExample example); + + DepotHead selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example); + + int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example); + + int updateByPrimaryKeySelective(DepotHead record); + + int updateByPrimaryKey(DepotHead record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapperEx.java new file mode 100644 index 00000000..aa8e8e0f --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotHeadMapperEx.java @@ -0,0 +1,249 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.vo.DepotHeadVo4List; +import com.wansensoft.vo.MaterialCountVo; +import com.wansensoft.vo.MaterialsListVo; +import com.wansensoft.vo.DepotHeadVo4InDetail; +import com.wansensoft.vo.DepotHeadVo4InOutMCount; +import com.wansensoft.vo.DepotHeadVo4StatementAccount; +import com.wansensoft.vo.FinishDepositVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Mapper +public interface DepotHeadMapperEx extends BaseMapper { + List selectByConditionDepotHead( + @Param("type") String type, + @Param("subType") String subType, + @Param("creatorArray") String[] creatorArray, + @Param("hasDebt") String hasDebt, + @Param("statusArray") String[] statusArray, + @Param("purchaseStatusArray") String[] purchaseStatusArray, + @Param("number") String number, + @Param("linkNumber") String linkNumber, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("organId") Long organId, + @Param("organArray") String[] organArray, + @Param("creator") Long creator, + @Param("depotId") Long depotId, + @Param("depotArray") String[] depotArray, + @Param("accountId") Long accountId, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByDepotHead( + @Param("type") String type, + @Param("subType") String subType, + @Param("creatorArray") String[] creatorArray, + @Param("hasDebt") String hasDebt, + @Param("statusArray") String[] statusArray, + @Param("purchaseStatusArray") String[] purchaseStatusArray, + @Param("number") String number, + @Param("linkNumber") String linkNumber, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("organId") Long organId, + @Param("organArray") String[] organArray, + @Param("creator") Long creator, + @Param("depotId") Long depotId, + @Param("depotArray") String[] depotArray, + @Param("accountId") Long accountId, + @Param("remark") String remark); + + List findMaterialsListMapByHeaderIdList( + @Param("idList") List idList); + + List getMaterialCountListByHeaderIdList( + @Param("idList") List idList); + + List findInOutDetail( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("organArray") String[] organArray, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("number") String number, + @Param("creator") Long creator, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findInOutDetailCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("creatorArray") String[] creatorArray, + @Param("organArray") String[] organArray, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("number") String number, + @Param("creator") Long creator, + @Param("remark") String remark); + + List findInOutMaterialCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("creatorArray") String[] creatorArray, + @Param("organArray") String[] organArray, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findInOutMaterialCountTotal( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("type") String type, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("oId") Integer oId, + @Param("creatorArray") String[] creatorArray, + @Param("organArray") String[] organArray); + + List findAllocationDetail( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("subType") String subType, + @Param("number") String number, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("depotFList") List depotFList, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findAllocationDetailCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("subType") String subType, + @Param("number") String number, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList, + @Param("depotFList") List depotFList, + @Param("remark") String remark); + + List getStatementAccount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Integer organId, + @Param("organArray") String[] organArray, + @Param("supplierType") String supplierType, + @Param("type") String type, + @Param("subType") String subType, + @Param("typeBack") String typeBack, + @Param("subTypeBack") String subTypeBack, + @Param("billType") String billType, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int getStatementAccountCount( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Integer organId, + @Param("organArray") String[] organArray, + @Param("supplierType") String supplierType, + @Param("type") String type, + @Param("subType") String subType, + @Param("typeBack") String typeBack, + @Param("subTypeBack") String subTypeBack, + @Param("billType") String billType); + + List getStatementAccountTotalPay( + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("organId") Integer organId, + @Param("organArray") String[] organArray, + @Param("supplierType") String supplierType, + @Param("type") String type, + @Param("subType") String subType, + @Param("typeBack") String typeBack, + @Param("subTypeBack") String subTypeBack, + @Param("billType") String billType); + + List getDetailByNumber( + @Param("number") String number); + + int batchDeleteDepotHeadByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getDepotHeadListByAccountIds(@Param("accountIds") String[] accountIds); + + List getDepotHeadListByOrganIds(@Param("organIds") String[] organIds); + + List getDepotHeadListByCreator(@Param("creatorArray") String[] creatorArray); + + BigDecimal getBuyAndSaleBasicStatistics( + @Param("type") String type, + @Param("subType") String subType, + @Param("hasSupplier") Integer hasSupplier, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag); + + BigDecimal getBuyAndSaleRetailStatistics( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag); + + List debtList( + @Param("organId") Long organId, + @Param("creatorArray") String[] creatorArray, + @Param("status") String status, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("depotArray") String[] depotArray, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int debtListCount( + @Param("organId") Long organId, + @Param("creatorArray") String[] creatorArray, + @Param("status") String status, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("materialParam") String materialParam, + @Param("depotArray") String[] depotArray); + + List getFinishDepositByNumberList( + @Param("numberList") List numberList); + + BigDecimal getFinishDepositByNumberExceptCurrent( + @Param("linkNumber") String linkNumber, + @Param("number") String number); + + void setAccountIdToNull( + @Param("id") Long id); + + int getSerialNumberBySell( + @Param("number") String number); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapper.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapper.java new file mode 100644 index 00000000..a28e8a48 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.depot.DepotItemExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface DepotItemMapper extends BaseMapper { + long countByExample(DepotItemExample example); + + int deleteByExample(DepotItemExample example); + + int deleteByPrimaryKey(Long id); + + int insertDepotItem(DepotItem record); + + int insertSelective(DepotItem record); + + List selectByExample(DepotItemExample example); + + DepotItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") DepotItem record, @Param("example") DepotItemExample example); + + int updateByExample(@Param("record") DepotItem record, @Param("example") DepotItemExample example); + + int updateByPrimaryKeySelective(DepotItem record); + + int updateByPrimaryKey(DepotItem record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapperEx.java new file mode 100644 index 00000000..5909ad9e --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotItemMapperEx.java @@ -0,0 +1,240 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.*; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.vo.DepotItemStockWarningCount; +import com.wansensoft.vo.DepotItemVo4Stock; +import com.wansensoft.vo.DepotItemVoBatchNumberList; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Mapper +public interface DepotItemMapperEx extends BaseMapper { + List selectByConditionDepotItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByDepotItem( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + List findDetailByDepotIdsAndMaterialIdList( + @Param("depotIdArray") Long[] depotIdArray, + @Param("forceFlag") Boolean forceFlag, + @Param("sku") String sku, + @Param("batchNumber") String batchNumber, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("mId") Long mId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long findDetailByDepotIdsAndMaterialIdCount( + @Param("depotIdArray") Long[] depotIdArray, + @Param("forceFlag") Boolean forceFlag, + @Param("sku") String sku, + @Param("batchNumber") String batchNumber, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("mId") Long mId); + + List getDetailList( + @Param("headerId") Long headerId); + + List findByAll( + @Param("materialParam") String materialParam, + @Param("categoryIdList") List categoryIdList, + @Param("endTime") String endTime, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findByAllCount( + @Param("materialParam") String materialParam, + @Param("categoryIdList") List categoryIdList, + @Param("endTime") String endTime); + + List getListWithBugOrSale( + @Param("materialParam") String materialParam, + @Param("billType") String billType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("organId") Long organId, + @Param("organArray") String [] organArray, + @Param("depotList") List depotList, + @Param("forceFlag") Boolean forceFlag, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int getListWithBugOrSaleCount( + @Param("materialParam") String materialParam, + @Param("billType") String billType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("organId") Long organId, + @Param("organArray") String [] organArray, + @Param("depotList") List depotList, + @Param("forceFlag") Boolean forceFlag); + + BigDecimal buyOrSaleNumber( + @Param("type") String type, + @Param("subType") String subType, + @Param("MId") Long MId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("organId") Long organId, + @Param("organArray") String [] organArray, + @Param("depotList") List depotList, + @Param("forceFlag") Boolean forceFlag, + @Param("sumType") String sumType); + + BigDecimal buyOrSalePrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("MId") Long MId, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("organId") Long organId, + @Param("organArray") String [] organArray, + @Param("depotList") List depotList, + @Param("forceFlag") Boolean forceFlag, + @Param("sumType") String sumType); + + BigDecimal inOrOutPrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag); + + BigDecimal inOrOutRetailPrice( + @Param("type") String type, + @Param("subType") String subType, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("creatorArray") String[] creatorArray, + @Param("forceFlag") Boolean forceFlag); + + BigDecimal getSkuStockCheckSumByDepotList( + @Param("depotList") List depotList, + @Param("meId") Long meId, + @Param("forceFlag") Boolean forceFlag, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + BigDecimal getStockCheckSumByDepotList( + @Param("depotList") List depotList, + @Param("mId") Long mId, + @Param("forceFlag") Boolean forceFlag, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + DepotItemVo4Stock getSkuStockByParamWithDepotList( + @Param("depotList") List depotList, + @Param("meId") Long meId, + @Param("forceFlag") Boolean forceFlag, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + DepotItemVo4Stock getStockByParamWithDepotList( + @Param("depotList") List depotList, + @Param("mId") Long mId, + @Param("forceFlag") Boolean forceFlag, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); + + /** + * 通过单据主表id查询所有单据子表数据 + * @param depotheadId + * @param enableSerialNumber + * @return + */ + List findDepotItemListBydepotheadId(@Param("depotheadId")Long depotheadId, + @Param("enableSerialNumber")String enableSerialNumber); + /** + * 根据单据主表id删除单据子表数据 + * */ + int batchDeleteDepotItemByDepotHeadIds(@Param("depotheadIds")Long []depotHeadIds); + + int batchDeleteDepotItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getDepotItemListListByDepotIds(@Param("depotIds") String[] depotIds); + + List getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds); + + List findStockWarningCount( + @Param("offset") Integer offset, + @Param("rows") Integer rows, + @Param("materialParam") String materialParam, + @Param("depotList") List depotList); + + int findStockWarningCountTotal( + @Param("materialParam") String materialParam, + @Param("depotList") List depotList); + + BigDecimal getFinishNumber( + @Param("meId") Long meId, + @Param("linkId") Long linkId, + @Param("linkNumber") String linkNumber, + @Param("goToType") String goToType); + + BigDecimal getRealFinishNumber( + @Param("meId") Long meId, + @Param("linkId") Long linkId, + @Param("linkNumber") String linkNumber, + @Param("currentHeaderId") Long currentHeaderId, + @Param("goToType") String goToType); + + List getBatchNumberList( + @Param("number") String number, + @Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode, + @Param("batchNumber") String batchNumber); + + Long getCountByMaterialAndDepot( + @Param("mId") Long mId, + @Param("depotId") Long depotId); + + List getLinkBillDetailMaterialSum( + @Param("linkNumber") String linkNumber); + + List getBatchBillDetailMaterialSum( + @Param("linkNumber") String linkNumber, + @Param("type") String type); + + Long getCountByMaterialAndBatchNumber( + @Param("meId") Long meId, + @Param("batchNumber") String batchNumber); + + List getDepotItemByBatchNumber( + @Param("batchNumber") String batchNumber); + + List getBillItemByParam( + @Param("barCodes") String barCodes); + + BigDecimal getCurrentStockByParam( + @Param("depotId") Long depotId, + @Param("mId") Long mId); + + BigDecimal getLastUnitPriceByParam( + @Param("organId") Long organId, + @Param("meId") Long meId, + @Param("type") String type, + @Param("subType") String subType); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapper.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapper.java new file mode 100644 index 00000000..db0a3150 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapper.java @@ -0,0 +1,34 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.depot.DepotExample; + +import java.util.List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface DepotMapper extends BaseMapper { + long countByExample(DepotExample example); + + int deleteByExample(DepotExample example); + + int deleteByPrimaryKey(Long id); + + int insertDepot(Depot record); + + int insertSelective(Depot record); + + List selectByExample(DepotExample example); + + Depot selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Depot record, @Param("example") DepotExample example); + + int updateByExample(@Param("record") Depot record, @Param("example") DepotExample example); + + int updateByPrimaryKeySelective(Depot record); + + int updateByPrimaryKey(Depot record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapperEx.java new file mode 100644 index 00000000..3ce822e7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/depot/DepotMapperEx.java @@ -0,0 +1,27 @@ +package com.wansensoft.mappers.depot; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.depot.DepotEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface DepotMapperEx extends BaseMapper { + + List selectByConditionDepot( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByDepot( + @Param("name") String name, + @Param("type") Integer type, + @Param("remark") String remark); + + int batchDeleteDepotByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java index 6f94a371..8b361a63 100644 --- a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.financial; -import com.wansensoft.entities.financial.FinancialAccount; +import com.wansensoft.entities.FinancialAccount; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 账户信息 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface FinancialAccountMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java index b89a1e26..55ecb301 100644 --- a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.financial; -import com.wansensoft.entities.financial.FinancialMain; +import com.wansensoft.entities.FinancialMain; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 财务主表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface FinancialMainMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java index 76bbd022..9e172467 100644 --- a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.financial; -import com.wansensoft.entities.financial.FinancialSub; +import com.wansensoft.entities.FinancialSub; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 财务子表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface FinancialSubMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapper.java b/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapper.java new file mode 100644 index 00000000..85599779 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.function; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.function.Function; +import com.wansensoft.entities.function.FunctionExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface FunctionMapper extends BaseMapper { + long countByExample(FunctionExample example); + + int deleteByExample(FunctionExample example); + + int deleteByPrimaryKey(Long id); + + int insertFunction(Function record); + + int insertSelective(Function record); + + List selectByExample(FunctionExample example); + + Function selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Function record, @Param("example") FunctionExample example); + + int updateByExample(@Param("record") Function record, @Param("example") FunctionExample example); + + int updateByPrimaryKeySelective(Function record); + + int updateByPrimaryKey(Function record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapperEx.java new file mode 100644 index 00000000..e02465fc --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/function/FunctionMapperEx.java @@ -0,0 +1,25 @@ +package com.wansensoft.mappers.function; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.function.FunctionEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface FunctionMapperEx extends BaseMapper { + + List selectByConditionFunction( + @Param("name") String name, + @Param("type") String type, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByFunction( + @Param("name") String name, + @Param("type") String type); + + int batchDeleteFunctionByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapper.java b/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapper.java new file mode 100644 index 00000000..5c04a94b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.inOutItem; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.inOutItem.InOutItem; +import com.wansensoft.entities.inOutItem.InOutItemExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface InOutItemMapper extends BaseMapper { + long countByExample(InOutItemExample example); + + int deleteByExample(InOutItemExample example); + + int deleteByPrimaryKey(Long id); + + int insertInOutItem(InOutItem record); + + int insertSelective(InOutItem record); + + List selectByExample(InOutItemExample example); + + InOutItem selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") InOutItem record, @Param("example") InOutItemExample example); + + int updateByExample(@Param("record") InOutItem record, @Param("example") InOutItemExample example); + + int updateByPrimaryKeySelective(InOutItem record); + + int updateByPrimaryKey(InOutItem record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapperEx.java new file mode 100644 index 00000000..2628630b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/inOutItem/InOutItemMapperEx.java @@ -0,0 +1,27 @@ +package com.wansensoft.mappers.inOutItem; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.inOutItem.InOutItem; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface InOutItemMapperEx extends BaseMapper { + + List selectByConditionInOutItem( + @Param("name") String name, + @Param("type") String type, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByInOutItem( + @Param("name") String name, + @Param("type") String type, + @Param("remark") String remark); + + int batchDeleteInOutItemByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/log/LogMapper.java b/dao/src/main/java/com/wansensoft/mappers/log/LogMapper.java new file mode 100644 index 00000000..94f71533 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/log/LogMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.log; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.log.Log; +import com.wansensoft.entities.log.LogExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface LogMapper extends BaseMapper { + long countByExample(LogExample example); + + int deleteByExample(LogExample example); + + int deleteByPrimaryKey(Long id); + + int insertLog(Log record); + + int insertSelective(Log record); + + List selectByExample(LogExample example); + + Log selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Log record, @Param("example") LogExample example); + + int updateByExample(@Param("record") Log record, @Param("example") LogExample example); + + int updateByPrimaryKeySelective(Log record); + + int updateByPrimaryKey(Log record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java new file mode 100644 index 00000000..38e01313 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java @@ -0,0 +1,43 @@ +package com.wansensoft.mappers.log; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.log.Log; +import com.wansensoft.vo.LogVo4List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface LogMapperEx extends BaseMapper { + + List selectByConditionLog( + @Param("operation") String operation, + @Param("userInfo") String userInfo, + @Param("clientIp") String clientIp, + @Param("status") Integer status, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("content") String content, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByLog( + @Param("operation") String operation, + @Param("userInfo") String userInfo, + @Param("clientIp") String clientIp, + @Param("status") Integer status, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, + @Param("content") String content); + + Long getCountByIpAndDate( + @Param("userId") Long userId, + @Param("moduleName") String moduleName, + @Param("clientIp") String clientIp, + @Param("createTime") String createTime); + + @InterceptorIgnore(tenantLine = "true") + int insertLogWithUserId(Log log); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapper.java new file mode 100644 index 00000000..28c861c1 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialAttribute; +import com.wansensoft.entities.material.MaterialAttributeExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialAttributeMapper extends BaseMapper { + long countByExample(MaterialAttributeExample example); + + int deleteByExample(MaterialAttributeExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialAttribute(MaterialAttribute record); + + int insertSelective(MaterialAttribute record); + + List selectByExample(MaterialAttributeExample example); + + MaterialAttribute selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialAttribute record, @Param("example") MaterialAttributeExample example); + + int updateByExample(@Param("record") MaterialAttribute record, @Param("example") MaterialAttributeExample example); + + int updateByPrimaryKeySelective(MaterialAttribute record); + + int updateByPrimaryKey(MaterialAttribute record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapperEx.java new file mode 100644 index 00000000..7935d7a4 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialAttributeMapperEx.java @@ -0,0 +1,23 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialAttribute; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MaterialAttributeMapperEx extends BaseMapper { + + List selectByConditionMaterialAttribute( + @Param("attributeName") String attributeName, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialAttribute( + @Param("attributeField") String attributeField); + + int batchDeleteMaterialAttributeByIds( + @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapper.java new file mode 100644 index 00000000..5ea79e79 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialCategory; +import com.wansensoft.entities.material.MaterialCategoryExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialCategoryMapper extends BaseMapper { + long countByExample(MaterialCategoryExample example); + + int deleteByExample(MaterialCategoryExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialCategory(MaterialCategory record); + + int insertSelective(MaterialCategory record); + + List selectByExample(MaterialCategoryExample example); + + MaterialCategory selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + int updateByExample(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + int updateByPrimaryKeySelective(MaterialCategory record); + + int updateByPrimaryKey(MaterialCategory record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapperEx.java new file mode 100644 index 00000000..e08928e2 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCategoryMapperEx.java @@ -0,0 +1,39 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialCategory; +import com.wansensoft.vo.TreeNode; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Mapper +public interface MaterialCategoryMapperEx extends BaseMapper { + List selectByConditionMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId); + + List getNodeTree(@Param("currentId")Long currentId); + List getNextNodeTree(Map parameterMap); + + int addMaterialCategory(MaterialCategory mc); + + int batchDeleteMaterialCategoryByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + int editMaterialCategory(MaterialCategory mc); + + List getMaterialCategoryBySerialNo(@Param("serialNo") String serialNo, @Param("id") Long id); + + List getMaterialCategoryListByCategoryIds(@Param("parentIds") String[] categoryIds); + + List getListByParentId(@Param("parentId") Long parentId); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapper.java new file mode 100644 index 00000000..16d26f22 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialCurrentStock; +import com.wansensoft.entities.material.MaterialCurrentStockExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialCurrentStockMapper extends BaseMapper { + long countByExample(MaterialCurrentStockExample example); + + int deleteByExample(MaterialCurrentStockExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialCurrentStock(MaterialCurrentStock record); + + int insertSelective(MaterialCurrentStock record); + + List selectByExample(MaterialCurrentStockExample example); + + MaterialCurrentStock selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialCurrentStock record, @Param("example") MaterialCurrentStockExample example); + + int updateByExample(@Param("record") MaterialCurrentStock record, @Param("example") MaterialCurrentStockExample example); + + int updateByPrimaryKeySelective(MaterialCurrentStock record); + + int updateByPrimaryKey(MaterialCurrentStock record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapperEx.java new file mode 100644 index 00000000..5bff3cb4 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialCurrentStockMapperEx.java @@ -0,0 +1,17 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialCurrentStock; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MaterialCurrentStockMapperEx extends BaseMapper { + + int batchInsert(List list); + + List getCurrentStockMapByIdList( + @Param("materialIdList") List materialIdList); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapper.java new file mode 100644 index 00000000..768bfdfa --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.entities.material.MaterialExtendExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialExtendMapper extends BaseMapper { + long countByExample(MaterialExtendExample example); + + int deleteByExample(MaterialExtendExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialExtend(MaterialExtend record); + + int insertSelective(MaterialExtend record); + + List selectByExample(MaterialExtendExample example); + + MaterialExtend selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialExtend record, @Param("example") MaterialExtendExample example); + + int updateByExample(@Param("record") MaterialExtend record, @Param("example") MaterialExtendExample example); + + int updateByPrimaryKeySelective(MaterialExtend record); + + int updateByPrimaryKey(MaterialExtend record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapperEx.java new file mode 100644 index 00000000..e55636a4 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialExtendMapperEx.java @@ -0,0 +1,29 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.vo.MaterialExtendVo4List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MaterialExtendMapperEx extends BaseMapper { + + int batchDeleteMaterialExtendByIds(@Param("ids") String ids[]); + + List getDetailList( + @Param("materialId") Long materialId); + + Long getMaxTimeByTenantAndTime( + @Param("tenantId") Long tenantId, + @Param("lastTime") Long lastTime, + @Param("syncNum") Long syncNum); + + List getListByMId(@Param("ids") Long ids[]); + + int batchDeleteMaterialExtendByMIds(@Param("ids") String ids[]); + + int specialUpdatePrice(MaterialExtend record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapper.java new file mode 100644 index 00000000..fb27e0b3 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialInitialStock; +import com.wansensoft.entities.material.MaterialInitialStockExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialInitialStockMapper extends BaseMapper { + long countByExample(MaterialInitialStockExample example); + + int deleteByExample(MaterialInitialStockExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialInitialStock(MaterialInitialStock record); + + int insertSelective(MaterialInitialStock record); + + List selectByExample(MaterialInitialStockExample example); + + MaterialInitialStock selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialInitialStock record, @Param("example") MaterialInitialStockExample example); + + int updateByExample(@Param("record") MaterialInitialStock record, @Param("example") MaterialInitialStockExample example); + + int updateByPrimaryKeySelective(MaterialInitialStock record); + + int updateByPrimaryKey(MaterialInitialStock record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapperEx.java new file mode 100644 index 00000000..55a8f81b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialInitialStockMapperEx.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialInitialStock; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface MaterialInitialStockMapperEx extends BaseMapper { + + int batchInsert(List list); + + List getListExceptZero(); + +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapper.java new file mode 100644 index 00000000..c81b92f8 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.material.MaterialExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialMapper extends BaseMapper { + long countByExample(MaterialExample example); + + int deleteByExample(MaterialExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterial(Material record); + + int insertSelective(Material record); + + List selectByExample(MaterialExample example); + + Material selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Material record, @Param("example") MaterialExample example); + + int updateByExample(@Param("record") Material record, @Param("example") MaterialExample example); + + int updateByPrimaryKeySelective(Material record); + + int updateByPrimaryKey(Material record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapperEx.java new file mode 100644 index 00000000..63ff9fb6 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialMapperEx.java @@ -0,0 +1,163 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.entities.material.MaterialInitialStockWithMaterial; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.vo.MaterialVoSearch; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface MaterialMapperEx extends BaseMapper { + + List selectByConditionMaterial( + @Param("materialParam") String materialParam, + @Param("color") String color, + @Param("materialOther") String materialOther, + @Param("weight") String weight, + @Param("expiryNum") String expiryNum, + @Param("enableSerialNumber") String enableSerialNumber, + @Param("enableBatchNumber") String enableBatchNumber, + @Param("position") String position, + @Param("enabled") String enabled, + @Param("remark") String remark, + @Param("idList") List idList, + @Param("mpList") String mpList, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterial( + @Param("materialParam") String materialParam, + @Param("color") String color, + @Param("materialOther") String materialOther, + @Param("weight") String weight, + @Param("expiryNum") String expiryNum, + @Param("enableSerialNumber") String enableSerialNumber, + @Param("enableBatchNumber") String enableBatchNumber, + @Param("position") String position, + @Param("enabled") String enabled, + @Param("remark") String remark, + @Param("idList") List idList, + @Param("mpList") String mpList); + + Long insertSelectiveEx(Material record); + + List findUnitList(@Param("mId") Long mId); + + List findById(@Param("id") Long id); + + List findByIdWithBarCode(@Param("meId") Long meId); + + List getMaterialByParam(@Param("materialParam") String materialParam); + + List findBySelectWithBarCode(@Param("idList") List idList, + @Param("q") String q, + @Param("enableSerialNumber") String enableSerialNumber, + @Param("enableBatchNumber") String enableBatchNumber, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int findBySelectWithBarCodeCount(@Param("idList") List idList, + @Param("q") String q, + @Param("enableSerialNumber") String enableSerialNumber, + @Param("enableBatchNumber") String enableBatchNumber); + + List exportExcel( + @Param("materialParam") String materialParam, + @Param("color") String color, + @Param("materialOther") String materialOther, + @Param("weight") String weight, + @Param("expiryNum") String expiryNum, + @Param("enabled") String enabled, + @Param("enableSerialNumber") String enableSerialNumber, + @Param("enableBatchNumber") String enableBatchNumber, + @Param("remark") String remark, + @Param("idList") List idList); + + List getOtherMaterialList(); + + /** + * 通过商品名称查询商品信息 + * */ + List findByMaterialName(@Param("name") String name); + /** + * 获取开启序列号并且状态正常的商品列表 + * */ + List getMaterialEnableSerialNumberList(@Param("q") String q, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long getMaterialEnableSerialNumberCount(@Param("q") String q); + + int batchDeleteMaterialByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getMaterialListByCategoryIds(@Param("categoryIds") String[] categoryIds); + + List getMaterialListByUnitIds(@Param("unitIds") String[] unitIds); + + String getMaxBarCode(); + + List getMaterialByMeId( + @Param("meId") Long meId); + + List getMaterialNameList(); + + int setUnitIdToNull(@Param("id") Long id); + + int setExpiryNumToNull(@Param("id") Long id); + + List getMaterialByBarCode(@Param("barCodeArray") String [] barCodeArray); + + List getMaterialByBarCodeAndWithOutMId( + @Param("barCodeArray") String [] barCodeArray, + @Param("mId") Long mId); + + List getInitialStockWithMaterial( + @Param("depotList") List depotList); + + List getListWithStock( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("position") String position, + @Param("materialParam") String materialParam, + @Param("zeroStock") Integer zeroStock, + @Param("column") String column, + @Param("order") String order, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int getListWithStockCount( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("position") String position, + @Param("materialParam") String materialParam, + @Param("zeroStock") Integer zeroStock); + + MaterialVo4Unit getTotalStockAndPrice( + @Param("depotList") List depotList, + @Param("idList") List idList, + @Param("position") String position, + @Param("materialParam") String materialParam); + + int checkIsExist( + @Param("id") Long id, + @Param("name") String name, + @Param("model") String model, + @Param("color") String color, + @Param("standard") String standard, + @Param("mfrs") String mfrs, + @Param("otherField1") String otherField1, + @Param("otherField2") String otherField2, + @Param("otherField3") String otherField3, + @Param("unit") String unit, + @Param("unitId") Long unitId); + + MaterialExtend getMaterialExtendBySerialNumber( + @Param("serialNumber") String serialNumber); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapper.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapper.java new file mode 100644 index 00000000..9b04b6cb --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialProperty; +import com.wansensoft.entities.material.MaterialPropertyExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MaterialPropertyMapper extends BaseMapper { + long countByExample(MaterialPropertyExample example); + + int deleteByExample(MaterialPropertyExample example); + + int deleteByPrimaryKey(Long id); + + int insertMaterialProperty(MaterialProperty record); + + int insertSelective(MaterialProperty record); + + List selectByExample(MaterialPropertyExample example); + + MaterialProperty selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") MaterialProperty record, @Param("example") MaterialPropertyExample example); + + int updateByExample(@Param("record") MaterialProperty record, @Param("example") MaterialPropertyExample example); + + int updateByPrimaryKeySelective(MaterialProperty record); + + int updateByPrimaryKey(MaterialProperty record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapperEx.java new file mode 100644 index 00000000..ff5a8a64 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/material/MaterialPropertyMapperEx.java @@ -0,0 +1,22 @@ +package com.wansensoft.mappers.material; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.material.MaterialProperty; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface MaterialPropertyMapperEx extends BaseMapper { + + List selectByConditionMaterialProperty( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMaterialProperty(@Param("name") String name); + + int batchDeleteMaterialPropertyByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapper.java b/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapper.java new file mode 100644 index 00000000..8763b226 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.msg; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.msg.Msg; +import com.wansensoft.entities.msg.MsgExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface MsgMapper extends BaseMapper { + long countByExample(MsgExample example); + + int deleteByExample(MsgExample example); + + int deleteByPrimaryKey(Long id); + + int insertMsg(Msg record); + + int insertSelective(Msg record); + + List selectByExample(MsgExample example); + + Msg selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Msg record, @Param("example") MsgExample example); + + int updateByExample(@Param("record") Msg record, @Param("example") MsgExample example); + + int updateByPrimaryKeySelective(Msg record); + + int updateByPrimaryKey(Msg record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapperEx.java new file mode 100644 index 00000000..c1fbdc4e --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/msg/MsgMapperEx.java @@ -0,0 +1,29 @@ +package com.wansensoft.mappers.msg; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.msg.Msg; +import com.wansensoft.entities.msg.MsgEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface MsgMapperEx extends BaseMapper { + + List selectByConditionMsg( + @Param("userId") Long userId, + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByMsg( + @Param("userId") Long userId, + @Param("name") String name); + + int batchDeleteMsgByIds(@Param("ids") String ids[]); + + Long getMsgCountByStatus( + @Param("status") String status, + @Param("userId") Long userId); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapper.java new file mode 100644 index 00000000..f2879f1e --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapper.java @@ -0,0 +1,101 @@ +package com.wansensoft.mappers.organization; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.organization.OrgaUserRel; +import com.wansensoft.entities.organization.OrgaUserRelExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface OrgaUserRelMapper extends BaseMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int countByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int deleteByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int insertOrgaUserRel(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int insertSelective(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + List selectByExample(OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + OrgaUserRel selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByExampleSelective(@Param("record") OrgaUserRel record, @Param("example") OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByExample(@Param("record") OrgaUserRel record, @Param("example") OrgaUserRelExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByPrimaryKeySelective(OrgaUserRel record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + int updateByPrimaryKey(OrgaUserRel record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapperEx.java new file mode 100644 index 00000000..9ee55585 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/organization/OrgaUserRelMapperEx.java @@ -0,0 +1,13 @@ +package com.wansensoft.mappers.organization; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.organization.OrgaUserRel; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface OrgaUserRelMapperEx extends BaseMapper { + + int addOrgaUserRel(OrgaUserRel orgaUserRel); + + int updateOrgaUserRel(OrgaUserRel orgaUserRel); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapper.java b/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapper.java new file mode 100644 index 00000000..ecb98d05 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.organization; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.organization.Organization; +import com.wansensoft.entities.organization.OrganizationExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface OrganizationMapper extends BaseMapper { + long countByExample(OrganizationExample example); + + int deleteByExample(OrganizationExample example); + + int deleteByPrimaryKey(Long id); + + int insertOrganization(Organization record); + + int insertSelective(Organization record); + + List selectByExample(OrganizationExample example); + + Organization selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example); + + int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example); + + int updateByPrimaryKeySelective(Organization record); + + int updateByPrimaryKey(Organization record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapperEx.java new file mode 100644 index 00000000..596f4caf --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/organization/OrganizationMapperEx.java @@ -0,0 +1,28 @@ +package com.wansensoft.mappers.organization; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.organization.Organization; +import com.wansensoft.vo.TreeNode; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Mapper +public interface OrganizationMapperEx extends BaseMapper { + + + List getNodeTree(@Param("currentId")Long currentId); + List getNextNodeTree(Map parameterMap); + + int addOrganization(Organization org); + + List getOrganizationByParentIds(@Param("ids") String ids[]); + + int batchDeleteOrganizationByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + int editOrganization(Organization org); + List getOrganizationRootByIds(@Param("ids") String ids[]); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/person/PersonMapper.java b/dao/src/main/java/com/wansensoft/mappers/person/PersonMapper.java new file mode 100644 index 00000000..f57332a3 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/person/PersonMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.person; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.person.Person; +import com.wansensoft.entities.person.PersonExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface PersonMapper extends BaseMapper { + long countByExample(PersonExample example); + + int deleteByExample(PersonExample example); + + int deleteByPrimaryKey(Long id); + + int insertPerson(Person record); + + int insertSelective(Person record); + + List selectByExample(PersonExample example); + + Person selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Person record, @Param("example") PersonExample example); + + int updateByExample(@Param("record") Person record, @Param("example") PersonExample example); + + int updateByPrimaryKeySelective(Person record); + + int updateByPrimaryKey(Person record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/person/PersonMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/person/PersonMapperEx.java new file mode 100644 index 00000000..ebe25327 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/person/PersonMapperEx.java @@ -0,0 +1,24 @@ +package com.wansensoft.mappers.person; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.person.Person; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface PersonMapperEx extends BaseMapper { + + List selectByConditionPerson( + @Param("name") String name, + @Param("type") String type, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByPerson( + @Param("name") String name, + @Param("type") String type); + + int batchDeletePersonByIds(@Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapper.java new file mode 100644 index 00000000..46fc5fb3 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapper.java @@ -0,0 +1,37 @@ +package com.wansensoft.mappers.platformConfig; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.platformConfig.PlatformConfig; +import com.wansensoft.entities.platformConfig.PlatformConfigExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface PlatformConfigMapper extends BaseMapper { + long countByExample(PlatformConfigExample example); + + int deleteByExample(PlatformConfigExample example); + + int deleteByPrimaryKey(Long id); + + int insertPlatformConfig(PlatformConfig record); + + int insertSelective(PlatformConfig record); + + List selectByExample(PlatformConfigExample example); + + List getInfoByKey(PlatformConfigExample example); + + PlatformConfig selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") PlatformConfig record, @Param("example") PlatformConfigExample example); + + int updateByExample(@Param("record") PlatformConfig record, @Param("example") PlatformConfigExample example); + + int updateByPrimaryKeySelective(PlatformConfig record); + + int updateByPrimaryKey(PlatformConfig record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapperEx.java new file mode 100644 index 00000000..6611306e --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/platformConfig/PlatformConfigMapperEx.java @@ -0,0 +1,21 @@ +package com.wansensoft.mappers.platformConfig; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.platformConfig.PlatformConfig; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface PlatformConfigMapperEx extends BaseMapper { + + List selectByConditionPlatformConfig( + @Param("platformKey") String platformKey, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByPlatformConfig( + @Param("platformKey") String platformKey); + +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java index 2668fdbc..d7ffe652 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductAttribute; +import com.wansensoft.entities.ProductAttribute; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品属性表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductAttributeMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java index 03521d75..9c63e08b 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductCategory; +import com.wansensoft.entities.ProductCategory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品类型表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductCategoryMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java index 0e4977da..0b249a26 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductExtendPrice; +import com.wansensoft.entities.ProductExtendPrice; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品价格扩展 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductExtendPriceMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java index acf3a0df..376ee41b 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductExtendProperty; +import com.wansensoft.entities.ProductExtendProperty; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品扩展字段表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductExtendPropertyMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java index 7acaf4ef..df1273e9 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductInventoryCurrent; +import com.wansensoft.entities.ProductInventoryCurrent; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品当前库存 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductInventoryCurrentMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java index b8467f74..36d71921 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductInventoryInitial; +import com.wansensoft.entities.ProductInventoryInitial; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品初始库存 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductInventoryInitialMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java index aff3d5d5..2f762e77 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.Product; +import com.wansensoft.entities.Product; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 产品表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java index b5ab1be0..2a9941e4 100644 --- a/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.product; -import com.wansensoft.entities.product.ProductUnit; +import com.wansensoft.entities.ProductUnit; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 多单位表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ProductUnitMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/role/RoleMapper.java b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapper.java new file mode 100644 index 00000000..b94093ac --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.role; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.role.RoleExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface RoleMapper extends BaseMapper { + long countByExample(RoleExample example); + + int deleteByExample(RoleExample example); + + int deleteByPrimaryKey(Long id); + + int insertRole(Role record); + + int insertSelective(Role record); + + List selectByExample(RoleExample example); + + Role selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example); + + int updateByExample(@Param("record") Role record, @Param("example") RoleExample example); + + int updateByPrimaryKeySelective(Role record); + + int updateByPrimaryKey(Role record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java new file mode 100644 index 00000000..ffb938c7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java @@ -0,0 +1,32 @@ +package com.wansensoft.mappers.role; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.role.RoleEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface RoleMapperEx extends BaseMapper { + + List selectByConditionRole( + @Param("name") String name, + @Param("description") String description, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByRole( + @Param("name") String name, + @Param("description") String description); + + int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + + @InterceptorIgnore(tenantLine = "true") + Role getRoleWithoutTenant( + @Param("roleId") Long roleId); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java index 35ff61c3..9d0263fd 100644 --- a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.role; -import com.wansensoft.entities.role.SysRole; +import com.wansensoft.entities.SysRole; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 角色表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysRoleMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java index a0ab6857..1ffb5d40 100644 --- a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java @@ -1,29 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.role; -import com.wansensoft.entities.role.SysRoleMenuRel; +import com.wansensoft.entities.SysRoleMenuRel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; /** *

* 角色菜单关系表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysRoleMenuRelMapper extends BaseMapper { - List listByRoleId(@Param("roleIds") List roleIds); } diff --git a/dao/src/main/java/com/wansensoft/mappers/serialNumber/SequenceMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SequenceMapperEx.java new file mode 100644 index 00000000..5a11d085 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SequenceMapperEx.java @@ -0,0 +1,17 @@ +package com.wansensoft.mappers.serialNumber; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.Sequence; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SequenceMapperEx extends BaseMapper { + + void updateBuildOnlyNumber(); + + /** + * 获得一个全局唯一的数作为订单号的追加 + * */ + Long getBuildOnlyNumber(@Param("seq_name") String seq_name); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapper.java b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapper.java new file mode 100644 index 00000000..d675bd84 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.serialNumber; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SerialNumberMapper extends BaseMapper { + long countByExample(SerialNumberExample example); + + int deleteByExample(SerialNumberExample example); + + int deleteByPrimaryKey(Long id); + + int insertSerialNumber(SerialNumber record); + + int insertSelective(SerialNumber record); + + List selectByExample(SerialNumberExample example); + + SerialNumber selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); + + int updateByExample(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example); + + int updateByPrimaryKeySelective(SerialNumber record); + + int updateByPrimaryKey(SerialNumber record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapperEx.java new file mode 100644 index 00000000..f290b8f7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/serialNumber/SerialNumberMapperEx.java @@ -0,0 +1,54 @@ +package com.wansensoft.mappers.serialNumber; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface SerialNumberMapperEx extends BaseMapper { + /** + * 新增序列号信息 + * */ + int addSerialNumber(SerialNumberEx serialNumberEx); + /** + * 修改序列号信息 + * */ + int updateSerialNumber(SerialNumberEx serialNumberEx); + /** + * 查询指定商品下有效的序列号数量 + * 未删除为卖出的视为有效 + * */ + int findSerialNumberByMaterialId(@Param("materialId") Long materialId); + /** + * 卖出: update jsh_serial_number set is_Sell='1' ,depothead_Id='depotheadId' where 1=1 and material_Id='materialId' + * and is_Sell !='1' and delete_Flag !='1' {limit 0,count} + * */ + int sellSerialNumber(@Param("materialId")Long materialId, @Param("outBillNo")String outBillNo, @Param("snArray") String snArray[], @Param("updateTime") Date updateTime,@Param("updater") Long updater); + /** + * 赎回:update jsh_serial_number set is_Sell='0',depothead_Id=null where 1=1 and material_Id='materialId' + * and depothead_Id='depotheadId' and is_Sell !='0' and delete_Flag !='1' {limit 0,count} + * */ + int cancelSerialNumber(@Param("materialId")Long materialId, @Param("outBillNo")String outBillNo, @Param("count")Integer count, @Param("updateTime") Date updateTime,@Param("updater") Long updater); + /** + * 批量添加序列号 + * */ + int batAddSerialNumber(@Param("list") List list); + + int batchDeleteSerialNumberByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + List getEnableSerialNumberList(@Param("number") String number, + @Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode, + @Param("offset") Integer offset, @Param("rows") Integer rows); + + Long getEnableSerialNumberCount(@Param("number") String number, + @Param("name") String name, + @Param("depotId") Long depotId, + @Param("barCode") String barCode); +} diff --git a/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapper.java b/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapper.java new file mode 100644 index 00000000..71580b39 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.supplier; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.entities.supplier.SupplierExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SupplierMapper extends BaseMapper { + long countByExample(SupplierExample example); + + int deleteByExample(SupplierExample example); + + int deleteByPrimaryKey(Long id); + + int insertSupplier(Supplier record); + + int insertSelective(Supplier record); + + List selectByExample(SupplierExample example); + + Supplier selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Supplier record, @Param("example") SupplierExample example); + + int updateByExample(@Param("record") Supplier record, @Param("example") SupplierExample example); + + int updateByPrimaryKeySelective(Supplier record); + + int updateByPrimaryKey(Supplier record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapperEx.java new file mode 100644 index 00000000..a0bd46ff --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/supplier/SupplierMapperEx.java @@ -0,0 +1,41 @@ +package com.wansensoft.mappers.supplier; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.supplier.Supplier; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface SupplierMapperEx extends BaseMapper { + + List selectByConditionSupplier( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone, + @Param("creatorArray") String[] creatorArray, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsBySupplier( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone, + @Param("creatorArray") String[] creatorArray); + + List findByAll( + @Param("supplier") String supplier, + @Param("type") String type, + @Param("phonenum") String phonenum, + @Param("telephone") String telephone); + + int batchDeleteSupplierByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + Supplier getSupplierByNameAndType( + @Param("supplier") String supplier, + @Param("type") String type); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java index 008ee8c6..bc0619d2 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; -import com.wansensoft.entities.system.SysConfig; +import com.wansensoft.entities.SysConfig; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 系统参数 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysConfigMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysDepartmentMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysDepartmentMapper.java deleted file mode 100644 index 314e6b5a..00000000 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysDepartmentMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.mappers.system; - -import com.wansensoft.entities.SysDepartment; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 机构表 Mapper 接口 - *

- */ -public interface SysDepartmentMapper extends BaseMapper { - -} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java index c39128c1..3196f0a1 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; -import com.wansensoft.entities.system.SysLog; +import com.wansensoft.entities.SysLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 操作日志 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysLogMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java index 8372461b..494b7ebe 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; +import com.wansensoft.entities.SysMenu; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.wansensoft.entities.system.SysMenu; /** *

* 功能模块表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysMenuMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java index 5684cc9c..a10c0d80 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; -import com.wansensoft.entities.system.SysMsg; +import com.wansensoft.entities.SysMsg; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 消息表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysMsgMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java new file mode 100644 index 00000000..d02b298b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysOrganization; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 机构表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysOrganizationMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java index 8adf56f4..95e09c3e 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; -import com.wansensoft.entities.system.SysPlatformConfig; +import com.wansensoft.entities.SysPlatformConfig; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 平台参数 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysPlatformConfigMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java index b4f94086..9079e9b5 100644 --- a/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.system; import com.wansensoft.entities.SysSerialNumber; @@ -19,6 +7,9 @@ *

* 序列号表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysSerialNumberMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapper.java new file mode 100644 index 00000000..d3ce460c --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.system.SystemConfig; +import com.wansensoft.entities.system.SystemConfigExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SystemConfigMapper extends BaseMapper { + long countByExample(SystemConfigExample example); + + int deleteByExample(SystemConfigExample example); + + int deleteByPrimaryKey(Long id); + + int insertSystemConfig(SystemConfig record); + + int insertSelective(SystemConfig record); + + List selectByExample(SystemConfigExample example); + + SystemConfig selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example); + + int updateByExample(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example); + + int updateByPrimaryKeySelective(SystemConfig record); + + int updateByPrimaryKey(SystemConfig record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapperEx.java new file mode 100644 index 00000000..be62dc69 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SystemConfigMapperEx.java @@ -0,0 +1,23 @@ +package com.wansensoft.mappers.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.system.SystemConfig; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface SystemConfigMapperEx extends BaseMapper { + + List selectByConditionSystemConfig( + @Param("companyName") String companyName, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsBySystemConfig( + @Param("companyName") String companyName); + + int batchDeleteSystemConfigByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java index becdc3b2..e9088df7 100644 --- a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.tenant; -import com.wansensoft.entities.tenant.SysTenant; +import com.wansensoft.entities.SysTenant; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 租户 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysTenantMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java index 47cac7ee..c8bfe1c6 100644 --- a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.tenant; -import com.wansensoft.entities.tenant.SysTenantUser; +import com.wansensoft.entities.SysTenantUser; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysTenantUserMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapper.java b/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapper.java new file mode 100644 index 00000000..38dc84d2 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.tenant; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.tenant.TenantExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface TenantMapper extends BaseMapper { + long countByExample(TenantExample example); + + int deleteByExample(TenantExample example); + + int deleteByPrimaryKey(Long id); + + int insertTenant(Tenant record); + + int insertSelective(Tenant record); + + List getTenantByTenantId(TenantExample example); + + Tenant selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Tenant record, @Param("example") TenantExample example); + + int updateByExample(@Param("record") Tenant record, @Param("example") TenantExample example); + + int updateByPrimaryKeySelective(Tenant record); + + int updateByPrimaryKey(Tenant record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapperEx.java new file mode 100644 index 00000000..3a24f8b7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/TenantMapperEx.java @@ -0,0 +1,27 @@ +package com.wansensoft.mappers.tenant; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.tenant.TenantEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface TenantMapperEx extends BaseMapper { + + List selectByConditionTenant( + @Param("loginName") String loginName, + @Param("type") String type, + @Param("enabled") String enabled, + @Param("remark") String remark, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByTenant( + @Param("loginName") String loginName, + @Param("type") String type, + @Param("enabled") String enabled, + @Param("remark") String remark); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapper.java b/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapper.java new file mode 100644 index 00000000..ef148067 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.unit; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.unit.UnitExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface UnitMapper extends BaseMapper { + long countByExample(UnitExample example); + + int deleteByExample(UnitExample example); + + int deleteByPrimaryKey(Long id); + + int insertUnit(Unit record); + + int insertSelective(Unit record); + + List selectByExample(UnitExample example); + + Unit selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Unit record, @Param("example") UnitExample example); + + int updateByExample(@Param("record") Unit record, @Param("example") UnitExample example); + + int updateByPrimaryKeySelective(Unit record); + + int updateByPrimaryKey(Unit record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapperEx.java new file mode 100644 index 00000000..b57dc5fb --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/unit/UnitMapperEx.java @@ -0,0 +1,27 @@ +package com.wansensoft.mappers.unit; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.unit.Unit; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface UnitMapperEx extends BaseMapper { + + List selectByConditionUnit( + @Param("name") String name, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByUnit( + @Param("name") String name); + + int batchDeleteUnitByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + void updateRatioTwoById(@Param("id") Long id); + + void updateRatioThreeById(@Param("id") Long id); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java index 56530084..0ec23c88 100644 --- a/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.user; -import com.wansensoft.entities.user.SysUserBusiness; +import com.wansensoft.entities.SysUserBusiness; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 用户/角色/模块关系表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysUserBusinessMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserDeptRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserDeptRelMapper.java deleted file mode 100644 index bff37f6f..00000000 --- a/dao/src/main/java/com/wansensoft/mappers/user/SysUserDeptRelMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.mappers.user; - -import com.wansensoft.entities.user.SysUserDeptRel; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - *

- * 机构用户关系表 Mapper 接口 - *

- */ -public interface SysUserDeptRelMapper extends BaseMapper { - -} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java index 6cd4c8aa..9a853819 100644 --- a/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.user; -import com.wansensoft.entities.user.SysUser; +import com.wansensoft.entities.SysUser; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 用户表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysUserMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java new file mode 100644 index 00000000..69f6219b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUserOrgRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 机构用户关系表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserOrgRelMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java index 248a121d..1b1c92f7 100644 --- a/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.user; -import com.wansensoft.entities.user.SysUserRoleRel; +import com.wansensoft.entities.SysUserRoleRel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 用户角色关系表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysUserRoleRelMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java index e097c18a..4687b6cc 100644 --- a/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.user; -import com.wansensoft.entities.user.SysUserWarehouseRel; +import com.wansensoft.entities.SysUserWarehouseRel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface SysUserWarehouseRelMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapper.java new file mode 100644 index 00000000..38040379 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.user; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.entities.user.UserBusinessExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface UserBusinessMapper extends BaseMapper { + long countByExample(UserBusinessExample example); + + int deleteByExample(UserBusinessExample example); + + int deleteByPrimaryKey(Long id); + + int insertUserBusiness(UserBusiness record); + + int insertSelective(UserBusiness record); + + List selectByExample(UserBusinessExample example); + + UserBusiness selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example); + + int updateByExample(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example); + + int updateByPrimaryKeySelective(UserBusiness record); + + int updateByPrimaryKey(UserBusiness record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapperEx.java new file mode 100644 index 00000000..143c6677 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/UserBusinessMapperEx.java @@ -0,0 +1,14 @@ +package com.wansensoft.mappers.user; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.user.UserBusiness; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import java.util.Date; + +@Mapper +public interface UserBusinessMapperEx extends BaseMapper { + + int batchDeleteUserBusinessByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/UserMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/UserMapper.java new file mode 100644 index 00000000..7ea2695f --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/UserMapper.java @@ -0,0 +1,35 @@ +package com.wansensoft.mappers.user; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserExample; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface UserMapper extends BaseMapper { + long countByExample(UserExample example); + + int deleteByExample(UserExample example); + + int deleteByPrimaryKey(Long id); + + int insertUser(User record); + + int insertSelective(User record); + + List selectByExample(UserExample example); + + User selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + int updateByPrimaryKeySelective(User record); + + int updateByPrimaryKey(User record); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java new file mode 100644 index 00000000..fb324807 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java @@ -0,0 +1,52 @@ +package com.wansensoft.mappers.user; + +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserEx; +import com.wansensoft.vo.TreeNodeEx; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface UserMapperEx extends BaseMapper { + + List selectByConditionUser( + @Param("userName") String userName, + @Param("loginName") String loginName, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + Long countsByUser( + @Param("userName") String userName, + @Param("loginName") String loginName); + + @InterceptorIgnore(tenantLine = "true") + List getUserListByUserNameOrLoginName(@Param("userName") String userName, + @Param("loginName") String loginName); + + int batDeleteOrUpdateUser(@Param("ids") String ids[], @Param("status") byte status); + + List getNodeTree(); + List getNextNodeTree(Map parameterMap); + + @InterceptorIgnore(tenantLine = "true") + void disableUserByLimit(@Param("tenantId") Long tenantId); + + List getListByOrgaId( + @Param("id") Long id, + @Param("orgaId") Long orgaId); + + @InterceptorIgnore(tenantLine = "true") + User getUserByWeixinOpenId( + @Param("weixinOpenId") String weixinOpenId); + + @InterceptorIgnore(tenantLine = "true") + int updateUserWithWeixinOpenId( + @Param("loginName") String loginName, + @Param("password") String password, + @Param("weixinOpenId") String weixinOpenId); +} \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java index 0448e6bc..49cbad46 100644 --- a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.warehouse; -import com.wansensoft.entities.warehouse.WarehouseHead; +import com.wansensoft.entities.WarehouseHead; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 单据主表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface WarehouseHeadMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java index 37d096b6..e5cc8eea 100644 --- a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.warehouse; -import com.wansensoft.entities.warehouse.WarehouseItem; +import com.wansensoft.entities.WarehouseItem; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 单据子表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface WarehouseItemMapper extends BaseMapper { diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java index 377774c0..7eab2b75 100644 --- a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.mappers.warehouse; -import com.wansensoft.entities.warehouse.Warehouse; +import com.wansensoft.entities.Warehouse; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** *

* 仓库表 Mapper 接口 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface WarehouseMapper extends BaseMapper { diff --git a/dao/src/main/resources/mapper_xml/AccountHeadMapper.xml b/dao/src/main/resources/mapper_xml/AccountHeadMapper.xml new file mode 100644 index 00000000..e3d3fb4e --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountHeadMapper.xml @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, organ_id, hands_person_id, creator, change_amount, discount_money, total_price, + account_id, bill_no, bill_time, remark, file_name, status, source, tenant_id, delete_flag + + + + + delete from jsh_account_head + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account_head + + + + + + insert into jsh_account_head (id, type, organ_id, + hands_person_id, creator, change_amount, + discount_money, total_price, account_id, + bill_no, bill_time, remark, + file_name, status, source, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organId,jdbcType=BIGINT}, + #{handsPersonId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, + #{discountMoney,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL}, #{accountId,jdbcType=BIGINT}, + #{billNo,jdbcType=VARCHAR}, #{billTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, + #{fileName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_account_head + + + id, + + + type, + + + organ_id, + + + hands_person_id, + + + creator, + + + change_amount, + + + discount_money, + + + total_price, + + + account_id, + + + bill_no, + + + bill_time, + + + remark, + + + file_name, + + + status, + + + source, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{organId,jdbcType=BIGINT}, + + + #{handsPersonId,jdbcType=BIGINT}, + + + #{creator,jdbcType=BIGINT}, + + + #{changeAmount,jdbcType=DECIMAL}, + + + #{discountMoney,jdbcType=DECIMAL}, + + + #{totalPrice,jdbcType=DECIMAL}, + + + #{accountId,jdbcType=BIGINT}, + + + #{billNo,jdbcType=VARCHAR}, + + + #{billTime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + #{fileName,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account_head + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + organ_id = #{record.organId,jdbcType=BIGINT}, + + + hands_person_id = #{record.handsPersonId,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + + + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + + + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + bill_no = #{record.billNo,jdbcType=VARCHAR}, + + + bill_time = #{record.billTime,jdbcType=TIMESTAMP}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + file_name = #{record.fileName,jdbcType=VARCHAR}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + source = #{record.source,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account_head + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + organ_id = #{record.organId,jdbcType=BIGINT}, + hands_person_id = #{record.handsPersonId,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=BIGINT}, + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + account_id = #{record.accountId,jdbcType=BIGINT}, + bill_no = #{record.billNo,jdbcType=VARCHAR}, + bill_time = #{record.billTime,jdbcType=TIMESTAMP}, + remark = #{record.remark,jdbcType=VARCHAR}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + status = #{record.status,jdbcType=VARCHAR}, + source = #{record.source,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account_head + + + type = #{type,jdbcType=VARCHAR}, + + + organ_id = #{organId,jdbcType=BIGINT}, + + + hands_person_id = #{handsPersonId,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=BIGINT}, + + + change_amount = #{changeAmount,jdbcType=DECIMAL}, + + + discount_money = #{discountMoney,jdbcType=DECIMAL}, + + + total_price = #{totalPrice,jdbcType=DECIMAL}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + bill_no = #{billNo,jdbcType=VARCHAR}, + + + bill_time = #{billTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account_head + set type = #{type,jdbcType=VARCHAR}, + organ_id = #{organId,jdbcType=BIGINT}, + hands_person_id = #{handsPersonId,jdbcType=BIGINT}, + creator = #{creator,jdbcType=BIGINT}, + change_amount = #{changeAmount,jdbcType=DECIMAL}, + discount_money = #{discountMoney,jdbcType=DECIMAL}, + total_price = #{totalPrice,jdbcType=DECIMAL}, + account_id = #{accountId,jdbcType=BIGINT}, + bill_no = #{billNo,jdbcType=VARCHAR}, + bill_time = #{billTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR}, + file_name = #{fileName,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/AccountHeadMapperEx.xml b/dao/src/main/resources/mapper_xml/AccountHeadMapperEx.xml new file mode 100644 index 00000000..6d91814d --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountHeadMapperEx.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + update jsh_account_head + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/AccountItemMapper.xml b/dao/src/main/resources/mapper_xml/AccountItemMapper.xml new file mode 100644 index 00000000..d6b37fc2 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountItemMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, header_id, account_id, in_out_item_id, bill_id, need_debt, finish_debt, each_amount, + remark, tenant_id, delete_flag + + + + + delete from jsh_account_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account_item + + + + + + insert into jsh_account_item (id, header_id, account_id, + in_out_item_id, bill_id, need_debt, + finish_debt, each_amount, remark, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, + #{inOutItemId,jdbcType=BIGINT}, #{billId,jdbcType=BIGINT}, #{needDebt,jdbcType=DECIMAL}, + #{finishDebt,jdbcType=DECIMAL}, #{eachAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_account_item + + + id, + + + header_id, + + + account_id, + + + in_out_item_id, + + + bill_id, + + + need_debt, + + + finish_debt, + + + each_amount, + + + remark, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{headerId,jdbcType=BIGINT}, + + + #{accountId,jdbcType=BIGINT}, + + + #{inOutItemId,jdbcType=BIGINT}, + + + #{billId,jdbcType=BIGINT}, + + + #{needDebt,jdbcType=DECIMAL}, + + + #{finishDebt,jdbcType=DECIMAL}, + + + #{eachAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account_item + + + id = #{record.id,jdbcType=BIGINT}, + + + header_id = #{record.headerId,jdbcType=BIGINT}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT}, + + + bill_id = #{record.billId,jdbcType=BIGINT}, + + + need_debt = #{record.needDebt,jdbcType=DECIMAL}, + + + finish_debt = #{record.finishDebt,jdbcType=DECIMAL}, + + + each_amount = #{record.eachAmount,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account_item + set id = #{record.id,jdbcType=BIGINT}, + header_id = #{record.headerId,jdbcType=BIGINT}, + account_id = #{record.accountId,jdbcType=BIGINT}, + in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT}, + bill_id = #{record.billId,jdbcType=BIGINT}, + need_debt = #{record.needDebt,jdbcType=DECIMAL}, + finish_debt = #{record.finishDebt,jdbcType=DECIMAL}, + each_amount = #{record.eachAmount,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account_item + + + header_id = #{headerId,jdbcType=BIGINT}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + in_out_item_id = #{inOutItemId,jdbcType=BIGINT}, + + + bill_id = #{billId,jdbcType=BIGINT}, + + + need_debt = #{needDebt,jdbcType=DECIMAL}, + + + finish_debt = #{finishDebt,jdbcType=DECIMAL}, + + + each_amount = #{eachAmount,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account_item + set header_id = #{headerId,jdbcType=BIGINT}, + account_id = #{accountId,jdbcType=BIGINT}, + in_out_item_id = #{inOutItemId,jdbcType=BIGINT}, + bill_id = #{billId,jdbcType=BIGINT}, + need_debt = #{needDebt,jdbcType=DECIMAL}, + finish_debt = #{finishDebt,jdbcType=DECIMAL}, + each_amount = #{eachAmount,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/AccountItemMapperEx.xml b/dao/src/main/resources/mapper_xml/AccountItemMapperEx.xml new file mode 100644 index 00000000..6998c62b --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountItemMapperEx.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + update jsh_account_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + update jsh_account_item + set delete_flag='1' + where 1=1 + and header_id in ( + + #{id} + + ) + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/AccountMapper.xml b/dao/src/main/resources/mapper_xml/AccountMapper.xml new file mode 100644 index 00000000..2d221776 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, serial_no, initial_amount, current_amount, remark, enabled, sort, is_default, + tenant_id, delete_flag + + + + + delete from jsh_account + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_account + + + + + + insert into jsh_account (id, name, serial_no, + initial_amount, current_amount, remark, + enabled, sort, is_default, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR}, + #{initialAmount,jdbcType=DECIMAL}, #{currentAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, + #{enabled,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{isDefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_account + + + id, + + + name, + + + serial_no, + + + initial_amount, + + + current_amount, + + + remark, + + + enabled, + + + sort, + + + is_default, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{serialNo,jdbcType=VARCHAR}, + + + #{initialAmount,jdbcType=DECIMAL}, + + + #{currentAmount,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{isDefault,jdbcType=BIT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_account + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + + + initial_amount = #{record.initialAmount,jdbcType=DECIMAL}, + + + current_amount = #{record.currentAmount,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + is_default = #{record.isDefault,jdbcType=BIT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_account + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + initial_amount = #{record.initialAmount,jdbcType=DECIMAL}, + current_amount = #{record.currentAmount,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + is_default = #{record.isDefault,jdbcType=BIT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_account + + + name = #{name,jdbcType=VARCHAR}, + + + serial_no = #{serialNo,jdbcType=VARCHAR}, + + + initial_amount = #{initialAmount,jdbcType=DECIMAL}, + + + current_amount = #{currentAmount,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + is_default = #{isDefault,jdbcType=BIT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_account + set name = #{name,jdbcType=VARCHAR}, + serial_no = #{serialNo,jdbcType=VARCHAR}, + initial_amount = #{initialAmount,jdbcType=DECIMAL}, + current_amount = #{currentAmount,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + is_default = #{isDefault,jdbcType=BIT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/AccountMapperEx.xml b/dao/src/main/resources/mapper_xml/AccountMapperEx.xml new file mode 100644 index 00000000..67dd93b9 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/AccountMapperEx.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_account + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/DepotHeadMapper.xml b/dao/src/main/resources/mapper_xml/DepotHeadMapper.xml new file mode 100644 index 00000000..9e891a50 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotHeadMapper.xml @@ -0,0 +1,623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, sub_type, default_number, number, create_time, oper_time, organ_id, creator, + account_id, change_amount, back_amount, total_price, pay_type, bill_type, remark, + file_name, sales_man, account_id_list, account_money_list, discount, discount_money, + discount_last_money, other_money, deposit, status, purchase_status, source, link_number, + tenant_id, delete_flag + + + + + delete from jsh_depot_head + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_depot_head + + + + + + insert into jsh_depot_head (id, type, sub_type, + default_number, number, create_time, + oper_time, organ_id, creator, + account_id, change_amount, back_amount, + total_price, pay_type, bill_type, + remark, file_name, sales_man, + account_id_list, account_money_list, discount, + discount_money, discount_last_money, other_money, + deposit, status, purchase_status, + source, link_number, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR}, + #{defaultNumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, + #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, #{backAmount,jdbcType=DECIMAL}, + #{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{billType,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{salesMan,jdbcType=VARCHAR}, + #{accountIdList,jdbcType=VARCHAR}, #{accountMoneyList,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL}, + #{discountMoney,jdbcType=DECIMAL}, #{discountLastMoney,jdbcType=DECIMAL}, #{otherMoney,jdbcType=DECIMAL}, + #{deposit,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{purchaseStatus,jdbcType=VARCHAR}, + #{source,jdbcType=VARCHAR}, #{linkNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_depot_head + + + id, + + + type, + + + sub_type, + + + default_number, + + + number, + + + create_time, + + + oper_time, + + + organ_id, + + + creator, + + + account_id, + + + change_amount, + + + back_amount, + + + total_price, + + + pay_type, + + + bill_type, + + + remark, + + + file_name, + + + sales_man, + + + account_id_list, + + + account_money_list, + + + discount, + + + discount_money, + + + discount_last_money, + + + other_money, + + + deposit, + + + status, + + + purchase_status, + + + source, + + + link_number, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{subType,jdbcType=VARCHAR}, + + + #{defaultNumber,jdbcType=VARCHAR}, + + + #{number,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{operTime,jdbcType=TIMESTAMP}, + + + #{organId,jdbcType=BIGINT}, + + + #{creator,jdbcType=BIGINT}, + + + #{accountId,jdbcType=BIGINT}, + + + #{changeAmount,jdbcType=DECIMAL}, + + + #{backAmount,jdbcType=DECIMAL}, + + + #{totalPrice,jdbcType=DECIMAL}, + + + #{payType,jdbcType=VARCHAR}, + + + #{billType,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{fileName,jdbcType=VARCHAR}, + + + #{salesMan,jdbcType=VARCHAR}, + + + #{accountIdList,jdbcType=VARCHAR}, + + + #{accountMoneyList,jdbcType=VARCHAR}, + + + #{discount,jdbcType=DECIMAL}, + + + #{discountMoney,jdbcType=DECIMAL}, + + + #{discountLastMoney,jdbcType=DECIMAL}, + + + #{otherMoney,jdbcType=DECIMAL}, + + + #{deposit,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{purchaseStatus,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{linkNumber,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_depot_head + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + sub_type = #{record.subType,jdbcType=VARCHAR}, + + + default_number = #{record.defaultNumber,jdbcType=VARCHAR}, + + + number = #{record.number,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + oper_time = #{record.operTime,jdbcType=TIMESTAMP}, + + + organ_id = #{record.organId,jdbcType=BIGINT}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + account_id = #{record.accountId,jdbcType=BIGINT}, + + + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + + + back_amount = #{record.backAmount,jdbcType=DECIMAL}, + + + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + + + pay_type = #{record.payType,jdbcType=VARCHAR}, + + + bill_type = #{record.billType,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + file_name = #{record.fileName,jdbcType=VARCHAR}, + + + sales_man = #{record.salesMan,jdbcType=VARCHAR}, + + + account_id_list = #{record.accountIdList,jdbcType=VARCHAR}, + + + account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR}, + + + discount = #{record.discount,jdbcType=DECIMAL}, + + + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + + + discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL}, + + + other_money = #{record.otherMoney,jdbcType=DECIMAL}, + + + deposit = #{record.deposit,jdbcType=DECIMAL}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR}, + + + source = #{record.source,jdbcType=VARCHAR}, + + + link_number = #{record.linkNumber,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_depot_head + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + sub_type = #{record.subType,jdbcType=VARCHAR}, + default_number = #{record.defaultNumber,jdbcType=VARCHAR}, + number = #{record.number,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + oper_time = #{record.operTime,jdbcType=TIMESTAMP}, + organ_id = #{record.organId,jdbcType=BIGINT}, + creator = #{record.creator,jdbcType=BIGINT}, + account_id = #{record.accountId,jdbcType=BIGINT}, + change_amount = #{record.changeAmount,jdbcType=DECIMAL}, + back_amount = #{record.backAmount,jdbcType=DECIMAL}, + total_price = #{record.totalPrice,jdbcType=DECIMAL}, + pay_type = #{record.payType,jdbcType=VARCHAR}, + bill_type = #{record.billType,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + file_name = #{record.fileName,jdbcType=VARCHAR}, + sales_man = #{record.salesMan,jdbcType=VARCHAR}, + account_id_list = #{record.accountIdList,jdbcType=VARCHAR}, + account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR}, + discount = #{record.discount,jdbcType=DECIMAL}, + discount_money = #{record.discountMoney,jdbcType=DECIMAL}, + discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL}, + other_money = #{record.otherMoney,jdbcType=DECIMAL}, + deposit = #{record.deposit,jdbcType=DECIMAL}, + status = #{record.status,jdbcType=VARCHAR}, + purchase_status = #{record.purchaseStatus,jdbcType=VARCHAR}, + source = #{record.source,jdbcType=VARCHAR}, + link_number = #{record.linkNumber,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_depot_head + + + type = #{type,jdbcType=VARCHAR}, + + + sub_type = #{subType,jdbcType=VARCHAR}, + + + default_number = #{defaultNumber,jdbcType=VARCHAR}, + + + number = #{number,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + oper_time = #{operTime,jdbcType=TIMESTAMP}, + + + organ_id = #{organId,jdbcType=BIGINT}, + + + creator = #{creator,jdbcType=BIGINT}, + + + account_id = #{accountId,jdbcType=BIGINT}, + + + change_amount = #{changeAmount,jdbcType=DECIMAL}, + + + back_amount = #{backAmount,jdbcType=DECIMAL}, + + + total_price = #{totalPrice,jdbcType=DECIMAL}, + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + bill_type = #{billType,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + file_name = #{fileName,jdbcType=VARCHAR}, + + + sales_man = #{salesMan,jdbcType=VARCHAR}, + + + account_id_list = #{accountIdList,jdbcType=VARCHAR}, + + + account_money_list = #{accountMoneyList,jdbcType=VARCHAR}, + + + discount = #{discount,jdbcType=DECIMAL}, + + + discount_money = #{discountMoney,jdbcType=DECIMAL}, + + + discount_last_money = #{discountLastMoney,jdbcType=DECIMAL}, + + + other_money = #{otherMoney,jdbcType=DECIMAL}, + + + deposit = #{deposit,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=VARCHAR}, + + + purchase_status = #{purchaseStatus,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + link_number = #{linkNumber,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_depot_head + set type = #{type,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=VARCHAR}, + default_number = #{defaultNumber,jdbcType=VARCHAR}, + number = #{number,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + oper_time = #{operTime,jdbcType=TIMESTAMP}, + organ_id = #{organId,jdbcType=BIGINT}, + creator = #{creator,jdbcType=BIGINT}, + account_id = #{accountId,jdbcType=BIGINT}, + change_amount = #{changeAmount,jdbcType=DECIMAL}, + back_amount = #{backAmount,jdbcType=DECIMAL}, + total_price = #{totalPrice,jdbcType=DECIMAL}, + pay_type = #{payType,jdbcType=VARCHAR}, + bill_type = #{billType,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + file_name = #{fileName,jdbcType=VARCHAR}, + sales_man = #{salesMan,jdbcType=VARCHAR}, + account_id_list = #{accountIdList,jdbcType=VARCHAR}, + account_money_list = #{accountMoneyList,jdbcType=VARCHAR}, + discount = #{discount,jdbcType=DECIMAL}, + discount_money = #{discountMoney,jdbcType=DECIMAL}, + discount_last_money = #{discountLastMoney,jdbcType=DECIMAL}, + other_money = #{otherMoney,jdbcType=DECIMAL}, + deposit = #{deposit,jdbcType=DECIMAL}, + status = #{status,jdbcType=VARCHAR}, + purchase_status = #{purchaseStatus,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + link_number = #{linkNumber,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/dao/src/main/resources/mapper_xml/DepotHeadMapperEx.xml new file mode 100644 index 00000000..524e6ab7 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -0,0 +1,1100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_depot_head + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + update jsh_depot_head dh set dh.account_id = null + where dh.id=#{id} + and ifnull(dh.delete_flag,'0') !='1' + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/DepotItemMapper.xml b/dao/src/main/resources/mapper_xml/DepotItemMapper.xml new file mode 100644 index 00000000..0235862f --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotItemMapper.xml @@ -0,0 +1,528 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, + basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark, + depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list, + batch_number, expiration_date, link_id, tenant_id, delete_flag + + + + + delete from jsh_depot_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_depot_item + + + + + + insert into jsh_depot_item (id, header_id, material_id, + material_extend_id, material_unit, sku, + oper_number, basic_number, unit_price, + purchase_unit_price, tax_unit_price, all_price, + remark, depot_id, another_depot_id, + tax_rate, tax_money, tax_last_money, + material_type, sn_list, batch_number, + expiration_date, link_id, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, + #{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, + #{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL}, + #{purchaseUnitPrice,jdbcType=DECIMAL}, #{taxUnitPrice,jdbcType=DECIMAL}, #{allPrice,jdbcType=DECIMAL}, + #{remark,jdbcType=VARCHAR}, #{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, + #{taxRate,jdbcType=DECIMAL}, #{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, + #{materialType,jdbcType=VARCHAR}, #{snList,jdbcType=VARCHAR}, #{batchNumber,jdbcType=VARCHAR}, + #{expirationDate,jdbcType=TIMESTAMP}, #{linkId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_depot_item + + + id, + + + header_id, + + + material_id, + + + material_extend_id, + + + material_unit, + + + sku, + + + oper_number, + + + basic_number, + + + unit_price, + + + purchase_unit_price, + + + tax_unit_price, + + + all_price, + + + remark, + + + depot_id, + + + another_depot_id, + + + tax_rate, + + + tax_money, + + + tax_last_money, + + + material_type, + + + sn_list, + + + batch_number, + + + expiration_date, + + + link_id, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{headerId,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{materialExtendId,jdbcType=BIGINT}, + + + #{materialUnit,jdbcType=VARCHAR}, + + + #{sku,jdbcType=VARCHAR}, + + + #{operNumber,jdbcType=DECIMAL}, + + + #{basicNumber,jdbcType=DECIMAL}, + + + #{unitPrice,jdbcType=DECIMAL}, + + + #{purchaseUnitPrice,jdbcType=DECIMAL}, + + + #{taxUnitPrice,jdbcType=DECIMAL}, + + + #{allPrice,jdbcType=DECIMAL}, + + + #{remark,jdbcType=VARCHAR}, + + + #{depotId,jdbcType=BIGINT}, + + + #{anotherDepotId,jdbcType=BIGINT}, + + + #{taxRate,jdbcType=DECIMAL}, + + + #{taxMoney,jdbcType=DECIMAL}, + + + #{taxLastMoney,jdbcType=DECIMAL}, + + + #{materialType,jdbcType=VARCHAR}, + + + #{snList,jdbcType=VARCHAR}, + + + #{batchNumber,jdbcType=VARCHAR}, + + + #{expirationDate,jdbcType=TIMESTAMP}, + + + #{linkId,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_depot_item + + + id = #{record.id,jdbcType=BIGINT}, + + + header_id = #{record.headerId,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + material_extend_id = #{record.materialExtendId,jdbcType=BIGINT}, + + + material_unit = #{record.materialUnit,jdbcType=VARCHAR}, + + + sku = #{record.sku,jdbcType=VARCHAR}, + + + oper_number = #{record.operNumber,jdbcType=DECIMAL}, + + + basic_number = #{record.basicNumber,jdbcType=DECIMAL}, + + + unit_price = #{record.unitPrice,jdbcType=DECIMAL}, + + + purchase_unit_price = #{record.purchaseUnitPrice,jdbcType=DECIMAL}, + + + tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL}, + + + all_price = #{record.allPrice,jdbcType=DECIMAL}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT}, + + + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + + + tax_money = #{record.taxMoney,jdbcType=DECIMAL}, + + + tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL}, + + + material_type = #{record.materialType,jdbcType=VARCHAR}, + + + sn_list = #{record.snList,jdbcType=VARCHAR}, + + + batch_number = #{record.batchNumber,jdbcType=VARCHAR}, + + + expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}, + + + link_id = #{record.linkId,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_depot_item + set id = #{record.id,jdbcType=BIGINT}, + header_id = #{record.headerId,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + material_extend_id = #{record.materialExtendId,jdbcType=BIGINT}, + material_unit = #{record.materialUnit,jdbcType=VARCHAR}, + sku = #{record.sku,jdbcType=VARCHAR}, + oper_number = #{record.operNumber,jdbcType=DECIMAL}, + basic_number = #{record.basicNumber,jdbcType=DECIMAL}, + unit_price = #{record.unitPrice,jdbcType=DECIMAL}, + purchase_unit_price = #{record.purchaseUnitPrice,jdbcType=DECIMAL}, + tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL}, + all_price = #{record.allPrice,jdbcType=DECIMAL}, + remark = #{record.remark,jdbcType=VARCHAR}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT}, + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + tax_money = #{record.taxMoney,jdbcType=DECIMAL}, + tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL}, + material_type = #{record.materialType,jdbcType=VARCHAR}, + sn_list = #{record.snList,jdbcType=VARCHAR}, + batch_number = #{record.batchNumber,jdbcType=VARCHAR}, + expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP}, + link_id = #{record.linkId,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_depot_item + + + header_id = #{headerId,jdbcType=BIGINT}, + + + material_id = #{materialId,jdbcType=BIGINT}, + + + material_extend_id = #{materialExtendId,jdbcType=BIGINT}, + + + material_unit = #{materialUnit,jdbcType=VARCHAR}, + + + sku = #{sku,jdbcType=VARCHAR}, + + + oper_number = #{operNumber,jdbcType=DECIMAL}, + + + basic_number = #{basicNumber,jdbcType=DECIMAL}, + + + unit_price = #{unitPrice,jdbcType=DECIMAL}, + + + purchase_unit_price = #{purchaseUnitPrice,jdbcType=DECIMAL}, + + + tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL}, + + + all_price = #{allPrice,jdbcType=DECIMAL}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + another_depot_id = #{anotherDepotId,jdbcType=BIGINT}, + + + tax_rate = #{taxRate,jdbcType=DECIMAL}, + + + tax_money = #{taxMoney,jdbcType=DECIMAL}, + + + tax_last_money = #{taxLastMoney,jdbcType=DECIMAL}, + + + material_type = #{materialType,jdbcType=VARCHAR}, + + + sn_list = #{snList,jdbcType=VARCHAR}, + + + batch_number = #{batchNumber,jdbcType=VARCHAR}, + + + expiration_date = #{expirationDate,jdbcType=TIMESTAMP}, + + + link_id = #{linkId,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_depot_item + set header_id = #{headerId,jdbcType=BIGINT}, + material_id = #{materialId,jdbcType=BIGINT}, + material_extend_id = #{materialExtendId,jdbcType=BIGINT}, + material_unit = #{materialUnit,jdbcType=VARCHAR}, + sku = #{sku,jdbcType=VARCHAR}, + oper_number = #{operNumber,jdbcType=DECIMAL}, + basic_number = #{basicNumber,jdbcType=DECIMAL}, + unit_price = #{unitPrice,jdbcType=DECIMAL}, + purchase_unit_price = #{purchaseUnitPrice,jdbcType=DECIMAL}, + tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL}, + all_price = #{allPrice,jdbcType=DECIMAL}, + remark = #{remark,jdbcType=VARCHAR}, + depot_id = #{depotId,jdbcType=BIGINT}, + another_depot_id = #{anotherDepotId,jdbcType=BIGINT}, + tax_rate = #{taxRate,jdbcType=DECIMAL}, + tax_money = #{taxMoney,jdbcType=DECIMAL}, + tax_last_money = #{taxLastMoney,jdbcType=DECIMAL}, + material_type = #{materialType,jdbcType=VARCHAR}, + sn_list = #{snList,jdbcType=VARCHAR}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + expiration_date = #{expirationDate,jdbcType=TIMESTAMP}, + link_id = #{linkId,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/dao/src/main/resources/mapper_xml/DepotItemMapperEx.xml new file mode 100644 index 00000000..0d22597c --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotItemMapperEx.xml @@ -0,0 +1,1004 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and di.depot_id in #{item} + + + + + + and di.another_depot_id in #{item} + + + + + + + update jsh_depot_item + set delete_flag='1' + where 1=1 + and header_id in + ( + + #{depotheadId} + + ) + + + + update jsh_depot_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dao/src/main/resources/mapper_xml/DepotMapper.xml b/dao/src/main/resources/mapper_xml/DepotMapper.xml new file mode 100644 index 00000000..d3ef1bec --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotMapper.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, address, warehousing, truckage, type, sort, remark, principal, enabled, + tenant_id, delete_Flag, is_default + + + + + delete from jsh_depot + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_depot + + + + + + insert into jsh_depot (id, name, address, + warehousing, truckage, type, + sort, remark, principal, + enabled, tenant_id, delete_Flag, + is_default) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, + #{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, + #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT}, + #{enabled,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}, + #{isDefault,jdbcType=BIT}) + + + insert into jsh_depot + + + id, + + + name, + + + address, + + + warehousing, + + + truckage, + + + type, + + + sort, + + + remark, + + + principal, + + + enabled, + + + tenant_id, + + + delete_Flag, + + + is_default, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{warehousing,jdbcType=DECIMAL}, + + + #{truckage,jdbcType=DECIMAL}, + + + #{type,jdbcType=INTEGER}, + + + #{sort,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{principal,jdbcType=BIGINT}, + + + #{enabled,jdbcType=BIT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + #{isDefault,jdbcType=BIT}, + + + + + + update jsh_depot + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + warehousing = #{record.warehousing,jdbcType=DECIMAL}, + + + truckage = #{record.truckage,jdbcType=DECIMAL}, + + + type = #{record.type,jdbcType=INTEGER}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + principal = #{record.principal,jdbcType=BIGINT}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + is_default = #{record.isDefault,jdbcType=BIT}, + + + + + + + + update jsh_depot + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + warehousing = #{record.warehousing,jdbcType=DECIMAL}, + truckage = #{record.truckage,jdbcType=DECIMAL}, + type = #{record.type,jdbcType=INTEGER}, + sort = #{record.sort,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + principal = #{record.principal,jdbcType=BIGINT}, + enabled = #{record.enabled,jdbcType=BIT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + is_default = #{record.isDefault,jdbcType=BIT} + + + + + + update jsh_depot + + + name = #{name,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + warehousing = #{warehousing,jdbcType=DECIMAL}, + + + truckage = #{truckage,jdbcType=DECIMAL}, + + + type = #{type,jdbcType=INTEGER}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + principal = #{principal,jdbcType=BIGINT}, + + + enabled = #{enabled,jdbcType=BIT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + is_default = #{isDefault,jdbcType=BIT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_depot + set name = #{name,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + warehousing = #{warehousing,jdbcType=DECIMAL}, + truckage = #{truckage,jdbcType=DECIMAL}, + type = #{type,jdbcType=INTEGER}, + sort = #{sort,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + principal = #{principal,jdbcType=BIGINT}, + enabled = #{enabled,jdbcType=BIT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + is_default = #{isDefault,jdbcType=BIT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/DepotMapperEx.xml b/dao/src/main/resources/mapper_xml/DepotMapperEx.xml new file mode 100644 index 00000000..b09d88e1 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/DepotMapperEx.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + update jsh_depot + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/FunctionMapper.xml b/dao/src/main/resources/mapper_xml/FunctionMapper.xml new file mode 100644 index 00000000..33632722 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/FunctionMapper.xml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, number, name, parent_number, url, component, state, sort, enabled, type, push_btn, + icon, delete_flag + + + + + delete from jsh_function + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_function + + + + + + insert into jsh_function (id, number, name, + parent_number, url, component, + state, sort, enabled, type, + push_btn, icon, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{parentNumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{component,jdbcType=VARCHAR}, + #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, + #{pushBtn,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_function + + + id, + + + number, + + + name, + + + parent_number, + + + url, + + + component, + + + state, + + + sort, + + + enabled, + + + type, + + + push_btn, + + + icon, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{number,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{parentNumber,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{component,jdbcType=VARCHAR}, + + + #{state,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{type,jdbcType=VARCHAR}, + + + #{pushBtn,jdbcType=VARCHAR}, + + + #{icon,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_function + + + id = #{record.id,jdbcType=BIGINT}, + + + number = #{record.number,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + parent_number = #{record.parentNumber,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + component = #{record.component,jdbcType=VARCHAR}, + + + state = #{record.state,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + push_btn = #{record.pushBtn,jdbcType=VARCHAR}, + + + icon = #{record.icon,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_function + set id = #{record.id,jdbcType=BIGINT}, + number = #{record.number,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + parent_number = #{record.parentNumber,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + component = #{record.component,jdbcType=VARCHAR}, + state = #{record.state,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + type = #{record.type,jdbcType=VARCHAR}, + push_btn = #{record.pushBtn,jdbcType=VARCHAR}, + icon = #{record.icon,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_function + + + number = #{number,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + parent_number = #{parentNumber,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + component = #{component,jdbcType=VARCHAR}, + + + state = #{state,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + type = #{type,jdbcType=VARCHAR}, + + + push_btn = #{pushBtn,jdbcType=VARCHAR}, + + + icon = #{icon,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_function + set number = #{number,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + parent_number = #{parentNumber,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + state = #{state,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + type = #{type,jdbcType=VARCHAR}, + push_btn = #{pushBtn,jdbcType=VARCHAR}, + icon = #{icon,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/FunctionMapperEx.xml b/dao/src/main/resources/mapper_xml/FunctionMapperEx.xml new file mode 100644 index 00000000..7c99fa00 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/FunctionMapperEx.xml @@ -0,0 +1,51 @@ + + + + + + + + + + update jsh_function + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/InOutItemMapper.xml b/dao/src/main/resources/mapper_xml/InOutItemMapper.xml new file mode 100644 index 00000000..0be02251 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/InOutItemMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, type, remark, enabled, sort, tenant_id, delete_flag + + + + + delete from jsh_in_out_item + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_in_out_item + + + + + + insert into jsh_in_out_item (id, name, type, + remark, enabled, sort, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_in_out_item + + + id, + + + name, + + + type, + + + remark, + + + enabled, + + + sort, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_in_out_item + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_in_out_item + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_in_out_item + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_in_out_item + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/InOutItemMapperEx.xml b/dao/src/main/resources/mapper_xml/InOutItemMapperEx.xml new file mode 100644 index 00000000..0e074bdb --- /dev/null +++ b/dao/src/main/resources/mapper_xml/InOutItemMapperEx.xml @@ -0,0 +1,53 @@ + + + + + + + update jsh_in_out_item + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/LogMapper.xml b/dao/src/main/resources/mapper_xml/LogMapper.xml new file mode 100644 index 00000000..c56dea11 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/LogMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, user_id, operation, client_ip, create_time, status, content, tenant_id + + + + + delete from jsh_log + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_log + + + + + + insert into jsh_log (id, user_id, operation, + client_ip, create_time, status, + content, tenant_id) + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR}, + #{clientIp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, + #{content,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) + + + insert into jsh_log + + + id, + + + user_id, + + + operation, + + + client_ip, + + + create_time, + + + status, + + + content, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{operation,jdbcType=VARCHAR}, + + + #{clientIp,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{status,jdbcType=TINYINT}, + + + #{content,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + update jsh_log + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + operation = #{record.operation,jdbcType=VARCHAR}, + + + client_ip = #{record.clientIp,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + status = #{record.status,jdbcType=TINYINT}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_log + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + operation = #{record.operation,jdbcType=VARCHAR}, + client_ip = #{record.clientIp,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + status = #{record.status,jdbcType=TINYINT}, + content = #{record.content,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_log + + + user_id = #{userId,jdbcType=BIGINT}, + + + operation = #{operation,jdbcType=VARCHAR}, + + + client_ip = #{clientIp,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + status = #{status,jdbcType=TINYINT}, + + + content = #{content,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_log + set user_id = #{userId,jdbcType=BIGINT}, + operation = #{operation,jdbcType=VARCHAR}, + client_ip = #{clientIp,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + status = #{status,jdbcType=TINYINT}, + content = #{content,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/LogMapperEx.xml b/dao/src/main/resources/mapper_xml/LogMapperEx.xml new file mode 100644 index 00000000..c6b1ea40 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/LogMapperEx.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + insert into jsh_log (user_id, operation, + client_ip, create_time, status, + content, tenant_id) + values (#{userId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR}, + #{clientIp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, + #{content,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialAttributeMapper.xml b/dao/src/main/resources/mapper_xml/MaterialAttributeMapper.xml new file mode 100644 index 00000000..21cb35b9 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialAttributeMapper.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, attribute_name, attribute_value, tenant_id, delete_flag + + + + + delete from jsh_material_attribute + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_attribute + + + + + + insert into jsh_material_attribute (id, attribute_name, attribute_value, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{attributeName,jdbcType=VARCHAR}, #{attributeValue,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_attribute + + + id, + + + attribute_name, + + + attribute_value, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{attributeName,jdbcType=VARCHAR}, + + + #{attributeValue,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_attribute + + + id = #{record.id,jdbcType=BIGINT}, + + + attribute_name = #{record.attributeName,jdbcType=VARCHAR}, + + + attribute_value = #{record.attributeValue,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_attribute + set id = #{record.id,jdbcType=BIGINT}, + attribute_name = #{record.attributeName,jdbcType=VARCHAR}, + attribute_value = #{record.attributeValue,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_attribute + + + attribute_name = #{attributeName,jdbcType=VARCHAR}, + + + attribute_value = #{attributeValue,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_attribute + set attribute_name = #{attributeName,jdbcType=VARCHAR}, + attribute_value = #{attributeValue,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialAttributeMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialAttributeMapperEx.xml new file mode 100644 index 00000000..2d1db0e6 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialAttributeMapperEx.xml @@ -0,0 +1,39 @@ + + + + + + + + + + update jsh_material_attribute + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialCategoryMapper.xml b/dao/src/main/resources/mapper_xml/MaterialCategoryMapper.xml new file mode 100644 index 00000000..3145a378 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialCategoryMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, category_level, parent_id, sort, serial_no, remark, create_time, update_time, + tenant_id, delete_flag + + + + + delete from jsh_material_category + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_category + + + + + + insert into jsh_material_category (id, name, category_level, + parent_id, sort, serial_no, + remark, create_time, update_time, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{categoryLevel,jdbcType=SMALLINT}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_category + + + id, + + + name, + + + category_level, + + + parent_id, + + + sort, + + + serial_no, + + + remark, + + + create_time, + + + update_time, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{categoryLevel,jdbcType=SMALLINT}, + + + #{parentId,jdbcType=BIGINT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{serialNo,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_category + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + category_level = #{record.categoryLevel,jdbcType=SMALLINT}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_category + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + category_level = #{record.categoryLevel,jdbcType=SMALLINT}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + sort = #{record.sort,jdbcType=VARCHAR}, + serial_no = #{record.serialNo,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_category + + + name = #{name,jdbcType=VARCHAR}, + + + category_level = #{categoryLevel,jdbcType=SMALLINT}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + serial_no = #{serialNo,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_category + set name = #{name,jdbcType=VARCHAR}, + category_level = #{categoryLevel,jdbcType=SMALLINT}, + parent_id = #{parentId,jdbcType=BIGINT}, + sort = #{sort,jdbcType=VARCHAR}, + serial_no = #{serialNo,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml new file mode 100644 index 00000000..2a6a02e7 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialCategoryMapperEx.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, name + + + + + + + insert into jsh_material_category + (name, category_level, parent_id, sort,status,serial_no,remark, + create_time, update_time) + values + (#{name},#{categoryLevel},#{parentId},#{sort},#{status},#{serialNo},#{remark}, + #{createTime},#{updateTime} + ) + + + update jsh_material_category + set update_time=#{updateTime},delete_flag='1' + where id in ( + + #{id} + + ) + + + update jsh_material_category + set update_time=#{updateTime}, + parent_id=#{parentId},sort=#{sort},serial_no=#{serialNo}, + name=#{name},remark=#{remark} + where id =#{id} + + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml b/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml new file mode 100644 index 00000000..9beb4761 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, depot_id, current_number, tenant_id, delete_flag + + + + + delete from jsh_material_current_stock + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_current_stock + + + + + + insert into jsh_material_current_stock (id, material_id, depot_id, + current_number, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT}, + #{currentNumber,jdbcType=DECIMAL}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_material_current_stock + + + id, + + + material_id, + + + depot_id, + + + current_number, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{depotId,jdbcType=BIGINT}, + + + #{currentNumber,jdbcType=DECIMAL}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_current_stock + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + current_number = #{record.currentNumber,jdbcType=DECIMAL}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_current_stock + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + current_number = #{record.currentNumber,jdbcType=DECIMAL}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_current_stock + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + current_number = #{currentNumber,jdbcType=DECIMAL}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_current_stock + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + current_number = #{currentNumber,jdbcType=DECIMAL}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapperEx.xml new file mode 100644 index 00000000..18b2dbf4 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialCurrentStockMapperEx.xml @@ -0,0 +1,24 @@ + + + + + + insert into jsh_material_current_stock (material_id, depot_id, current_number) + values + + (#{item.materialId,jdbcType=BIGINT}, #{item.depotId,jdbcType=BIGINT},#{item.currentNumber,jdbcType=DECIMAL}) + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialExtendMapper.xml b/dao/src/main/resources/mapper_xml/MaterialExtendMapper.xml new file mode 100644 index 00000000..ce83d9f7 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialExtendMapper.xml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, bar_code, commodity_unit, sku, purchase_decimal, commodity_decimal, + wholesale_decimal, low_decimal, default_flag, create_time, create_serial, update_serial, + update_time, tenant_id, delete_Flag + + + + + delete from jsh_material_extend + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_extend + + + + + + insert into jsh_material_extend (id, material_id, bar_code, + commodity_unit, sku, purchase_decimal, + commodity_decimal, wholesale_decimal, low_decimal, + default_flag, create_time, create_serial, + update_serial, update_time, tenant_id, + delete_Flag) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR}, + #{commodityUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL}, + #{commodityDecimal,jdbcType=DECIMAL}, #{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL}, + #{defaultFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR}, + #{updateSerial,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_extend + + + id, + + + material_id, + + + bar_code, + + + commodity_unit, + + + sku, + + + purchase_decimal, + + + commodity_decimal, + + + wholesale_decimal, + + + low_decimal, + + + default_flag, + + + create_time, + + + create_serial, + + + update_serial, + + + update_time, + + + tenant_id, + + + delete_Flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{barCode,jdbcType=VARCHAR}, + + + #{commodityUnit,jdbcType=VARCHAR}, + + + #{sku,jdbcType=VARCHAR}, + + + #{purchaseDecimal,jdbcType=DECIMAL}, + + + #{commodityDecimal,jdbcType=DECIMAL}, + + + #{wholesaleDecimal,jdbcType=DECIMAL}, + + + #{lowDecimal,jdbcType=DECIMAL}, + + + #{defaultFlag,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{createSerial,jdbcType=VARCHAR}, + + + #{updateSerial,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_extend + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + bar_code = #{record.barCode,jdbcType=VARCHAR}, + + + commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR}, + + + sku = #{record.sku,jdbcType=VARCHAR}, + + + purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL}, + + + commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL}, + + + wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL}, + + + low_decimal = #{record.lowDecimal,jdbcType=DECIMAL}, + + + default_flag = #{record.defaultFlag,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + create_serial = #{record.createSerial,jdbcType=VARCHAR}, + + + update_serial = #{record.updateSerial,jdbcType=VARCHAR}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_extend + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + bar_code = #{record.barCode,jdbcType=VARCHAR}, + commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR}, + sku = #{record.sku,jdbcType=VARCHAR}, + purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL}, + commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL}, + wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL}, + low_decimal = #{record.lowDecimal,jdbcType=DECIMAL}, + default_flag = #{record.defaultFlag,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + create_serial = #{record.createSerial,jdbcType=VARCHAR}, + update_serial = #{record.updateSerial,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_extend + + + material_id = #{materialId,jdbcType=BIGINT}, + + + bar_code = #{barCode,jdbcType=VARCHAR}, + + + commodity_unit = #{commodityUnit,jdbcType=VARCHAR}, + + + sku = #{sku,jdbcType=VARCHAR}, + + + purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL}, + + + commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL}, + + + wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL}, + + + low_decimal = #{lowDecimal,jdbcType=DECIMAL}, + + + default_flag = #{defaultFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + create_serial = #{createSerial,jdbcType=VARCHAR}, + + + update_serial = #{updateSerial,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_extend + set material_id = #{materialId,jdbcType=BIGINT}, + bar_code = #{barCode,jdbcType=VARCHAR}, + commodity_unit = #{commodityUnit,jdbcType=VARCHAR}, + sku = #{sku,jdbcType=VARCHAR}, + purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL}, + commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL}, + wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL}, + low_decimal = #{lowDecimal,jdbcType=DECIMAL}, + default_flag = #{defaultFlag,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + create_serial = #{createSerial,jdbcType=VARCHAR}, + update_serial = #{updateSerial,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml new file mode 100644 index 00000000..b22e932f --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialExtendMapperEx.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + update jsh_material_extend + set delete_Flag='1' + where 1=1 + and ifnull(delete_Flag,'0') !='1' + and id in ( + + #{id} + + ) + + + + update jsh_material_extend + set delete_Flag='1' + where 1=1 + and ifnull(delete_Flag,'0') !='1' + and material_id in ( + + #{id} + + ) + + + + update jsh_material_extend + set purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL}, + commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL}, + wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL}, + low_decimal = #{lowDecimal,jdbcType=DECIMAL} + where id = #{id,jdbcType=BIGINT} + and ifnull(delete_flag,'0') !='1' + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialInitialStockMapper.xml b/dao/src/main/resources/mapper_xml/MaterialInitialStockMapper.xml new file mode 100644 index 00000000..be7fe7ce --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialInitialStockMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, depot_id, number, low_safe_stock, high_safe_stock, tenant_id, delete_flag + + + + + delete from jsh_material_initial_stock + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_initial_stock + + + + + + insert into jsh_material_initial_stock (id, material_id, depot_id, + number, low_safe_stock, high_safe_stock, + tenant_id, delete_flag) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT}, + #{number,jdbcType=DECIMAL}, #{lowSafeStock,jdbcType=DECIMAL}, #{highSafeStock,jdbcType=DECIMAL}, + #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material_initial_stock + + + id, + + + material_id, + + + depot_id, + + + number, + + + low_safe_stock, + + + high_safe_stock, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{depotId,jdbcType=BIGINT}, + + + #{number,jdbcType=DECIMAL}, + + + #{lowSafeStock,jdbcType=DECIMAL}, + + + #{highSafeStock,jdbcType=DECIMAL}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_initial_stock + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + number = #{record.number,jdbcType=DECIMAL}, + + + low_safe_stock = #{record.lowSafeStock,jdbcType=DECIMAL}, + + + high_safe_stock = #{record.highSafeStock,jdbcType=DECIMAL}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_initial_stock + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + number = #{record.number,jdbcType=DECIMAL}, + low_safe_stock = #{record.lowSafeStock,jdbcType=DECIMAL}, + high_safe_stock = #{record.highSafeStock,jdbcType=DECIMAL}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_initial_stock + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + number = #{number,jdbcType=DECIMAL}, + + + low_safe_stock = #{lowSafeStock,jdbcType=DECIMAL}, + + + high_safe_stock = #{highSafeStock,jdbcType=DECIMAL}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_initial_stock + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + number = #{number,jdbcType=DECIMAL}, + low_safe_stock = #{lowSafeStock,jdbcType=DECIMAL}, + high_safe_stock = #{highSafeStock,jdbcType=DECIMAL}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml new file mode 100644 index 00000000..f4299f89 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml @@ -0,0 +1,18 @@ + + + + + + insert into jsh_material_initial_stock (material_id, depot_id, number) + values + + (#{item.materialId,jdbcType=BIGINT}, #{item.depotId,jdbcType=BIGINT},#{item.number,jdbcType=DECIMAL}) + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialMapper.xml b/dao/src/main/resources/mapper_xml/MaterialMapper.xml new file mode 100644 index 00000000..f4f91d40 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialMapper.xml @@ -0,0 +1,480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, category_id, name, mfrs, model, standard, color, unit, remark, img_name, unit_id, + expiry_num, weight, enabled, other_field1, other_field2, other_field3, enable_serial_number, + enable_batch_number, position, tenant_id, delete_flag + + + + + delete from jsh_material + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material + + + + + + insert into jsh_material (id, category_id, name, + mfrs, model, standard, + color, unit, remark, + img_name, unit_id, expiry_num, + weight, enabled, other_field1, + other_field2, other_field3, enable_serial_number, + enable_batch_number, position, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, + #{mfrs,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR}, #{standard,jdbcType=VARCHAR}, + #{color,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{imgName,jdbcType=VARCHAR}, #{unitId,jdbcType=BIGINT}, #{expiryNum,jdbcType=INTEGER}, + #{weight,jdbcType=DECIMAL}, #{enabled,jdbcType=BIT}, #{otherField1,jdbcType=VARCHAR}, + #{otherField2,jdbcType=VARCHAR}, #{otherField3,jdbcType=VARCHAR}, #{enableSerialNumber,jdbcType=VARCHAR}, + #{enableBatchNumber,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_material + + + id, + + + category_id, + + + name, + + + mfrs, + + + model, + + + standard, + + + color, + + + unit, + + + remark, + + + img_name, + + + unit_id, + + + expiry_num, + + + weight, + + + enabled, + + + other_field1, + + + other_field2, + + + other_field3, + + + enable_serial_number, + + + enable_batch_number, + + + position, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{categoryId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{mfrs,jdbcType=VARCHAR}, + + + #{model,jdbcType=VARCHAR}, + + + #{standard,jdbcType=VARCHAR}, + + + #{color,jdbcType=VARCHAR}, + + + #{unit,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{imgName,jdbcType=VARCHAR}, + + + #{unitId,jdbcType=BIGINT}, + + + #{expiryNum,jdbcType=INTEGER}, + + + #{weight,jdbcType=DECIMAL}, + + + #{enabled,jdbcType=BIT}, + + + #{otherField1,jdbcType=VARCHAR}, + + + #{otherField2,jdbcType=VARCHAR}, + + + #{otherField3,jdbcType=VARCHAR}, + + + #{enableSerialNumber,jdbcType=VARCHAR}, + + + #{enableBatchNumber,jdbcType=VARCHAR}, + + + #{position,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material + + + id = #{record.id,jdbcType=BIGINT}, + + + category_id = #{record.categoryId,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + mfrs = #{record.mfrs,jdbcType=VARCHAR}, + + + model = #{record.model,jdbcType=VARCHAR}, + + + standard = #{record.standard,jdbcType=VARCHAR}, + + + color = #{record.color,jdbcType=VARCHAR}, + + + unit = #{record.unit,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + img_name = #{record.imgName,jdbcType=VARCHAR}, + + + unit_id = #{record.unitId,jdbcType=BIGINT}, + + + expiry_num = #{record.expiryNum,jdbcType=INTEGER}, + + + weight = #{record.weight,jdbcType=DECIMAL}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + other_field1 = #{record.otherField1,jdbcType=VARCHAR}, + + + other_field2 = #{record.otherField2,jdbcType=VARCHAR}, + + + other_field3 = #{record.otherField3,jdbcType=VARCHAR}, + + + enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR}, + + + enable_batch_number = #{record.enableBatchNumber,jdbcType=VARCHAR}, + + + position = #{record.position,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material + set id = #{record.id,jdbcType=BIGINT}, + category_id = #{record.categoryId,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + mfrs = #{record.mfrs,jdbcType=VARCHAR}, + model = #{record.model,jdbcType=VARCHAR}, + standard = #{record.standard,jdbcType=VARCHAR}, + color = #{record.color,jdbcType=VARCHAR}, + unit = #{record.unit,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + img_name = #{record.imgName,jdbcType=VARCHAR}, + unit_id = #{record.unitId,jdbcType=BIGINT}, + expiry_num = #{record.expiryNum,jdbcType=INTEGER}, + weight = #{record.weight,jdbcType=DECIMAL}, + enabled = #{record.enabled,jdbcType=BIT}, + other_field1 = #{record.otherField1,jdbcType=VARCHAR}, + other_field2 = #{record.otherField2,jdbcType=VARCHAR}, + other_field3 = #{record.otherField3,jdbcType=VARCHAR}, + enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR}, + enable_batch_number = #{record.enableBatchNumber,jdbcType=VARCHAR}, + position = #{record.position,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material + + + category_id = #{categoryId,jdbcType=BIGINT}, + + + name = #{name,jdbcType=VARCHAR}, + + + mfrs = #{mfrs,jdbcType=VARCHAR}, + + + model = #{model,jdbcType=VARCHAR}, + + + standard = #{standard,jdbcType=VARCHAR}, + + + color = #{color,jdbcType=VARCHAR}, + + + unit = #{unit,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + img_name = #{imgName,jdbcType=VARCHAR}, + + + unit_id = #{unitId,jdbcType=BIGINT}, + + + expiry_num = #{expiryNum,jdbcType=INTEGER}, + + + weight = #{weight,jdbcType=DECIMAL}, + + + enabled = #{enabled,jdbcType=BIT}, + + + other_field1 = #{otherField1,jdbcType=VARCHAR}, + + + other_field2 = #{otherField2,jdbcType=VARCHAR}, + + + other_field3 = #{otherField3,jdbcType=VARCHAR}, + + + enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR}, + + + enable_batch_number = #{enableBatchNumber,jdbcType=VARCHAR}, + + + position = #{position,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material + set category_id = #{categoryId,jdbcType=BIGINT}, + name = #{name,jdbcType=VARCHAR}, + mfrs = #{mfrs,jdbcType=VARCHAR}, + model = #{model,jdbcType=VARCHAR}, + standard = #{standard,jdbcType=VARCHAR}, + color = #{color,jdbcType=VARCHAR}, + unit = #{unit,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + img_name = #{imgName,jdbcType=VARCHAR}, + unit_id = #{unitId,jdbcType=BIGINT}, + expiry_num = #{expiryNum,jdbcType=INTEGER}, + weight = #{weight,jdbcType=DECIMAL}, + enabled = #{enabled,jdbcType=BIT}, + other_field1 = #{otherField1,jdbcType=VARCHAR}, + other_field2 = #{otherField2,jdbcType=VARCHAR}, + other_field3 = #{otherField3,jdbcType=VARCHAR}, + enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR}, + enable_batch_number = #{enableBatchNumber,jdbcType=VARCHAR}, + position = #{position,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialMapperEx.xml new file mode 100644 index 00000000..8e9bc7b1 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialMapperEx.xml @@ -0,0 +1,774 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into jsh_material + + + id, + + + category_id, + + + name, + + + mfrs, + + + model, + + + standard, + + + color, + + + unit, + + + remark, + + + img_name, + + + unit_id, + + + expiry_num, + + + weight, + + + enabled, + + + other_field1, + + + other_field2, + + + other_field3, + + + enable_serial_number, + + + enable_batch_number, + + + position, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{categoryId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{mfrs,jdbcType=VARCHAR}, + + + #{model,jdbcType=VARCHAR}, + + + #{standard,jdbcType=VARCHAR}, + + + #{color,jdbcType=VARCHAR}, + + + #{unit,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{imgName,jdbcType=VARCHAR}, + + + #{unitId,jdbcType=BIGINT}, + + + #{expiryNum,jdbcType=INTEGER}, + + + #{weight,jdbcType=DECIMAL}, + + + #{enabled,jdbcType=BIT}, + + + #{otherField1,jdbcType=VARCHAR}, + + + #{otherField2,jdbcType=VARCHAR}, + + + #{otherField3,jdbcType=VARCHAR}, + + + #{enableSerialNumber,jdbcType=VARCHAR}, + + + #{enableBatchNumber,jdbcType=VARCHAR}, + + + #{position,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_material + set delete_flag='1' + where 1=1 + and ifnull(delete_flag,'0') !='1' + and id in ( + + #{id} + + ) + + + + + + + + + + + + + + + + update jsh_material + set unit_id = null + where 1=1 + and ifnull(delete_flag,'0') !='1' + and id = #{id} + + + + update jsh_material + set expiry_num = null + where 1=1 + and ifnull(delete_flag,'0') !='1' + and id = #{id} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialPropertyMapper.xml b/dao/src/main/resources/mapper_xml/MaterialPropertyMapper.xml new file mode 100644 index 00000000..ff5d048c --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialPropertyMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, native_name, enabled, sort, another_name, delete_flag + + + + + delete from jsh_material_property + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_material_property + + + + + + insert into jsh_material_property (id, native_name, enabled, + sort, another_name, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{nativeName,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{sort,jdbcType=VARCHAR}, #{anotherName,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_material_property + + + id, + + + native_name, + + + enabled, + + + sort, + + + another_name, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{nativeName,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{anotherName,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_material_property + + + id = #{record.id,jdbcType=BIGINT}, + + + native_name = #{record.nativeName,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + another_name = #{record.anotherName,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_material_property + set id = #{record.id,jdbcType=BIGINT}, + native_name = #{record.nativeName,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + another_name = #{record.anotherName,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_material_property + + + native_name = #{nativeName,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + another_name = #{anotherName,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_material_property + set native_name = #{nativeName,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + another_name = #{anotherName,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml b/dao/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml new file mode 100644 index 00000000..e6b68111 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MaterialPropertyMapperEx.xml @@ -0,0 +1,38 @@ + + + + + + + update jsh_material_property + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MsgMapper.xml b/dao/src/main/resources/mapper_xml/MsgMapper.xml new file mode 100644 index 00000000..92b22f86 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MsgMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, msg_title, msg_content, create_time, type, user_id, status, tenant_id, delete_Flag + + + + + delete from jsh_msg + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_msg + + + + + + insert into jsh_msg (id, msg_title, msg_content, + create_time, type, user_id, + status, tenant_id, delete_Flag + ) + values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, + #{status,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_msg + + + id, + + + msg_title, + + + msg_content, + + + create_time, + + + type, + + + user_id, + + + status, + + + tenant_id, + + + delete_Flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{msgTitle,jdbcType=VARCHAR}, + + + #{msgContent,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{type,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{status,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_msg + + + id = #{record.id,jdbcType=BIGINT}, + + + msg_title = #{record.msgTitle,jdbcType=VARCHAR}, + + + msg_content = #{record.msgContent,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + status = #{record.status,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_msg + set id = #{record.id,jdbcType=BIGINT}, + msg_title = #{record.msgTitle,jdbcType=VARCHAR}, + msg_content = #{record.msgContent,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + type = #{record.type,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=BIGINT}, + status = #{record.status,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_msg + + + msg_title = #{msgTitle,jdbcType=VARCHAR}, + + + msg_content = #{msgContent,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + type = #{type,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + status = #{status,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_Flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_msg + set msg_title = #{msgTitle,jdbcType=VARCHAR}, + msg_content = #{msgContent,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + type = #{type,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=BIGINT}, + status = #{status,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_Flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/MsgMapperEx.xml b/dao/src/main/resources/mapper_xml/MsgMapperEx.xml new file mode 100644 index 00000000..93e59862 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/MsgMapperEx.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + update jsh_msg + set delete_Flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/OrgaUserRelMapper.xml b/dao/src/main/resources/mapper_xml/OrgaUserRelMapper.xml new file mode 100644 index 00000000..327b49e1 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/OrgaUserRelMapper.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, orga_id, user_id, user_blng_orga_dspl_seq, delete_flag, create_time, creator, + update_time, updater, tenant_id + + + + + + delete from jsh_orga_user_rel + where id = #{id,jdbcType=BIGINT} + + + + delete from jsh_orga_user_rel + + + + + + + insert into jsh_orga_user_rel (id, orga_id, user_id, + user_blng_orga_dspl_seq, delete_flag, create_time, + creator, update_time, updater, + tenant_id) + values (#{id,jdbcType=BIGINT}, #{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}, + #{tenantId,jdbcType=BIGINT}) + + + + insert into jsh_orga_user_rel + + + id, + + + orga_id, + + + user_id, + + + user_blng_orga_dspl_seq, + + + delete_flag, + + + create_time, + + + creator, + + + update_time, + + + updater, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{orgaId,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=CHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{updater,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + + update jsh_orga_user_rel + + + id = #{record.id,jdbcType=BIGINT}, + + + orga_id = #{record.orgaId,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=CHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + updater = #{record.updater,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + + update jsh_orga_user_rel + set id = #{record.id,jdbcType=BIGINT}, + orga_id = #{record.orgaId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=CHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + updater = #{record.updater,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + + update jsh_orga_user_rel + + + orga_id = #{orgaId,jdbcType=BIGINT}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=CHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update jsh_orga_user_rel + set orga_id = #{orgaId,jdbcType=BIGINT}, + user_id = #{userId,jdbcType=BIGINT}, + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=CHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + updater = #{updater,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/OrgaUserRelMapperEx.xml b/dao/src/main/resources/mapper_xml/OrgaUserRelMapperEx.xml new file mode 100644 index 00000000..e96cc086 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/OrgaUserRelMapperEx.xml @@ -0,0 +1,44 @@ + + + + + + + insert into jsh_orga_user_rel (orga_id, user_id, + user_blng_orga_dspl_seq, delete_flag, create_time, + creator, update_time, updater + ) + values (#{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, + #{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT} + ) + + + update jsh_orga_user_rel + + + orga_id = #{orgaId}, + + + user_id = #{userId}, + + + user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq}, + + + delete_flag = #{deleteFlag}, + + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + and id=#{id} + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/OrganizationMapper.xml b/dao/src/main/resources/mapper_xml/OrganizationMapper.xml new file mode 100644 index 00000000..8751b2f8 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/OrganizationMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, org_no, org_abr, parent_id, sort, remark, create_time, update_time, tenant_id, + delete_flag + + + + + delete from jsh_organization + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_organization + + + + + + insert into jsh_organization (id, org_no, org_abr, + parent_id, sort, remark, + create_time, update_time, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{orgNo,jdbcType=VARCHAR}, #{orgAbr,jdbcType=VARCHAR}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_organization + + + id, + + + org_no, + + + org_abr, + + + parent_id, + + + sort, + + + remark, + + + create_time, + + + update_time, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{orgNo,jdbcType=VARCHAR}, + + + #{orgAbr,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=BIGINT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_organization + + + id = #{record.id,jdbcType=BIGINT}, + + + org_no = #{record.orgNo,jdbcType=VARCHAR}, + + + org_abr = #{record.orgAbr,jdbcType=VARCHAR}, + + + parent_id = #{record.parentId,jdbcType=BIGINT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_organization + set id = #{record.id,jdbcType=BIGINT}, + org_no = #{record.orgNo,jdbcType=VARCHAR}, + org_abr = #{record.orgAbr,jdbcType=VARCHAR}, + parent_id = #{record.parentId,jdbcType=BIGINT}, + sort = #{record.sort,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_organization + + + org_no = #{orgNo,jdbcType=VARCHAR}, + + + org_abr = #{orgAbr,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_organization + set org_no = #{orgNo,jdbcType=VARCHAR}, + org_abr = #{orgAbr,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=BIGINT}, + sort = #{sort,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/OrganizationMapperEx.xml b/dao/src/main/resources/mapper_xml/OrganizationMapperEx.xml new file mode 100644 index 00000000..ccdb51ae --- /dev/null +++ b/dao/src/main/resources/mapper_xml/OrganizationMapperEx.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, org_abr,org_no + + + + + + + insert into jsh_organization + (org_no, org_abr, delete_flag, + parent_id, sort, remark, + create_time, update_time) + values + (#{orgNo,jdbcType=VARCHAR}, #{orgAbr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, + #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + + update jsh_organization + set update_Time=#{updateTime},delete_flag='1' + where id in ( + + #{id} + + ) + + + update jsh_organization + set update_time=#{updateTime}, + org_no = #{orgNo},org_abr = #{orgAbr}, + delete_flag = #{deleteFlag},parent_id = #{parentId}, + sort = #{sort},remark = #{remark} + where id =#{id} + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/PersonMapper.xml b/dao/src/main/resources/mapper_xml/PersonMapper.xml new file mode 100644 index 00000000..4b7a90df --- /dev/null +++ b/dao/src/main/resources/mapper_xml/PersonMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, name, enabled, sort, tenant_id, delete_flag + + + + + delete from jsh_person + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_person + + + + + + insert into jsh_person (id, type, name, + enabled, sort, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{enabled,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_person + + + id, + + + type, + + + name, + + + enabled, + + + sort, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_person + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_person + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_person + + + type = #{type,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_person + set type = #{type,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/PersonMapperEx.xml b/dao/src/main/resources/mapper_xml/PersonMapperEx.xml new file mode 100644 index 00000000..98a4e9fd --- /dev/null +++ b/dao/src/main/resources/mapper_xml/PersonMapperEx.xml @@ -0,0 +1,45 @@ + + + + + + + update jsh_person + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/PlatformConfigMapper.xml b/dao/src/main/resources/mapper_xml/PlatformConfigMapper.xml new file mode 100644 index 00000000..34aaa0c2 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/PlatformConfigMapper.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, platform_key, platform_key_info, platform_value + + + + + + delete from jsh_platform_config + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_platform_config + + + + + + insert into jsh_platform_config (id, platform_key, platform_key_info, + platform_value) + values (#{id,jdbcType=BIGINT}, #{platformKey,jdbcType=VARCHAR}, #{platformKeyInfo,jdbcType=VARCHAR}, + #{platformValue,jdbcType=VARCHAR}) + + + insert into jsh_platform_config + + + id, + + + platform_key, + + + platform_key_info, + + + platform_value, + + + + + #{id,jdbcType=BIGINT}, + + + #{platformKey,jdbcType=VARCHAR}, + + + #{platformKeyInfo,jdbcType=VARCHAR}, + + + #{platformValue,jdbcType=VARCHAR}, + + + + + + update jsh_platform_config + + + id = #{record.id,jdbcType=BIGINT}, + + + platform_key = #{record.platformKey,jdbcType=VARCHAR}, + + + platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR}, + + + platform_value = #{record.platformValue,jdbcType=VARCHAR}, + + + + + + + + update jsh_platform_config + set id = #{record.id,jdbcType=BIGINT}, + platform_key = #{record.platformKey,jdbcType=VARCHAR}, + platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR}, + platform_value = #{record.platformValue,jdbcType=VARCHAR} + + + + + + update jsh_platform_config + + + platform_key = #{platformKey,jdbcType=VARCHAR}, + + + platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR}, + + + platform_value = #{platformValue,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_platform_config + set platform_key = #{platformKey,jdbcType=VARCHAR}, + platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR}, + platform_value = #{platformValue,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml b/dao/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml new file mode 100644 index 00000000..51194584 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/PlatformConfigMapperEx.xml @@ -0,0 +1,30 @@ + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/RoleMapper.xml b/dao/src/main/resources/mapper_xml/RoleMapper.xml new file mode 100644 index 00000000..2c514a37 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/RoleMapper.xml @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, type, price_limit, value, description, enabled, sort, tenant_id, delete_flag + + + + + delete from jsh_role + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_role + + + + + + insert into jsh_role (id, name, type, + price_limit, value, description, + enabled, sort, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{priceLimit,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{enabled,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_role + + + id, + + + name, + + + type, + + + price_limit, + + + value, + + + description, + + + enabled, + + + sort, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{priceLimit,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{sort,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_role + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + price_limit = #{record.priceLimit,jdbcType=VARCHAR}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_role + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=VARCHAR}, + price_limit = #{record.priceLimit,jdbcType=VARCHAR}, + value = #{record.value,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + sort = #{record.sort,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_role + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + price_limit = #{priceLimit,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_role + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + price_limit = #{priceLimit,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + sort = #{sort,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/RoleMapperEx.xml b/dao/src/main/resources/mapper_xml/RoleMapperEx.xml new file mode 100644 index 00000000..376d584f --- /dev/null +++ b/dao/src/main/resources/mapper_xml/RoleMapperEx.xml @@ -0,0 +1,55 @@ + + + + + + + + + update jsh_role + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SequenceMapperEx.xml b/dao/src/main/resources/mapper_xml/SequenceMapperEx.xml new file mode 100644 index 00000000..be6fed02 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SequenceMapperEx.xml @@ -0,0 +1,13 @@ + + + + + + update jsh_sequence set current_val = current_val + 1 where seq_name = 'depot_number_seq' + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SerialNumberMapper.xml b/dao/src/main/resources/mapper_xml/SerialNumberMapper.xml new file mode 100644 index 00000000..26564fd7 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SerialNumberMapper.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, material_id, depot_id, serial_number, is_sell, remark, delete_flag, create_time, + creator, update_time, updater, in_bill_no, out_bill_no, tenant_id + + + + + delete from jsh_serial_number + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_serial_number + + + + + + insert into jsh_serial_number (id, material_id, depot_id, + serial_number, is_sell, remark, + delete_flag, create_time, creator, + update_time, updater, in_bill_no, + out_bill_no, tenant_id) + values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT}, + #{serialNumber,jdbcType=VARCHAR}, #{isSell,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{deleteFlag,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=BIGINT}, + #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}, #{inBillNo,jdbcType=VARCHAR}, + #{outBillNo,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}) + + + insert into jsh_serial_number + + + id, + + + material_id, + + + depot_id, + + + serial_number, + + + is_sell, + + + remark, + + + delete_flag, + + + create_time, + + + creator, + + + update_time, + + + updater, + + + in_bill_no, + + + out_bill_no, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{materialId,jdbcType=BIGINT}, + + + #{depotId,jdbcType=BIGINT}, + + + #{serialNumber,jdbcType=VARCHAR}, + + + #{isSell,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{updater,jdbcType=BIGINT}, + + + #{inBillNo,jdbcType=VARCHAR}, + + + #{outBillNo,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + update jsh_serial_number + + + id = #{record.id,jdbcType=BIGINT}, + + + material_id = #{record.materialId,jdbcType=BIGINT}, + + + depot_id = #{record.depotId,jdbcType=BIGINT}, + + + serial_number = #{record.serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{record.isSell,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + updater = #{record.updater,jdbcType=BIGINT}, + + + in_bill_no = #{record.inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{record.outBillNo,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_serial_number + set id = #{record.id,jdbcType=BIGINT}, + material_id = #{record.materialId,jdbcType=BIGINT}, + depot_id = #{record.depotId,jdbcType=BIGINT}, + serial_number = #{record.serialNumber,jdbcType=VARCHAR}, + is_sell = #{record.isSell,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + creator = #{record.creator,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + updater = #{record.updater,jdbcType=BIGINT}, + in_bill_no = #{record.inBillNo,jdbcType=VARCHAR}, + out_bill_no = #{record.outBillNo,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_serial_number + + + material_id = #{materialId,jdbcType=BIGINT}, + + + depot_id = #{depotId,jdbcType=BIGINT}, + + + serial_number = #{serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{isSell,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{outBillNo,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_serial_number + set material_id = #{materialId,jdbcType=BIGINT}, + depot_id = #{depotId,jdbcType=BIGINT}, + serial_number = #{serialNumber,jdbcType=VARCHAR}, + is_sell = #{isSell,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + updater = #{updater,jdbcType=BIGINT}, + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + out_bill_no = #{outBillNo,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SerialNumberMapperEx.xml b/dao/src/main/resources/mapper_xml/SerialNumberMapperEx.xml new file mode 100644 index 00000000..b67b9152 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SerialNumberMapperEx.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + insert into jsh_serial_number + (material_id, serial_number, is_sell, remark,delete_flag, + create_time, creator,update_time, updater,in_bill_no, out_bill_no) + values + (#{materialId},#{serialNumber},#{isSell},#{remark},#{deleteFlag}, + #{createTime},#{creator},#{updateTime},#{updater},#{inBillNo},#{outBillNo} + ) + + + update jsh_serial_number + + + material_id = #{materialId,jdbcType=BIGINT}, + + + serial_number = #{serialNumber,jdbcType=VARCHAR}, + + + is_sell = #{isSell,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=BIGINT}, + + + in_bill_no = #{inBillNo,jdbcType=VARCHAR}, + + + out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + + where id = #{id,jdbcType=BIGINT} + + + + + update jsh_serial_number + + is_sell = '1', + + out_bill_no = #{outBillNo}, + + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + + and material_id = #{materialId} + + and is_sell != '1' + and ifnull(delete_flag,'0') !='1' + + and serial_number + in ( + + #{sn} + + ) + + + + + + update jsh_serial_number + + is_sell = '0', out_bill_no=null, + + update_time = #{updateTime}, + + + updater = #{updater}, + + + where 1=1 + + and material_id = #{materialId} + + + and out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + and is_sell != '0' + and ifnull(delete_flag,'0') !='1' + + and id in + ( select batchSN.id from + ( select selFrom.id from jsh_serial_number selFrom + where 1=1 + + and selFrom.material_id = #{materialId} + + + and selFrom.out_bill_no = #{outBillNo,jdbcType=VARCHAR} + + and selFrom.is_sell !='0' + and ifnull(selFrom.delete_flag,'0') !='1' + limit 0,#{count} + ) batchSN + ) + + + + insert into jsh_serial_number + (material_id, serial_number, is_sell, remark,delete_flag, + create_time, creator,update_time, updater) + values + + (#{each.materialId},#{each.serialNumber},'0',#{each.remark},'0', + #{each.createTime},#{each.creator},#{each.updateTime},#{each.updater} + ) + + + + update jsh_serial_number + set update_time=#{updateTime},updater=#{updater},delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SupplierMapper.xml b/dao/src/main/resources/mapper_xml/SupplierMapper.xml new file mode 100644 index 00000000..82284c49 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SupplierMapper.xml @@ -0,0 +1,527 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, supplier, contacts, phone_num, email, description, isystem, type, enabled, advance_in, + begin_need_get, begin_need_pay, all_need_get, all_need_pay, fax, telephone, address, + tax_num, bank_name, account_number, tax_rate, sort, creator, tenant_id, delete_flag + + + + + delete from jsh_supplier + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_supplier + + + + + + insert into jsh_supplier (id, supplier, contacts, + phone_num, email, description, + isystem, type, enabled, + advance_in, begin_need_get, begin_need_pay, + all_need_get, all_need_pay, fax, + telephone, address, tax_num, + bank_name, account_number, tax_rate, + sort, creator, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{supplier,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, + #{phoneNum,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{isystem,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{advanceIn,jdbcType=DECIMAL}, #{beginNeedGet,jdbcType=DECIMAL}, #{beginNeedPay,jdbcType=DECIMAL}, + #{allNeedGet,jdbcType=DECIMAL}, #{allNeedPay,jdbcType=DECIMAL}, #{fax,jdbcType=VARCHAR}, + #{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{taxNum,jdbcType=VARCHAR}, + #{bankName,jdbcType=VARCHAR}, #{accountNumber,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL}, + #{sort,jdbcType=VARCHAR}, #{creator,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_supplier + + + id, + + + supplier, + + + contacts, + + + phone_num, + + + email, + + + description, + + + isystem, + + + type, + + + enabled, + + + advance_in, + + + begin_need_get, + + + begin_need_pay, + + + all_need_get, + + + all_need_pay, + + + fax, + + + telephone, + + + address, + + + tax_num, + + + bank_name, + + + account_number, + + + tax_rate, + + + sort, + + + creator, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{supplier,jdbcType=VARCHAR}, + + + #{contacts,jdbcType=VARCHAR}, + + + #{phoneNum,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{isystem,jdbcType=TINYINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{advanceIn,jdbcType=DECIMAL}, + + + #{beginNeedGet,jdbcType=DECIMAL}, + + + #{beginNeedPay,jdbcType=DECIMAL}, + + + #{allNeedGet,jdbcType=DECIMAL}, + + + #{allNeedPay,jdbcType=DECIMAL}, + + + #{fax,jdbcType=VARCHAR}, + + + #{telephone,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{taxNum,jdbcType=VARCHAR}, + + + #{bankName,jdbcType=VARCHAR}, + + + #{accountNumber,jdbcType=VARCHAR}, + + + #{taxRate,jdbcType=DECIMAL}, + + + #{sort,jdbcType=VARCHAR}, + + + #{creator,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_supplier + + + id = #{record.id,jdbcType=BIGINT}, + + + supplier = #{record.supplier,jdbcType=VARCHAR}, + + + contacts = #{record.contacts,jdbcType=VARCHAR}, + + + phone_num = #{record.phoneNum,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + isystem = #{record.isystem,jdbcType=TINYINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + advance_in = #{record.advanceIn,jdbcType=DECIMAL}, + + + begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL}, + + + begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL}, + + + all_need_get = #{record.allNeedGet,jdbcType=DECIMAL}, + + + all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL}, + + + fax = #{record.fax,jdbcType=VARCHAR}, + + + telephone = #{record.telephone,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + tax_num = #{record.taxNum,jdbcType=VARCHAR}, + + + bank_name = #{record.bankName,jdbcType=VARCHAR}, + + + account_number = #{record.accountNumber,jdbcType=VARCHAR}, + + + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + + + sort = #{record.sort,jdbcType=VARCHAR}, + + + creator = #{record.creator,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_supplier + set id = #{record.id,jdbcType=BIGINT}, + supplier = #{record.supplier,jdbcType=VARCHAR}, + contacts = #{record.contacts,jdbcType=VARCHAR}, + phone_num = #{record.phoneNum,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + description = #{record.description,jdbcType=VARCHAR}, + isystem = #{record.isystem,jdbcType=TINYINT}, + type = #{record.type,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + advance_in = #{record.advanceIn,jdbcType=DECIMAL}, + begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL}, + begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL}, + all_need_get = #{record.allNeedGet,jdbcType=DECIMAL}, + all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL}, + fax = #{record.fax,jdbcType=VARCHAR}, + telephone = #{record.telephone,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + tax_num = #{record.taxNum,jdbcType=VARCHAR}, + bank_name = #{record.bankName,jdbcType=VARCHAR}, + account_number = #{record.accountNumber,jdbcType=VARCHAR}, + tax_rate = #{record.taxRate,jdbcType=DECIMAL}, + sort = #{record.sort,jdbcType=VARCHAR}, + creator = #{record.creator,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_supplier + + + supplier = #{supplier,jdbcType=VARCHAR}, + + + contacts = #{contacts,jdbcType=VARCHAR}, + + + phone_num = #{phoneNum,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + isystem = #{isystem,jdbcType=TINYINT}, + + + type = #{type,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + advance_in = #{advanceIn,jdbcType=DECIMAL}, + + + begin_need_get = #{beginNeedGet,jdbcType=DECIMAL}, + + + begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL}, + + + all_need_get = #{allNeedGet,jdbcType=DECIMAL}, + + + all_need_pay = #{allNeedPay,jdbcType=DECIMAL}, + + + fax = #{fax,jdbcType=VARCHAR}, + + + telephone = #{telephone,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + tax_num = #{taxNum,jdbcType=VARCHAR}, + + + bank_name = #{bankName,jdbcType=VARCHAR}, + + + account_number = #{accountNumber,jdbcType=VARCHAR}, + + + tax_rate = #{taxRate,jdbcType=DECIMAL}, + + + sort = #{sort,jdbcType=VARCHAR}, + + + creator = #{creator,jdbcType=BIGINT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_supplier + set supplier = #{supplier,jdbcType=VARCHAR}, + contacts = #{contacts,jdbcType=VARCHAR}, + phone_num = #{phoneNum,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + isystem = #{isystem,jdbcType=TINYINT}, + type = #{type,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + advance_in = #{advanceIn,jdbcType=DECIMAL}, + begin_need_get = #{beginNeedGet,jdbcType=DECIMAL}, + begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL}, + all_need_get = #{allNeedGet,jdbcType=DECIMAL}, + all_need_pay = #{allNeedPay,jdbcType=DECIMAL}, + fax = #{fax,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + tax_num = #{taxNum,jdbcType=VARCHAR}, + bank_name = #{bankName,jdbcType=VARCHAR}, + account_number = #{accountNumber,jdbcType=VARCHAR}, + tax_rate = #{taxRate,jdbcType=DECIMAL}, + sort = #{sort,jdbcType=VARCHAR}, + creator = #{creator,jdbcType=BIGINT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SupplierMapperEx.xml b/dao/src/main/resources/mapper_xml/SupplierMapperEx.xml new file mode 100644 index 00000000..2e09580e --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SupplierMapperEx.xml @@ -0,0 +1,106 @@ + + + + + + + + + + update jsh_supplier + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/ISysUserDeptRelService.xml b/dao/src/main/resources/mapper_xml/SysConfigMapper.xml similarity index 100% rename from dao/src/main/resources/mapper_xml/ISysUserDeptRelService.xml rename to dao/src/main/resources/mapper_xml/SysConfigMapper.xml diff --git a/dao/src/main/resources/mapper_xml/SysDepartmentMapper.xml b/dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml similarity index 68% rename from dao/src/main/resources/mapper_xml/SysDepartmentMapper.xml rename to dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml index 1dd38320..35c9ce19 100644 --- a/dao/src/main/resources/mapper_xml/SysDepartmentMapper.xml +++ b/dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml @@ -1,5 +1,5 @@ - + diff --git a/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml b/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml index 976eb314..170adcca 100644 --- a/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml +++ b/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml @@ -2,12 +2,4 @@ - diff --git a/dao/src/main/resources/mapper_xml/SysUserDeptRelMapper.xml b/dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml similarity index 69% rename from dao/src/main/resources/mapper_xml/SysUserDeptRelMapper.xml rename to dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml index 32884fde..96b30083 100644 --- a/dao/src/main/resources/mapper_xml/SysUserDeptRelMapper.xml +++ b/dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml @@ -1,5 +1,5 @@ - + diff --git a/dao/src/main/resources/mapper_xml/SystemConfigMapper.xml b/dao/src/main/resources/mapper_xml/SystemConfigMapper.xml new file mode 100644 index 00000000..5e8fe8a2 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SystemConfigMapper.xml @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code, + sale_agreement, depot_flag, customer_flag, minus_stock_flag, purchase_by_sale_flag, + multi_level_approval_flag, multi_bill_type, force_approval_flag, update_unit_price_flag, + over_link_bill_flag, tenant_id, delete_flag + + + + + delete from jsh_system_config + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_system_config + + + + + + insert into jsh_system_config (id, company_name, company_contacts, + company_address, company_tel, company_fax, + company_post_code, sale_agreement, depot_flag, + customer_flag, minus_stock_flag, purchase_by_sale_flag, + multi_level_approval_flag, multi_bill_type, + force_approval_flag, update_unit_price_flag, + over_link_bill_flag, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR}, + #{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR}, + #{companyPostCode,jdbcType=VARCHAR}, #{saleAgreement,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, + #{customerFlag,jdbcType=VARCHAR}, #{minusStockFlag,jdbcType=VARCHAR}, #{purchaseBySaleFlag,jdbcType=VARCHAR}, + #{multiLevelApprovalFlag,jdbcType=VARCHAR}, #{multiBillType,jdbcType=VARCHAR}, + #{forceApprovalFlag,jdbcType=VARCHAR}, #{updateUnitPriceFlag,jdbcType=VARCHAR}, + #{overLinkBillFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_system_config + + + id, + + + company_name, + + + company_contacts, + + + company_address, + + + company_tel, + + + company_fax, + + + company_post_code, + + + sale_agreement, + + + depot_flag, + + + customer_flag, + + + minus_stock_flag, + + + purchase_by_sale_flag, + + + multi_level_approval_flag, + + + multi_bill_type, + + + force_approval_flag, + + + update_unit_price_flag, + + + over_link_bill_flag, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{companyName,jdbcType=VARCHAR}, + + + #{companyContacts,jdbcType=VARCHAR}, + + + #{companyAddress,jdbcType=VARCHAR}, + + + #{companyTel,jdbcType=VARCHAR}, + + + #{companyFax,jdbcType=VARCHAR}, + + + #{companyPostCode,jdbcType=VARCHAR}, + + + #{saleAgreement,jdbcType=VARCHAR}, + + + #{depotFlag,jdbcType=VARCHAR}, + + + #{customerFlag,jdbcType=VARCHAR}, + + + #{minusStockFlag,jdbcType=VARCHAR}, + + + #{purchaseBySaleFlag,jdbcType=VARCHAR}, + + + #{multiLevelApprovalFlag,jdbcType=VARCHAR}, + + + #{multiBillType,jdbcType=VARCHAR}, + + + #{forceApprovalFlag,jdbcType=VARCHAR}, + + + #{updateUnitPriceFlag,jdbcType=VARCHAR}, + + + #{overLinkBillFlag,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_system_config + + + id = #{record.id,jdbcType=BIGINT}, + + + company_name = #{record.companyName,jdbcType=VARCHAR}, + + + company_contacts = #{record.companyContacts,jdbcType=VARCHAR}, + + + company_address = #{record.companyAddress,jdbcType=VARCHAR}, + + + company_tel = #{record.companyTel,jdbcType=VARCHAR}, + + + company_fax = #{record.companyFax,jdbcType=VARCHAR}, + + + company_post_code = #{record.companyPostCode,jdbcType=VARCHAR}, + + + sale_agreement = #{record.saleAgreement,jdbcType=VARCHAR}, + + + depot_flag = #{record.depotFlag,jdbcType=VARCHAR}, + + + customer_flag = #{record.customerFlag,jdbcType=VARCHAR}, + + + minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR}, + + + purchase_by_sale_flag = #{record.purchaseBySaleFlag,jdbcType=VARCHAR}, + + + multi_level_approval_flag = #{record.multiLevelApprovalFlag,jdbcType=VARCHAR}, + + + multi_bill_type = #{record.multiBillType,jdbcType=VARCHAR}, + + + force_approval_flag = #{record.forceApprovalFlag,jdbcType=VARCHAR}, + + + update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR}, + + + over_link_bill_flag = #{record.overLinkBillFlag,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_system_config + set id = #{record.id,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + company_contacts = #{record.companyContacts,jdbcType=VARCHAR}, + company_address = #{record.companyAddress,jdbcType=VARCHAR}, + company_tel = #{record.companyTel,jdbcType=VARCHAR}, + company_fax = #{record.companyFax,jdbcType=VARCHAR}, + company_post_code = #{record.companyPostCode,jdbcType=VARCHAR}, + sale_agreement = #{record.saleAgreement,jdbcType=VARCHAR}, + depot_flag = #{record.depotFlag,jdbcType=VARCHAR}, + customer_flag = #{record.customerFlag,jdbcType=VARCHAR}, + minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR}, + purchase_by_sale_flag = #{record.purchaseBySaleFlag,jdbcType=VARCHAR}, + multi_level_approval_flag = #{record.multiLevelApprovalFlag,jdbcType=VARCHAR}, + multi_bill_type = #{record.multiBillType,jdbcType=VARCHAR}, + force_approval_flag = #{record.forceApprovalFlag,jdbcType=VARCHAR}, + update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR}, + over_link_bill_flag = #{record.overLinkBillFlag,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_system_config + + + company_name = #{companyName,jdbcType=VARCHAR}, + + + company_contacts = #{companyContacts,jdbcType=VARCHAR}, + + + company_address = #{companyAddress,jdbcType=VARCHAR}, + + + company_tel = #{companyTel,jdbcType=VARCHAR}, + + + company_fax = #{companyFax,jdbcType=VARCHAR}, + + + company_post_code = #{companyPostCode,jdbcType=VARCHAR}, + + + sale_agreement = #{saleAgreement,jdbcType=VARCHAR}, + + + depot_flag = #{depotFlag,jdbcType=VARCHAR}, + + + customer_flag = #{customerFlag,jdbcType=VARCHAR}, + + + minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR}, + + + purchase_by_sale_flag = #{purchaseBySaleFlag,jdbcType=VARCHAR}, + + + multi_level_approval_flag = #{multiLevelApprovalFlag,jdbcType=VARCHAR}, + + + multi_bill_type = #{multiBillType,jdbcType=VARCHAR}, + + + force_approval_flag = #{forceApprovalFlag,jdbcType=VARCHAR}, + + + update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR}, + + + over_link_bill_flag = #{overLinkBillFlag,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_system_config + set company_name = #{companyName,jdbcType=VARCHAR}, + company_contacts = #{companyContacts,jdbcType=VARCHAR}, + company_address = #{companyAddress,jdbcType=VARCHAR}, + company_tel = #{companyTel,jdbcType=VARCHAR}, + company_fax = #{companyFax,jdbcType=VARCHAR}, + company_post_code = #{companyPostCode,jdbcType=VARCHAR}, + sale_agreement = #{saleAgreement,jdbcType=VARCHAR}, + depot_flag = #{depotFlag,jdbcType=VARCHAR}, + customer_flag = #{customerFlag,jdbcType=VARCHAR}, + minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR}, + purchase_by_sale_flag = #{purchaseBySaleFlag,jdbcType=VARCHAR}, + multi_level_approval_flag = #{multiLevelApprovalFlag,jdbcType=VARCHAR}, + multi_bill_type = #{multiBillType,jdbcType=VARCHAR}, + force_approval_flag = #{forceApprovalFlag,jdbcType=VARCHAR}, + update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR}, + over_link_bill_flag = #{overLinkBillFlag,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/SystemConfigMapperEx.xml b/dao/src/main/resources/mapper_xml/SystemConfigMapperEx.xml new file mode 100644 index 00000000..4af579a7 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SystemConfigMapperEx.xml @@ -0,0 +1,38 @@ + + + + + + + update jsh_system_config + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/TenantMapper.xml b/dao/src/main/resources/mapper_xml/TenantMapper.xml new file mode 100644 index 00000000..cb2936c2 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/TenantMapper.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, tenant_id, login_name, user_num_limit, type, enabled, create_time, expire_time, + remark + + + + + delete from jsh_tenant + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_tenant + + + + + + insert into jsh_tenant (id, tenant_id, login_name, + user_num_limit, type, enabled, + create_time, expire_time, remark + ) + values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR}, + #{userNumLimit,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{createTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR} + ) + + + insert into jsh_tenant + + + id, + + + tenant_id, + + + login_name, + + + user_num_limit, + + + type, + + + enabled, + + + create_time, + + + expire_time, + + + remark, + + + + + #{id,jdbcType=BIGINT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{loginName,jdbcType=VARCHAR}, + + + #{userNumLimit,jdbcType=INTEGER}, + + + #{type,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{expireTime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + + + + update jsh_tenant + + + id = #{record.id,jdbcType=BIGINT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + login_name = #{record.loginName,jdbcType=VARCHAR}, + + + user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + + + + + + update jsh_tenant + set id = #{record.id,jdbcType=BIGINT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + login_name = #{record.loginName,jdbcType=VARCHAR}, + user_num_limit = #{record.userNumLimit,jdbcType=INTEGER}, + type = #{record.type,jdbcType=VARCHAR}, + enabled = #{record.enabled,jdbcType=BIT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + expire_time = #{record.expireTime,jdbcType=TIMESTAMP}, + remark = #{record.remark,jdbcType=VARCHAR} + + + + + + update jsh_tenant + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + login_name = #{loginName,jdbcType=VARCHAR}, + + + user_num_limit = #{userNumLimit,jdbcType=INTEGER}, + + + type = #{type,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + expire_time = #{expireTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_tenant + set tenant_id = #{tenantId,jdbcType=BIGINT}, + login_name = #{loginName,jdbcType=VARCHAR}, + user_num_limit = #{userNumLimit,jdbcType=INTEGER}, + type = #{type,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + expire_time = #{expireTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/TenantMapperEx.xml b/dao/src/main/resources/mapper_xml/TenantMapperEx.xml new file mode 100644 index 00000000..b3a37632 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/TenantMapperEx.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UnitMapper.xml b/dao/src/main/resources/mapper_xml/UnitMapper.xml new file mode 100644 index 00000000..6cefd98f --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UnitMapper.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, basic_unit, other_unit, other_unit_two, other_unit_three, ratio, ratio_two, + ratio_three, enabled, tenant_id, delete_flag + + + + + delete from jsh_unit + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_unit + + + + + + insert into jsh_unit (id, name, basic_unit, + other_unit, other_unit_two, other_unit_three, + ratio, ratio_two, ratio_three, + enabled, tenant_id, delete_flag + ) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{basicUnit,jdbcType=VARCHAR}, + #{otherUnit,jdbcType=VARCHAR}, #{otherUnitTwo,jdbcType=VARCHAR}, #{otherUnitThree,jdbcType=VARCHAR}, + #{ratio,jdbcType=DECIMAL}, #{ratioTwo,jdbcType=DECIMAL}, #{ratioThree,jdbcType=DECIMAL}, + #{enabled,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR} + ) + + + insert into jsh_unit + + + id, + + + name, + + + basic_unit, + + + other_unit, + + + other_unit_two, + + + other_unit_three, + + + ratio, + + + ratio_two, + + + ratio_three, + + + enabled, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{basicUnit,jdbcType=VARCHAR}, + + + #{otherUnit,jdbcType=VARCHAR}, + + + #{otherUnitTwo,jdbcType=VARCHAR}, + + + #{otherUnitThree,jdbcType=VARCHAR}, + + + #{ratio,jdbcType=DECIMAL}, + + + #{ratioTwo,jdbcType=DECIMAL}, + + + #{ratioThree,jdbcType=DECIMAL}, + + + #{enabled,jdbcType=BIT}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_unit + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + basic_unit = #{record.basicUnit,jdbcType=VARCHAR}, + + + other_unit = #{record.otherUnit,jdbcType=VARCHAR}, + + + other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR}, + + + other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR}, + + + ratio = #{record.ratio,jdbcType=DECIMAL}, + + + ratio_two = #{record.ratioTwo,jdbcType=DECIMAL}, + + + ratio_three = #{record.ratioThree,jdbcType=DECIMAL}, + + + enabled = #{record.enabled,jdbcType=BIT}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_unit + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + basic_unit = #{record.basicUnit,jdbcType=VARCHAR}, + other_unit = #{record.otherUnit,jdbcType=VARCHAR}, + other_unit_two = #{record.otherUnitTwo,jdbcType=VARCHAR}, + other_unit_three = #{record.otherUnitThree,jdbcType=VARCHAR}, + ratio = #{record.ratio,jdbcType=DECIMAL}, + ratio_two = #{record.ratioTwo,jdbcType=DECIMAL}, + ratio_three = #{record.ratioThree,jdbcType=DECIMAL}, + enabled = #{record.enabled,jdbcType=BIT}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_unit + + + name = #{name,jdbcType=VARCHAR}, + + + basic_unit = #{basicUnit,jdbcType=VARCHAR}, + + + other_unit = #{otherUnit,jdbcType=VARCHAR}, + + + other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR}, + + + other_unit_three = #{otherUnitThree,jdbcType=VARCHAR}, + + + ratio = #{ratio,jdbcType=DECIMAL}, + + + ratio_two = #{ratioTwo,jdbcType=DECIMAL}, + + + ratio_three = #{ratioThree,jdbcType=DECIMAL}, + + + enabled = #{enabled,jdbcType=BIT}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_unit + set name = #{name,jdbcType=VARCHAR}, + basic_unit = #{basicUnit,jdbcType=VARCHAR}, + other_unit = #{otherUnit,jdbcType=VARCHAR}, + other_unit_two = #{otherUnitTwo,jdbcType=VARCHAR}, + other_unit_three = #{otherUnitThree,jdbcType=VARCHAR}, + ratio = #{ratio,jdbcType=DECIMAL}, + ratio_two = #{ratioTwo,jdbcType=DECIMAL}, + ratio_three = #{ratioThree,jdbcType=DECIMAL}, + enabled = #{enabled,jdbcType=BIT}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UnitMapperEx.xml b/dao/src/main/resources/mapper_xml/UnitMapperEx.xml new file mode 100644 index 00000000..40d44ab6 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UnitMapperEx.xml @@ -0,0 +1,49 @@ + + + + + + + update jsh_unit + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + update jsh_unit + set ratio_two=null + where id=#{id} + + + update jsh_unit + set ratio_three=null + where id=#{id} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UserBusinessMapper.xml b/dao/src/main/resources/mapper_xml/UserBusinessMapper.xml new file mode 100644 index 00000000..025e7e6b --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UserBusinessMapper.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, key_id, value, btn_str, tenant_id, delete_flag + + + + + delete from jsh_user_business + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_user_business + + + + + + insert into jsh_user_business (id, type, key_id, + value, btn_str, tenant_id, + delete_flag) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{keyId,jdbcType=VARCHAR}, + #{value,jdbcType=VARCHAR}, #{btnStr,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, + #{deleteFlag,jdbcType=VARCHAR}) + + + insert into jsh_user_business + + + id, + + + type, + + + key_id, + + + value, + + + btn_str, + + + tenant_id, + + + delete_flag, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{keyId,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{btnStr,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + #{deleteFlag,jdbcType=VARCHAR}, + + + + + + update jsh_user_business + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=VARCHAR}, + + + key_id = #{record.keyId,jdbcType=VARCHAR}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + btn_str = #{record.btnStr,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}, + + + + + + + + update jsh_user_business + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=VARCHAR}, + key_id = #{record.keyId,jdbcType=VARCHAR}, + value = #{record.value,jdbcType=VARCHAR}, + btn_str = #{record.btnStr,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + delete_flag = #{record.deleteFlag,jdbcType=VARCHAR} + + + + + + update jsh_user_business + + + type = #{type,jdbcType=VARCHAR}, + + + key_id = #{keyId,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + btn_str = #{btnStr,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + delete_flag = #{deleteFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_user_business + set type = #{type,jdbcType=VARCHAR}, + key_id = #{keyId,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + btn_str = #{btnStr,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT}, + delete_flag = #{deleteFlag,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UserBusinessMapperEx.xml b/dao/src/main/resources/mapper_xml/UserBusinessMapperEx.xml new file mode 100644 index 00000000..18a097bc --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UserBusinessMapperEx.xml @@ -0,0 +1,15 @@ + + + + + update jsh_user_business + set delete_flag='1' + where 1=1 + and id in ( + + #{id} + + ) + + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UserMapper.xml b/dao/src/main/resources/mapper_xml/UserMapper.xml new file mode 100644 index 00000000..c96498e5 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UserMapper.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, username, login_name, password, leader_flag, position, department, email, phonenum, + ismanager, isystem, Status, description, remark, weixin_open_id, tenant_id + + + + + delete from jsh_user + where id = #{id,jdbcType=BIGINT} + + + delete from jsh_user + + + + + + insert into jsh_user (id, username, login_name, + password, leader_flag, position, + department, email, phonenum, + ismanager, isystem, Status, + description, remark, weixin_open_id, + tenant_id) + values (#{id,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, + #{password,jdbcType=VARCHAR}, #{leaderFlag,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, + #{department,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{phonenum,jdbcType=VARCHAR}, + #{ismanager,jdbcType=TINYINT}, #{isystem,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, + #{description,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{weixinOpenId,jdbcType=VARCHAR}, + #{tenantId,jdbcType=BIGINT}) + + + insert into jsh_user + + + id, + + + username, + + + login_name, + + + password, + + + leader_flag, + + + position, + + + department, + + + email, + + + phonenum, + + + ismanager, + + + isystem, + + + Status, + + + description, + + + remark, + + + weixin_open_id, + + + tenant_id, + + + + + #{id,jdbcType=BIGINT}, + + + #{username,jdbcType=VARCHAR}, + + + #{loginName,jdbcType=VARCHAR}, + + + #{password,jdbcType=VARCHAR}, + + + #{leaderFlag,jdbcType=VARCHAR}, + + + #{position,jdbcType=VARCHAR}, + + + #{department,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{phonenum,jdbcType=VARCHAR}, + + + #{ismanager,jdbcType=TINYINT}, + + + #{isystem,jdbcType=TINYINT}, + + + #{status,jdbcType=TINYINT}, + + + #{description,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{weixinOpenId,jdbcType=VARCHAR}, + + + #{tenantId,jdbcType=BIGINT}, + + + + + + update jsh_user + + + id = #{record.id,jdbcType=BIGINT}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + login_name = #{record.loginName,jdbcType=VARCHAR}, + + + password = #{record.password,jdbcType=VARCHAR}, + + + leader_flag = #{record.leaderFlag,jdbcType=VARCHAR}, + + + position = #{record.position,jdbcType=VARCHAR}, + + + department = #{record.department,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + phonenum = #{record.phonenum,jdbcType=VARCHAR}, + + + ismanager = #{record.ismanager,jdbcType=TINYINT}, + + + isystem = #{record.isystem,jdbcType=TINYINT}, + + + Status = #{record.status,jdbcType=TINYINT}, + + + description = #{record.description,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + weixin_open_id = #{record.weixinOpenId,jdbcType=VARCHAR}, + + + tenant_id = #{record.tenantId,jdbcType=BIGINT}, + + + + + + + + update jsh_user + set id = #{record.id,jdbcType=BIGINT}, + username = #{record.username,jdbcType=VARCHAR}, + login_name = #{record.loginName,jdbcType=VARCHAR}, + password = #{record.password,jdbcType=VARCHAR}, + leader_flag = #{record.leaderFlag,jdbcType=VARCHAR}, + position = #{record.position,jdbcType=VARCHAR}, + department = #{record.department,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + phonenum = #{record.phonenum,jdbcType=VARCHAR}, + ismanager = #{record.ismanager,jdbcType=TINYINT}, + isystem = #{record.isystem,jdbcType=TINYINT}, + Status = #{record.status,jdbcType=TINYINT}, + description = #{record.description,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + weixin_open_id = #{record.weixinOpenId,jdbcType=VARCHAR}, + tenant_id = #{record.tenantId,jdbcType=BIGINT} + + + + + + update jsh_user + + + username = #{username,jdbcType=VARCHAR}, + + + login_name = #{loginName,jdbcType=VARCHAR}, + + + password = #{password,jdbcType=VARCHAR}, + + + leader_flag = #{leaderFlag,jdbcType=VARCHAR}, + + + position = #{position,jdbcType=VARCHAR}, + + + department = #{department,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + phonenum = #{phonenum,jdbcType=VARCHAR}, + + + ismanager = #{ismanager,jdbcType=TINYINT}, + + + isystem = #{isystem,jdbcType=TINYINT}, + + + Status = #{status,jdbcType=TINYINT}, + + + description = #{description,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR}, + + + tenant_id = #{tenantId,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update jsh_user + set username = #{username,jdbcType=VARCHAR}, + login_name = #{loginName,jdbcType=VARCHAR}, + password = #{password,jdbcType=VARCHAR}, + leader_flag = #{leaderFlag,jdbcType=VARCHAR}, + position = #{position,jdbcType=VARCHAR}, + department = #{department,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + phonenum = #{phonenum,jdbcType=VARCHAR}, + ismanager = #{ismanager,jdbcType=TINYINT}, + isystem = #{isystem,jdbcType=TINYINT}, + Status = #{status,jdbcType=TINYINT}, + description = #{description,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + weixin_open_id = #{weixinOpenId,jdbcType=VARCHAR}, + tenant_id = #{tenantId,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/dao/src/main/resources/mapper_xml/UserMapperEx.xml b/dao/src/main/resources/mapper_xml/UserMapperEx.xml new file mode 100644 index 00000000..2fd3e917 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/UserMapperEx.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + update jsh_user + set status=#{status} + where id in ( + + #{id} + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update jsh_user set Status='2' + where tenant_id=#{tenantId} and id!=#{tenantId} and Status!='1' + + + + + + + + update jsh_user u set u.weixin_open_id = #{weixinOpenId} + where u.login_name = #{loginName} and u.password = #{password} + and ifnull(u.status,'0') not in('1','2') + + \ No newline at end of file diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index e05d8c10..00000000 --- a/docker/README.md +++ /dev/null @@ -1 +0,0 @@ -# Docker Resources \ No newline at end of file diff --git a/docs/WanSenERP_API.md b/docs/WanSenERP_API.md deleted file mode 100644 index d27458a5..00000000 --- a/docs/WanSenERP_API.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: WanSenERP API v1.0.0 -language_tabs: - - shell: Shell - - http: HTTP - - javascript: JavaScript - - ruby: Ruby - - python: Python - - php: PHP - - java: Java - - go: Go -toc_footers: [] -includes: [] -search: true -code_clipboard: true -highlight_theme: darkula -headingLevel: 2 -generator: "@tarslib/widdershins v4.0.11" - ---- - -# WanSenERP API - -> v1.0.0 - -# Default - -## POST 用户注册 - -POST /users/insert - -> Body 请求参数 - -```json -{ - "user_name": "string", - "password": "string", - "email": "string", - "phone_number": "string", - "name": "string" -} -``` - -### 请求参数 - -|名称|位置|类型|必选|说明| -|---|---|---|---|---| -|body|body|object| 否 |none| -|» user_name|body|string| 是 |none| -|» password|body|string| 是 |none| -|» email|body|string| 是 |none| -|» phone_number|body|string| 是 |none| -|» name|body|string| 是 |none| - -> 返回示例 - -### 返回结果 - -|状态码|状态码含义|说明|数据模型| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| - -### 返回数据结构 - -# 数据模型 - diff --git a/docs/wansenerp-2023-09-23.sql b/docs/wansenerp-2023-09-23.sql deleted file mode 100644 index c25be6c5..00000000 --- a/docs/wansenerp-2023-09-23.sql +++ /dev/null @@ -1,1272 +0,0 @@ -/* - Navicat Premium Data Transfer - - Source Server : 本地 - Source Server Type : MySQL - Source Server Version : 80032 (8.0.32) - Source Host : localhost:3306 - Source Schema : wansenerp2 - - Target Server Type : MySQL - Target Server Version : 80032 (8.0.32) - File Encoding : 65001 - - Date: 23/09/2023 21:48:19 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for financial_account --- ---------------------------- -DROP TABLE IF EXISTS `financial_account`; -CREATE TABLE `financial_account` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `account_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `serial_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '编号', - `initial_amount` decimal(24, 6) NULL DEFAULT NULL COMMENT '期初金额', - `current_amount` decimal(24, 6) NULL DEFAULT NULL COMMENT '当前余额', - `remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '启用', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `is_default` tinyint(1) NULL DEFAULT NULL COMMENT '是否默认', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '账户信息' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of financial_account --- ---------------------------- -INSERT INTO `financial_account` VALUES (17, 63, '账户1', 'zzz111', 100.000000, 829.000000, 'aabb', 1, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_account` VALUES (18, 63, '账户2', '1234131324', 200.000000, -1681.000000, 'bbbb', 1, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_account` VALUES (24, NULL, 'aaa', 'aaa', 0.000000, NULL, NULL, 1, NULL, 0, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for financial_main --- ---------------------------- -DROP TABLE IF EXISTS `financial_main`; -CREATE TABLE `financial_main` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `organization_id` bigint NULL DEFAULT NULL COMMENT '机构id(收款/付款单位)', - `hands_person_id` bigint NULL DEFAULT NULL COMMENT '经手人id', - `account_id` bigint NULL DEFAULT NULL COMMENT '账户(收款/付款)', - `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)', - `change_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)', - `discount_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '优惠金额', - `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额', - `receipt_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '单据编号', - `receipt_source` tinyint(1) NULL DEFAULT 0 COMMENT '单据来源,0-pc,1-手机', - `receipt_time` datetime NULL DEFAULT NULL COMMENT '单据日期', - `remark` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `file_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '附件名称', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态,0未审核、1已审核、9审核中', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK9F4C0D8DB610FC06`(`organization_id` ASC) USING BTREE, - INDEX `FK9F4C0D8DAAE50527`(`account_id` ASC) USING BTREE, - INDEX `FK9F4C0D8DC4170B37`(`hands_person_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '财务主表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of financial_main --- ---------------------------- -INSERT INTO `financial_main` VALUES (118, 63, 58, 16, 17, '收入', 55.000000, NULL, 55.000000, 'SR00000000643', 0, '2021-06-02 00:24:49', NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_main` VALUES (119, 63, 68, 16, 17, '支出', -66.000000, NULL, -66.000000, 'ZC00000000644', 0, '2021-06-02 00:25:01', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_main` VALUES (122, 63, NULL, 17, 17, '转账', -11.000000, NULL, -11.000000, 'ZZ00000000647', 0, '2021-06-02 00:25:32', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_main` VALUES (124, 63, 60, 17, NULL, '收预付款', 80.000000, 0.000000, 80.000000, 'SYF00000000649', 0, '2021-07-06 23:43:48', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_main` VALUES (125, 63, 58, 17, 17, '收款', 10.000000, 0.000000, 10.000000, 'SK00000000653', 0, '2021-07-06 23:46:38', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_main` VALUES (126, 63, 57, 17, 17, '付款', -50.000000, 0.000000, -50.000000, 'FK00000000654', 0, '2021-07-06 23:47:23', NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for financial_sub --- ---------------------------- -DROP TABLE IF EXISTS `financial_sub`; -CREATE TABLE `financial_sub` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `table_header_id` bigint NOT NULL COMMENT '表头Id', - `account_id` bigint NULL DEFAULT NULL COMMENT '账户Id', - `income_expense_id` bigint NULL DEFAULT NULL COMMENT '收支项目Id', - `receipt_id` bigint NULL DEFAULT NULL COMMENT '单据id', - `accounts_receivable` decimal(24, 6) NULL DEFAULT NULL COMMENT '应收欠款', - `accounts_received` decimal(24, 6) NULL DEFAULT NULL COMMENT '已收欠款', - `single_amount` decimal(24, 6) NULL DEFAULT NULL COMMENT '单项金额', - `remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '单据备注', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK9F4CBAC0AAE50527`(`account_id` ASC) USING BTREE, - INDEX `FK9F4CBAC0C5FE6007`(`table_header_id` ASC) USING BTREE, - INDEX `FK9F4CBAC0D203EDC5`(`income_expense_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '财务子表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of financial_sub --- ---------------------------- -INSERT INTO `financial_sub` VALUES (143, 63, 118, NULL, 23, NULL, NULL, NULL, 55.000000, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_sub` VALUES (144, 63, 119, NULL, 21, NULL, NULL, NULL, 66.000000, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_sub` VALUES (147, 63, 122, 17, NULL, NULL, NULL, NULL, 11.000000, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_sub` VALUES (149, 63, 124, 17, NULL, NULL, NULL, NULL, 80.000000, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_sub` VALUES (150, 63, 125, NULL, NULL, 272, 20.000000, 0.000000, 10.000000, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `financial_sub` VALUES (151, 63, 126, NULL, NULL, 271, 60.000000, 0.000000, -50.000000, '', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for income_expense --- ---------------------------- -DROP TABLE IF EXISTS `income_expense`; -CREATE TABLE `income_expense` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型', - `remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '启用', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '收支项目' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of income_expense --- ---------------------------- -INSERT INTO `income_expense` VALUES (21, 63, '快递费', '支出', '', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `income_expense` VALUES (22, 63, '房租收入', '收入', '', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `income_expense` VALUES (23, 63, '利息收入', '收入', '收入', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `income_expense` VALUES (28, NULL, 'wansentech', '支出', NULL, 1, '1', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for operator --- ---------------------------- -DROP TABLE IF EXISTS `operator`; -CREATE TABLE `operator` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '姓名', - `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态(0-启用, 1-停用)', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '经手人表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of operator --- ---------------------------- -INSERT INTO `operator` VALUES (14, 63, '小李', '业务员', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `operator` VALUES (15, 63, '小军', '仓管员', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `operator` VALUES (16, 63, '小夏', '财务员', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `operator` VALUES (17, 63, '小曹', '财务员', 1, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `operator` VALUES (18, NULL, '赵伟', '业务员', 1, '2', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product --- ---------------------------- -DROP TABLE IF EXISTS `product`; -CREATE TABLE `product` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `product_category_id` bigint NULL DEFAULT NULL COMMENT '产品类型id', - `product_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `product_manufacturer` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '制造商', - `product_model` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '型号', - `product_standard` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '规格', - `product_color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '颜色', - `product_unit_id` bigint NULL DEFAULT NULL COMMENT '计量单位Id', - `product_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '单位-单个', - `product_expiry_num` int NULL DEFAULT NULL COMMENT '保质期天数', - `product_img_name` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '图片名称', - `product_weight` decimal(24, 6) NULL DEFAULT NULL COMMENT '基础重量(kg)', - `remark` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '启用 0-禁用 1-启用', - `other_field_one` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '自定义1', - `other_field_two` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '自定义2', - `other_field_three` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '自定义3', - `enable_serial_number` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启序列号,0否,1是', - `enable_batch_number` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启批号,0否,1是', - `warehouse_shelves` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '仓位货架', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK675951272AB6672C`(`product_category_id` ASC) USING BTREE, - INDEX `UnitId`(`product_unit_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of product --- ---------------------------- -INSERT INTO `product` VALUES (568, 63, 17, '商品1', '制1', 'sp1', '', '', NULL, '个', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (569, 63, 17, '商品2', '', 'sp2', '', '', NULL, '只', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (570, 63, 17, '商品3', '', 'sp3', '', '', NULL, '个', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (577, 63, NULL, '商品8', '', 'sp8', '', '', 15, '', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (579, 63, 21, '商品17', '', 'sp17', '', '', 15, '', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (586, 63, 17, '序列号商品测试', '', 'xlh123', '', '', NULL, '个', NULL, NULL, NULL, '', 1, '', '', '', 1, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (587, 63, 17, '商品test1', '南通中远', '', 'test1', '', NULL, '个', NULL, NULL, NULL, '', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (588, 63, 21, '商品200', 'fafda', 'weqwe', '300ml', '红色', NULL, '个', NULL, NULL, NULL, 'aaaabbbbb', 1, '', '', '', 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (619, 63, NULL, '衣服', NULL, NULL, NULL, NULL, NULL, '件', NULL, '', NULL, NULL, 1, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product` VALUES (620, NULL, NULL, 'wansentech', NULL, NULL, NULL, NULL, 15, '', 111, '', NULL, NULL, 1, NULL, NULL, NULL, 0, 0, '技术支持', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_attribute --- ---------------------------- -DROP TABLE IF EXISTS `product_attribute`; -CREATE TABLE `product_attribute` ( - `id` bigint NOT NULL, - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `attribute_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '属性名', - `attribute_value` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '属性值', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品属性表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of product_attribute --- ---------------------------- -INSERT INTO `product_attribute` VALUES (1, 63, '多颜色', '红色|橙色|黄色|绿色|蓝色|紫色', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_attribute` VALUES (2, 63, '多尺寸', 'S|M|L|XL|XXL|XXXL', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_attribute` VALUES (3, 63, '自定义1', '小米|华为', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_attribute` VALUES (4, 63, '自定义2', NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_attribute` VALUES (5, 63, '自定义3', NULL, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_category --- ---------------------------- -DROP TABLE IF EXISTS `product_category`; -CREATE TABLE `product_category` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `category_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `category_level` smallint NULL DEFAULT NULL COMMENT '等级', - `parent_id` bigint NULL DEFAULT NULL COMMENT '上级id', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '显示顺序', - `serial_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '编号', - `remark` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK3EE7F725237A77D8`(`parent_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品类型表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of product_category --- ---------------------------- -INSERT INTO `product_category` VALUES (17, 63, '目录1', NULL, NULL, '11', 'wae12', 'eee', '2019-04-10 22:18:12', '2021-02-17 15:11:35', NULL, NULL, 0); -INSERT INTO `product_category` VALUES (21, 63, '目录2', NULL, 17, '22', 'ada112', 'ddd', '2020-07-20 23:08:44', '2020-07-20 23:08:44', NULL, NULL, 0); -INSERT INTO `product_category` VALUES (29, 63, '海鲜水产', NULL, NULL, NULL, 'HX0001', NULL, '2023-08-30 14:55:13', '2023-08-30 14:55:13', NULL, NULL, 0); -INSERT INTO `product_category` VALUES (30, 63, '测试水产', NULL, NULL, '1', 'HX0001', '111', '2023-08-30 15:27:51', '2023-08-30 15:27:51', NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_extend_price --- ---------------------------- -DROP TABLE IF EXISTS `product_extend_price`; -CREATE TABLE `product_extend_price` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `product_id` bigint NULL DEFAULT NULL COMMENT '商品id', - `product_bar_code` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '商品条码', - `product_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '商品单位', - `multi_attribute` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '多属性', - `purchase_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '采购价格', - `retail_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '零售价格', - `sale_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '销售价格', - `low_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '最低售价', - `default_flag` tinyint(1) NULL DEFAULT 1 COMMENT '是否为默认单位,1是,0否', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品价格扩展' ROW_FORMAT = COMPACT; - --- ---------------------------- --- Records of product_extend_price --- ---------------------------- -INSERT INTO `product_extend_price` VALUES (1, 63, 587, '1000', '个', NULL, 11.000000, 22.000000, 22.000000, 22.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (2, 63, 568, '1001', '个', NULL, 11.000000, 15.000000, 15.000000, 15.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (3, 63, 569, '1002', '只', NULL, 10.000000, 15.000000, 15.000000, 13.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (4, 63, 570, '1003', '个', NULL, 8.000000, 15.000000, 14.000000, 13.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (5, 63, 577, '1004', '个', NULL, 10.000000, 20.000000, 20.000000, 20.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (6, 63, 577, '1005', '箱', NULL, 120.000000, 240.000000, 240.000000, 240.000000, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (7, 63, 579, '1006', '个', NULL, 20.000000, 30.000000, 30.000000, 30.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (8, 63, 579, '1007', '箱', NULL, 240.000000, 360.000000, 360.000000, 360.000000, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (9, 63, 586, '1008', '个', NULL, 12.000000, 15.000000, 15.000000, 15.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (10, 63, 588, '1009', '个', NULL, 11.000000, 22.000000, 22.000000, 22.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (36, 63, 619, '1014', '件', '橙色,M', 12.000000, 15.000000, 14.000000, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (37, 63, 619, '1015', '件', '橙色,L', 12.000000, 20.000000, 14.000000, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (38, 63, 619, '1016', '件', '绿色,M', 12.000000, 15.000000, 14.000000, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (39, 63, 619, '1017', '件', '绿色,L', 12.000000, 15.000000, 14.000000, NULL, 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (40, NULL, 620, '1020', '个', '', 1.000000, 2.000000, 3.000000, 4.000000, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_price` VALUES (41, NULL, 620, '1021', '箱', '', 33.000000, 32.000000, 12.000000, 6.000000, 0, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_extend_property --- ---------------------------- -DROP TABLE IF EXISTS `product_extend_property`; -CREATE TABLE `product_extend_property` ( - `id` bigint NOT NULL COMMENT '主键', - `native_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '原始名称', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '是否启用', - `another_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '别名', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品扩展字段表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of product_extend_property --- ---------------------------- -INSERT INTO `product_extend_property` VALUES (1, '制造商', 1, '制造商', '01', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_property` VALUES (2, '自定义1', 1, '自定义1', '02', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_property` VALUES (3, '自定义2', 1, '自定义2', '03', NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_extend_property` VALUES (4, '自定义3', 1, '自定义3', '04', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_inventory_current --- ---------------------------- -DROP TABLE IF EXISTS `product_inventory_current`; -CREATE TABLE `product_inventory_current` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `product_id` bigint NULL DEFAULT NULL COMMENT '产品id', - `warehouse_id` bigint NULL DEFAULT NULL COMMENT '仓库id', - `current_stock_quantity` decimal(24, 6) NULL DEFAULT NULL COMMENT '当前库存数量', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品当前库存' ROW_FORMAT = COMPACT; - --- ---------------------------- --- Records of product_inventory_current --- ---------------------------- -INSERT INTO `product_inventory_current` VALUES (19, 63, 588, 14, 24.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (20, 63, 568, 14, -219.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (21, 63, 568, 15, 222.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (22, 63, 570, 14, 8.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (23, 63, 619, 14, 5.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (24, 63, 619, 15, 0.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (25, 63, 619, 17, 0.000000, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_inventory_current` VALUES (26, NULL, 586, 14, 1.000000, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for product_inventory_initial --- ---------------------------- -DROP TABLE IF EXISTS `product_inventory_initial`; -CREATE TABLE `product_inventory_initial` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `product_id` bigint NULL DEFAULT NULL COMMENT '产品id', - `warehouse_id` bigint NULL DEFAULT NULL COMMENT '仓库id', - `init_stock_quantity` decimal(24, 6) NULL DEFAULT NULL COMMENT '初始库存数量', - `low_stock_quantity` decimal(24, 6) NULL DEFAULT NULL COMMENT '最低库存数量', - `high_stock_quantity` decimal(24, 6) NULL DEFAULT NULL COMMENT '最高库存数量', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '产品初始库存' ROW_FORMAT = COMPACT; - --- ---------------------------- --- Records of product_inventory_initial --- ---------------------------- - --- ---------------------------- --- Table structure for product_unit --- ---------------------------- -DROP TABLE IF EXISTS `product_unit`; -CREATE TABLE `product_unit` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称,支持多单位', - `basic_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '基础单位', - `other_unit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '副单位', - `other_unit_two` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '副单位2', - `other_unit_three` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '副单位3', - `ratio` decimal(24, 3) NULL DEFAULT NULL COMMENT '比例', - `ratio_two` decimal(24, 3) NULL DEFAULT NULL COMMENT '比例2', - `ratio_three` decimal(24, 3) NULL DEFAULT NULL COMMENT '比例3', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '启用', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '多单位表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of product_unit --- ---------------------------- -INSERT INTO `product_unit` VALUES (15, 63, '个/(箱=12个)', '个', '箱', NULL, NULL, 12.000, NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_unit` VALUES (19, 63, '个/(盒=15个)', '个', '盒', NULL, NULL, 15.000, NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_unit` VALUES (20, 63, '盒/(箱=8盒)', '盒', '箱', NULL, NULL, 8.000, NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `product_unit` VALUES (21, 63, '瓶/(箱=12瓶)', '瓶', '箱', NULL, NULL, 12.000, NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for supplier --- ---------------------------- -DROP TABLE IF EXISTS `supplier`; -CREATE TABLE `supplier` ( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `supplier_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '供应商名称', - `contact` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '联系人', - `contact_number` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '联系电话', - `email` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '电子邮箱', - `remake` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `is_system` tinyint NULL DEFAULT NULL COMMENT '是否系统自带 0==系统 1==非系统', - `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态(0-启用,1-停用)', - `advance_receivable` decimal(24, 6) NULL DEFAULT 0.000000 COMMENT '预收款', - `begin_account_receivable` decimal(24, 6) NULL DEFAULT NULL COMMENT '期初应收', - `begin_account_payment` decimal(24, 6) NULL DEFAULT NULL COMMENT '期初应付', - `total_receivable` decimal(24, 6) NULL DEFAULT NULL COMMENT '累计应收', - `total_payment` decimal(24, 6) NULL DEFAULT NULL COMMENT '累计应付', - `fax` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '传真', - `phone_number` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机', - `address` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '地址', - `tax_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '纳税人识别号', - `bank_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '开户行', - `account_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '账号', - `tax_rate` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 93 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '供应商/客户信息表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of supplier --- ---------------------------- -INSERT INTO `supplier` VALUES (57, 63, '供应商1', '小军', '12345678', '', '', NULL, '供应商', 1, 0.000000, 0.000000, 0.000000, 0.000000, 4.000000, '', '15000000000', '地址1', '', '', '', 12.000000, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (58, 63, '客户1', '小李', '12345678', '', '', NULL, '客户', 1, 0.000000, 0.000000, 0.000000, -100.000000, NULL, '', '', '', '', '', '', 12.000000, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (59, 63, '客户2', '小陈', '', '', '', NULL, '客户', 1, 0.000000, 0.000000, 0.000000, 0.000000, NULL, '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (60, 63, '12312666', '小曹', '', '', '', NULL, '会员', 1, 970.000000, 0.000000, 0.000000, NULL, NULL, '', '13000000000', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (68, 63, '供应商3', '晓丽', '12345678', '', 'fasdfadf', NULL, '供应商', 1, 0.000000, 0.000000, 0.000000, 0.000000, -35.000000, '', '13000000000', 'aaaa', '1341324', '', '', 13.000000, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (71, 63, '客户3', '小周', '', '', '', NULL, '客户', 1, 0.000000, 0.000000, 0.000000, 0.000000, NULL, '', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (74, 63, '供应商5', '小季', '77779999', '', '', NULL, '供应商', 1, 0.000000, 0.000000, 5.000000, 0.000000, 5.000000, '', '15806283912', '', '', '', '', 3.000000, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (90, NULL, '供应商666', '赵伟', '021-1515165', 'jameszow@wansen.mail', NULL, NULL, '供应商', 1, 0.000000, NULL, 20.000000, NULL, NULL, NULL, '16621211605', '陕西省西安市', NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (91, NULL, '0724198719', NULL, '166 2121 1605', 'jameszow@wansen.mail', NULL, NULL, '客户', 1, 0.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `supplier` VALUES (92, NULL, '0724198719', '112131', NULL, NULL, NULL, NULL, '会员', 1, 0.000000, NULL, NULL, NULL, NULL, NULL, '16621211605', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_config`; -CREATE TABLE `sys_config` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `company_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司名称', - `company_contact` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司联系人', - `company_address` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司地址', - `company_phone` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司电话', - `company_fax` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司传真', - `company_post_code` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '公司邮编', - `sale_agreement` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '销售协议', - `warehouse_status` tinyint(1) NULL DEFAULT 0 COMMENT '仓库启用标记,0未启用,1启用', - `customer_status` tinyint(1) NULL DEFAULT 0 COMMENT '客户启用标记,0未启用,1启用', - `minus_stock_status` tinyint(1) NULL DEFAULT 0 COMMENT '负库存启用标记,0未启用,1启用', - `purchase_by_sale_status` tinyint(1) NULL DEFAULT 0 COMMENT '以销定购启用标记,0未启用,1启用', - `multi_level_approval_status` tinyint(1) NULL DEFAULT 0 COMMENT '多级审核启用标记,0未启用,1启用', - `process_type` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '流程类型,可多选', - `force_approval_status` tinyint(1) NULL DEFAULT 0 COMMENT '强审核启用标记,0未启用,1启用', - `update_unit_price_status` tinyint(1) NULL DEFAULT 1 COMMENT '更新单价启用标记,0未启用,1启用', - `over_link_bill_status` tinyint(1) NULL DEFAULT 0 COMMENT '超出关联单据启用标记,0未启用,1启用', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '系统参数' ROW_FORMAT = COMPACT; - --- ---------------------------- --- Records of sys_config --- ---------------------------- -INSERT INTO `sys_config` VALUES (11, 63, '万森(陕西)机器人有限公司', '赵伟', '陕西省西安市高新区软件新城A6', '16621211605', NULL, NULL, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', 0, 0, 1, 0, 0, '', 0, 1, 0, 0); - --- ---------------------------- --- Table structure for sys_department --- ---------------------------- -DROP TABLE IF EXISTS `sys_department`; -CREATE TABLE `sys_department` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `parent_id` bigint NULL DEFAULT NULL COMMENT '父级部门id', - `number` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '部门编号', - `name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '部门简称', - `leader` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '部门负责任人', - `remark` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `sort` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '部门显示顺序', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '机构表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_department --- ---------------------------- -INSERT INTO `sys_department` VALUES (12, 63, NULL, '001', '测试机构', NULL, 'aaaa2', '2', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (13, 63, 12, 'jg1', '机构1', NULL, '', '3', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (14, 63, 13, '12', '机构2', NULL, '', '4', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154490573429018634, 0, 1154756575114956805, '2', '技术团队', NULL, NULL, '2', '2023-09-21 18:53:51', '2023-09-21 18:53:48', NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154756575114956805, 0, NULL, '1', '万森智能部门', NULL, NULL, '1', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154794589170044930, 0, 1154794589174239277, '2', '硬件研发团队', NULL, NULL, '1', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154794589174239242, 0, 1154794589174239277, '1', '销售团队', NULL, NULL, '2', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154794589174239268, 0, 1154756575114956805, NULL, '运营团队', NULL, NULL, '3', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_department` VALUES (1154794589174239277, 0, NULL, NULL, '万森机器人', NULL, NULL, '2', NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_log --- ---------------------------- -DROP TABLE IF EXISTS `sys_log`; -CREATE TABLE `sys_log` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `user_id` bigint NULL DEFAULT NULL COMMENT '用户id', - `operate_name` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '操作模块名称', - `client_ip` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '客户端IP', - `status` tinyint NULL DEFAULT NULL COMMENT '操作状态 0==成功,1==失败', - `content` varchar(5000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '详情', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FKF2696AA13E226853`(`user_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '操作日志' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_log --- ---------------------------- -INSERT INTO `sys_log` VALUES (7559, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录jsh', '2023-08-30 14:50:36', NULL); -INSERT INTO `sys_log` VALUES (7560, NULL, 63, '商品类型', '127.0.0.1/127.0.0.1', 0, '新增海鲜水产', '2023-08-30 14:55:13', NULL); -INSERT INTO `sys_log` VALUES (7561, NULL, 63, '商品类型', '127.0.0.1/127.0.0.1', 0, '新增测试水产', '2023-08-30 15:27:51', NULL); -INSERT INTO `sys_log` VALUES (7562, NULL, 63, '商品', '127.0.0.1/127.0.0.1', 0, '新增wansentech', '2023-08-30 15:30:06', NULL); -INSERT INTO `sys_log` VALUES (7563, 0, 120, '用户', '127.0.0.1/127.0.0.1', 0, '登录admin', '2023-08-30 15:33:52', NULL); -INSERT INTO `sys_log` VALUES (7564, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录jsh', '2023-08-30 15:37:57', NULL); -INSERT INTO `sys_log` VALUES (7565, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录jsh', '2023-08-30 15:38:14', NULL); -INSERT INTO `sys_log` VALUES (7566, 0, 120, '用户', '127.0.0.1/127.0.0.1', 0, '登录admin', '2023-08-30 15:38:30', NULL); -INSERT INTO `sys_log` VALUES (7567, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录jsh', '2023-08-30 15:39:12', NULL); -INSERT INTO `sys_log` VALUES (7568, NULL, 63, '商家', '127.0.0.1/127.0.0.1', 0, '新增供应商666', '2023-08-30 15:40:47', NULL); -INSERT INTO `sys_log` VALUES (7569, NULL, 63, '关联关系', '127.0.0.1/127.0.0.1', 0, '修改', '2023-08-30 15:41:05', NULL); -INSERT INTO `sys_log` VALUES (7570, NULL, 63, '商家', '127.0.0.1/127.0.0.1', 0, '新增0724198719', '2023-08-30 15:41:05', NULL); -INSERT INTO `sys_log` VALUES (7571, NULL, 63, '商家', '127.0.0.1/127.0.0.1', 0, '新增0724198719', '2023-08-30 15:41:13', NULL); -INSERT INTO `sys_log` VALUES (7572, NULL, 63, '关联关系', '127.0.0.1/127.0.0.1', 0, '修改', '2023-08-30 15:41:26', NULL); -INSERT INTO `sys_log` VALUES (7573, NULL, 63, '仓库', '127.0.0.1/127.0.0.1', 0, '新增仓库666', '2023-08-30 15:41:26', NULL); -INSERT INTO `sys_log` VALUES (7574, NULL, 63, '收支项目', '127.0.0.1/127.0.0.1', 0, '新增wansentech', '2023-08-30 15:41:34', NULL); -INSERT INTO `sys_log` VALUES (7575, NULL, 63, '账户', '127.0.0.1/127.0.0.1', 0, '新增aaa', '2023-08-30 15:41:39', NULL); -INSERT INTO `sys_log` VALUES (7576, NULL, 63, '经手人', '127.0.0.1/127.0.0.1', 0, '新增赵伟', '2023-08-30 15:41:53', NULL); -INSERT INTO `sys_log` VALUES (7577, NULL, 63, '关联关系', '127.0.0.1/127.0.0.1', 0, '修改', '2023-08-30 15:42:32', NULL); -INSERT INTO `sys_log` VALUES (7578, NULL, 63, '关联关系', '127.0.0.1/127.0.0.1', 0, '修改角色的按钮权限', '2023-08-30 15:43:12', NULL); -INSERT INTO `sys_log` VALUES (7579, NULL, 63, '系统配置', '127.0.0.1/127.0.0.1', 0, '修改万森(陕西)机器人有限公司', '2023-08-30 15:44:11', NULL); -INSERT INTO `sys_log` VALUES (7580, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录jsh', '2023-08-30 15:44:21', NULL); -INSERT INTO `sys_log` VALUES (7581, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '新增LSCK00000000663', '2023-08-30 18:09:51', NULL); -INSERT INTO `sys_log` VALUES (7582, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '修改LSCK00000000663', '2023-08-30 18:10:11', NULL); -INSERT INTO `sys_log` VALUES (7583, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '删除[LSCK00000000663]', '2023-08-30 18:10:30', NULL); -INSERT INTO `sys_log` VALUES (7584, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '新增LSTH00000000665', '2023-08-30 18:11:10', NULL); -INSERT INTO `sys_log` VALUES (7585, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '修改LSTH00000000637', '2023-08-30 18:11:22', NULL); -INSERT INTO `sys_log` VALUES (7586, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '新增CGDD00000000666', '2023-08-30 18:12:02', NULL); -INSERT INTO `sys_log` VALUES (7587, 146, 146, '用户', '127.0.0.1/127.0.0.1', 0, '登录test66', '2023-08-30 18:13:26', NULL); -INSERT INTO `sys_log` VALUES (7588, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录wansen', '2023-09-01 23:56:12', NULL); -INSERT INTO `sys_log` VALUES (7589, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录wansen', '2023-09-01 23:56:45', NULL); -INSERT INTO `sys_log` VALUES (7590, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '修改DBCK00000000640', '2023-09-01 23:58:48', NULL); -INSERT INTO `sys_log` VALUES (7591, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录wansen', '2023-09-02 00:09:58', NULL); -INSERT INTO `sys_log` VALUES (7592, 63, 63, '用户', '127.0.0.1/127.0.0.1', 0, '登录wansen', '2023-09-02 13:39:48', NULL); -INSERT INTO `sys_log` VALUES (7593, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '新增CGTH00000000668', '2023-09-02 13:40:06', NULL); -INSERT INTO `sys_log` VALUES (7594, NULL, 63, '单据', '127.0.0.1/127.0.0.1', 0, '修改CGTH00000000632', '2023-09-02 13:40:14', NULL); - --- ---------------------------- --- Table structure for sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `sys_menu`; -CREATE TABLE `sys_menu` ( - `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', - `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标题(菜单显示)', - `parent_id` int NULL DEFAULT NULL COMMENT '父级菜单id', - `menu_type` int NULL DEFAULT NULL COMMENT '类型', - `path` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '链接', - `component` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '组件', - `redirect` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '重定向地址', - `sort` int NULL DEFAULT NULL COMMENT '排序', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态(0-启用,1-停用)', - `icon` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '图标', - `hide_menu` tinyint(1) NULL DEFAULT 0 COMMENT '隐藏路由不在菜单显示', - `hide_breadcrumb` tinyint(1) NULL DEFAULT 0 COMMENT '隐藏该路由在面包屑上面的显示', - `ignore_keep_alive` tinyint(1) NULL DEFAULT 0 COMMENT '是否忽略KeepAlive缓存', - `hide_tab` tinyint(1) NULL DEFAULT 0 COMMENT '隐藏路由不在标签页显示', - `carry_param` tinyint(1) NULL DEFAULT 0 COMMENT '如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true', - `hide_children_in_menu` tinyint(1) NULL DEFAULT 0 COMMENT '隐藏所有子菜单', - `affix` tinyint(1) NULL DEFAULT 0 COMMENT '是否固定标签', - `frameSrc` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '内嵌iframe的地址', - `realPath` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '动态路由的实际Path, 即去除路由的动态部分;', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE INDEX `url`(`path` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 260 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '功能模块表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_menu --- ---------------------------- -INSERT INTO `sys_menu` VALUES (1, 'Dashboard', '首页', NULL, 1, '/dashboard', '/dashboard/workbench/index', NULL, 1, 1, 'ant-design:home-outlined', 0, 0, 0, 0, 0, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (2, 'FileManagement', '零售管理', NULL, 1, '/fms/file', '/fms/file/index', NULL, 2, 1, 'ant-design:folder-open-outlined', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (3, 'SystemManagement', '系统管理', NULL, 0, '/sys', 'LAYOUT', NULL, 999, NULL, 'ant-design:tool-outlined', 0, 0, 0, 0, 0, 0, 0, '', '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (13, 'RoleManagement', '角色管理', 3, 1, '/role', '/sys/role/index', NULL, 2, 1, 'ant-design:user-outlined', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (14, 'UserManagement', '用户管理', 3, 1, '/user', '/sys/user/index', NULL, 3, 1, 'ant-design:user-outlined', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (15, 'DepartmentManagement', '部门管理', 3, 1, '/department', '/sys/department/index', NULL, 160, 1, 'ic:outline-people-alt', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (16, '功能管理', NULL, 1, 1, '/system/function', '/system/FunctionList', NULL, 166, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (18, '租户管理', NULL, 1, 1, '/system/tenant', '/system/TenantList', NULL, 167, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (21, '商品管理', NULL, 0, 1, '/material', '/layouts/TabLayout', NULL, 620, 1, 'shopping', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (22, '商品类别', NULL, 101, 1, '/material/material_category', '/material/MaterialCategoryList', NULL, 230, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (23, '商品信息', NULL, 101, 1, '/material/material', '/material/MaterialList', NULL, 240, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (24, '基本资料', NULL, 0, 1, '/systemA', '/layouts/TabLayout', NULL, 750, 1, 'appstore', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (25, '供应商信息', NULL, 102, 1, '/system/vendor', '/system/VendorList', NULL, 260, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (26, '仓库信息', NULL, 102, 1, '/system/depot', '/system/DepotList', NULL, 270, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (31, '经手人管理', NULL, 102, 1, '/system/person', '/system/PersonList', NULL, 284, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (32, '采购管理', NULL, 0, 1, '/bill', '/layouts/TabLayout', NULL, 330, 1, 'retweet', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (33, '采购入库', NULL, 502, 1, '/bill/purchase_in', '/bill/PurchaseInList', NULL, 340, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (38, '销售管理', NULL, 0, 1, '/billB', '/layouts/TabLayout', NULL, 390, 1, 'shopping-cart', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (40, '调拨出库', NULL, 801, 1, '/bill/allocation_out', '/bill/AllocationOutList', NULL, 807, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (41, '销售出库', NULL, 603, 1, '/bill/sale_out', '/bill/SaleOutList', NULL, 394, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (44, '财务管理', NULL, 0, 1, '/financial', '/layouts/TabLayout', NULL, 450, 1, 'money-collect', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (59, '进销存统计', NULL, 301, 1, '/report/in_out_stock_report', '/report/InOutStockReport', NULL, 658, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (194, '收支项目', NULL, 102, 1, '/system/in_out_item', '/system/InOutItemList', NULL, 282, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (195, '结算账户', NULL, 102, 1, '/system/account', '/system/AccountList', NULL, 283, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (197, '收入单', NULL, 704, 1, '/financial/item_in', '/financial/ItemInList', NULL, 465, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (198, '报表查询', NULL, 0, 1, '/report', '/layouts/TabLayout', NULL, 570, 1, 'pie-chart', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (199, '采购退货', NULL, 502, 1, '/bill/purchase_back', '/bill/PurchaseBackList', NULL, 345, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (200, '销售退货', NULL, 603, 1, '/bill/sale_back', '/bill/SaleBackList', NULL, 396, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (201, '其它入库', NULL, 801, 1, '/bill/other_in', '/bill/OtherInList', NULL, 803, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (202, '其它出库', NULL, 801, 1, '/bill/other_out', '/bill/OtherOutList', NULL, 805, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (203, '支出单', NULL, 704, 1, '/financial/item_out', '/financial/ItemOutList', NULL, 470, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (204, '收款单', NULL, 704, 1, '/financial/money_in', '/financial/MoneyInList', NULL, 475, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (205, '付款单', NULL, 704, 1, '/financial/money_out', '/financial/MoneyOutList', NULL, 480, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (206, '转账单', NULL, 704, 1, '/financial/giro', '/financial/GiroList', NULL, 490, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (207, '账户统计', NULL, 301, 1, '/report/account_report', '/report/AccountReport', NULL, 610, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (208, '采购统计', NULL, 301, 1, '/report/buy_in_report', '/report/BuyInReport', NULL, 620, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (209, '销售统计', NULL, 301, 1, '/report/sale_out_report', '/report/SaleOutReport', NULL, 630, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (210, '零售出库', NULL, 401, 1, '/bill/retail_out', '/bill/RetailOutList', NULL, 405, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (211, '零售退货', NULL, 401, 1, '/bill/retail_back', '/bill/RetailBackList', NULL, 407, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (212, '收预付款', NULL, 704, 1, '/financial/advance_in', '/financial/AdvanceInList', NULL, 495, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (217, '客户信息', NULL, 102, 1, '/system/customer', '/system/CustomerList', NULL, 262, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (218, '会员信息', NULL, 102, 1, '/system/member', '/system/MemberList', NULL, 263, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (220, '计量单位', NULL, 101, 1, '/system/unit', '/system/UnitList', NULL, 245, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (226, '入库明细', NULL, 301, 1, '/report/in_detail', '/report/InDetail', NULL, 640, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (227, '出库明细', NULL, 301, 1, '/report/out_detail', '/report/OutDetail', NULL, 645, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (228, '入库汇总', NULL, 301, 1, '/report/in_material_count', '/report/InMaterialCount', NULL, 650, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (229, '出库汇总', NULL, 301, 1, '/report/out_material_count', '/report/OutMaterialCount', NULL, 655, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (232, '组装单', NULL, 801, 1, '/bill/assemble', '/bill/AssembleList', NULL, 809, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (233, '拆卸单', NULL, 801, 1, '/bill/disassemble', '/bill/DisassembleList', NULL, 811, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (234, '系统配置', NULL, 1, 1, '/system/system_config', '/system/SystemConfigList', NULL, 165, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (235, '客户对账', NULL, 301, 1, '/report/customer_account', '/report/CustomerAccount', NULL, 660, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (236, '商品属性', NULL, 1, 1, '/material/material_property', '/material/MaterialPropertyList', NULL, 168, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (237, '供应商对账', NULL, 301, 1, '/report/vendor_account', '/report/VendorAccount', NULL, 665, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (239, '仓库管理', NULL, 0, 1, '/billD', '/layouts/TabLayout', NULL, 420, 1, 'hdd', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (241, '采购订单', NULL, 502, 1, '/bill/purchase_order', '/bill/PurchaseOrderList', NULL, 335, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (242, '销售订单', NULL, 603, 1, '/bill/sale_order', '/bill/SaleOrderList', NULL, 392, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (243, '机构管理', NULL, 1, 1, '/system/organization', '/system/OrganizationList', NULL, 150, 1, 'profile', 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (244, '库存预警', NULL, 301, 1, '/report/stock_warning_report', '/report/StockWarningReport', NULL, 670, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (245, '插件管理', NULL, 1, 1, '/system/plugin', '/system/PluginList', NULL, 170, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (246, '商品库存', NULL, 301, 1, '/report/material_stock', '/report/MaterialStock', NULL, 605, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (247, '多属性', NULL, 101, 1, '/material/material_attribute', '/material/MaterialAttributeList', NULL, 250, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (248, '调拨明细', NULL, 301, 1, '/report/allocation_detail', '/report/AllocationDetail', NULL, 646, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (258, '平台配置', NULL, 1, 1, '/system/platform_config', '/system/PlatformConfigList', NULL, 175, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_menu` VALUES (259, '零售统计', NULL, 301, 1, '/report/retail_out_report', '/report/RetailOutReport', NULL, 615, 1, 'profile', 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_msg --- ---------------------------- -DROP TABLE IF EXISTS `sys_msg`; -CREATE TABLE `sys_msg` ( - `id` bigint NOT NULL COMMENT '主键', - `msg_title` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '消息标题', - `msg_content` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '消息内容', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '消息类型', - `user_id` bigint NULL DEFAULT NULL COMMENT '接收人id', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态,1未读 2已读', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `delete_Flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '消息表' ROW_FORMAT = COMPACT; - --- ---------------------------- --- Records of sys_msg --- ---------------------------- -INSERT INTO `sys_msg` VALUES (2, '标题1', '内容1', '2019-09-10 00:11:39', '类型1', 63, 2, 63, 0); - --- ---------------------------- --- Table structure for sys_platform_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_platform_config`; -CREATE TABLE `sys_platform_config` ( - `id` bigint NOT NULL, - `platform_key` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '关键词', - `platform_key_info` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '关键词名称', - `platform_value` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '值', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '平台参数' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_platform_config --- ---------------------------- -INSERT INTO `sys_platform_config` VALUES (1, 'platform_name', '平台名称', 'Wan Sen ERP', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (2, 'activation_code', '激活码', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (3, 'platform_url', '官方网站', 'http://wansenai.com/', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (4, 'bill_print_flag', '三联打印启用标记', '0', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (5, 'bill_print_url', '三联打印地址', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (6, 'pay_fee_url', '租户续费地址', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (7, 'register_flag', '注册启用标记', '1', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (8, 'app_activation_code', '手机端激活码', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (9, 'send_workflow_url', '发起流程地址', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (10, 'weixinUrl', '微信url', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (11, 'weixinAppid', '微信appid', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (12, 'weixinSecret', '微信secret', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (13, 'aliOss_endpoint', '阿里OSS-endpoint', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (14, 'aliOss_accessKeyId', '阿里OSS-accessKeyId', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (15, 'aliOss_accessKeySecret', '阿里OSS-accessKeySecret', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (16, 'aliOss_bucketName', '阿里OSS-bucketName', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (17, 'aliOss_linkUrl', '阿里OSS-linkUrl', '', NULL, NULL, NULL, NULL); -INSERT INTO `sys_platform_config` VALUES (18, 'bill_excel_url', '单据Excel地址', '', NULL, NULL, NULL, NULL); - --- ---------------------------- --- Table structure for sys_role --- ---------------------------- -DROP TABLE IF EXISTS `sys_role`; -CREATE TABLE `sys_role` ( - `id` bigint NOT NULL COMMENT '主键', - `name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '名称', - `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类型', - `price_limit` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价', - `description` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '描述', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态(0-启用,1-停用)', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '角色表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_role --- ---------------------------- -INSERT INTO `sys_role` VALUES (1151153250280804356, '租户', '全部数据', NULL, '', 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_role` VALUES (1151153250280804397, '销售经理', '全部数据', NULL, '查询全部数据', 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_role` VALUES (1151153250280804400, '销售代表', '个人数据', NULL, '智能查询个人数据', 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_role` VALUES (1151247731923488769, '管理员', '全部数据', NULL, NULL, 1, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_role_menu_rel --- ---------------------------- -DROP TABLE IF EXISTS `sys_role_menu_rel`; -CREATE TABLE `sys_role_menu_rel` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `role_id` bigint NULL DEFAULT NULL COMMENT '角色id', - `menu_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '菜单资源id []分割', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色菜单关系表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_role_menu_rel --- ---------------------------- -INSERT INTO `sys_role_menu_rel` VALUES (111, 0, 3333333, '[1]', '2023-09-12 20:59:26', NULL, NULL, NULL); -INSERT INTO `sys_role_menu_rel` VALUES (1151243989895483414, 0, 1151247731923488769, '[1][2][3][13][14][15]', '2023-09-12 19:52:22', '2023-09-12 19:52:24', 0, 0); - --- ---------------------------- --- Table structure for sys_serial_number --- ---------------------------- -DROP TABLE IF EXISTS `sys_serial_number`; -CREATE TABLE `sys_serial_number` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `product_id` bigint NULL DEFAULT NULL COMMENT '产品表id', - `warehouse_id` bigint NULL DEFAULT NULL COMMENT '仓库id', - `serial_number` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '序列号', - `sell_status` tinyint(1) NULL DEFAULT 0 COMMENT '是否卖出,0未卖出,1卖出', - `inbound_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '入库单号', - `outbound_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '出库单号', - `remark` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '序列号表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_serial_number --- ---------------------------- -INSERT INTO `sys_serial_number` VALUES (105, 63, 586, 14, '12312323423223', 0, NULL, NULL, 'abab', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_serial_number` VALUES (108, 63, 586, 14, '3215952626621201', 0, NULL, NULL, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_serial_number` VALUES (109, 63, 586, 14, '3215952626621202', 0, NULL, NULL, '', NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_serial_number` VALUES (110, NULL, 586, 14, '500', 0, 'LSTH00000000665', NULL, NULL, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_tenant --- ---------------------------- -DROP TABLE IF EXISTS `sys_tenant`; -CREATE TABLE `sys_tenant` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '租户名称', - `user_num_limit` int NULL DEFAULT NULL COMMENT '用户数量限制', - `type` tinyint(1) NULL DEFAULT 0 COMMENT '租户类型,0免费租户,1付费租户', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '启用 0-禁用 1-启用', - `remark` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `expire_time` datetime NULL DEFAULT NULL COMMENT '到期时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '租户' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_tenant --- ---------------------------- -INSERT INTO `sys_tenant` VALUES (1151153829895868454, 1151153829895868454, '测试租户', 3, 0, 1, NULL, '2023-08-30 18:13:17', NULL, '2031-11-16 18:13:17'); -INSERT INTO `sys_tenant` VALUES (1151153829895868463, 1151153829895868463, '万森租户', 2000, 1, 1, NULL, '2021-02-17 23:19:17', NULL, '2099-02-17 23:19:17'); - --- ---------------------------- --- Table structure for sys_tenant_user --- ---------------------------- -DROP TABLE IF EXISTS `sys_tenant_user`; -CREATE TABLE `sys_tenant_user` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名', - `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名', - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', - `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱', - `phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号', - `status` tinyint NULL DEFAULT NULL COMMENT '状态(0-启用,1-停用)', - `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '备注', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_tenant_user --- ---------------------------- -INSERT INTO `sys_tenant_user` VALUES (1087504242027003904, 0, '石平', '石平', 'veniam do eiusmod dolore', 'o.cutbrn@qq.com', '16', 0, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `sys_tenant_user` VALUES (1087514228476084224, 1071, '夏勇', 'xiayong', 'xy123456', 'l.mafisbh@qq.com', '17715151625', 0, NULL, NULL, NULL, NULL, NULL); - --- ---------------------------- --- Table structure for sys_user --- ---------------------------- -DROP TABLE IF EXISTS `sys_user`; -CREATE TABLE `sys_user` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '用户姓名--例如张三', - `user_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '登录用户名', - `password` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '登陆密码', - `leader_flag` tinyint(1) NULL DEFAULT 0 COMMENT '是否经理,0否,1是', - `position` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '职位', - `email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '电子邮箱', - `phone_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '手机号码', - `avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '头像地址', - `is_manager` tinyint NOT NULL DEFAULT 1 COMMENT '是否为管理者 0==管理者 1==员工', - `is_system` tinyint NOT NULL DEFAULT 0 COMMENT '是否系统自带数据 ', - `status` tinyint NULL DEFAULT 0 COMMENT '状态,0:正常,1:删除,2封禁', - `description` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户描述信息', - `remark` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `wechat_open_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '微信绑定', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_Flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用户表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_user --- ---------------------------- -INSERT INTO `sys_user` VALUES (1151247731923488777, 1151153829895868454, '测试用户2', 'test2', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, NULL, '2023-09-14 22:00:26', NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1151247731927683073, 0, '万森小杨', 'xiaoyang', 'e10adc3949ba59abbe56e057f20f883e', 0, '总监', '7777777@qq.com', '', 'https://points.wansen.cloud/group1/default/20230821/12/50/4/tmp_b389e880bb493e7249181dd7f6708cfd.jpg?download=0', 1, 0, 0, '', NULL, NULL, '2023-09-14 22:00:30', NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1151247731927683077, 0, '管理员', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 0, '集团管理员', 'jameszow@wansen.email', '16621211605', 'https://points.wansen.cloud/group1/default/20230821/12/50/4/tmp_b389e880bb493e7249181dd7f6708cfd.jpg?download=0', 1, 0, 0, NULL, NULL, NULL, '2023-09-14 22:00:28', NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1151247731927683082, 0, '测试用户', 'test', 'e10adc3949ba59abbe56e057f20f883e', 0, '主管', '666666@qq.com', '', NULL, 1, 1, 0, '', NULL, NULL, '2023-09-14 22:00:32', NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1151934773204090880, 1151934773204090881, '赵伟', 'zhaowei', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, '', NULL, NULL, 1, 0, 0, NULL, NULL, NULL, '2023-09-14 22:00:35', NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132865, 0, '王有田', 'youtian', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'testyu@wansenai.com', '17015963215', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132870, 0, '李法群', 'tli18716', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'htomassl@qq.com', '13379815236', NULL, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132879, 0, '张晓东', 'xiaodongzhang', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'yuxiuaa@tecia.com', '18015156235', NULL, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132893, 0, '黄磊', 'hl6789', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'biosss@126.com', '15618529781', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132895, 0, '王一亭', 'wangyt', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'ciarsit@163.com', '15015151623', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132897, 0, '梁伟', 'lw17816152316', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'cestuis@163.com', '17816152316', NULL, 1, 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132900, 0, '梁超飞', 'chaofei7788', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'hjunweiu@163.com', '17715151623', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1153648835588132912, 0, '孙婷', 'sunting', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, 'asdjjamsai@hotmail.com', '18027431919', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1154127100467216384, 1154127100471410688, '李丽红', 'ouoppy', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, NULL, '16621211608', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `sys_user` VALUES (1154139420769648640, 1154139420773842944, '杨雅', 'yangxiaoya', '7bc7b277e3436b88e2494da6194ce807', 0, NULL, NULL, '16621211606', NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for sys_user_business --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_business`; -CREATE TABLE `sys_user_business` ( - `id` bigint NOT NULL COMMENT '主键', - `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '类别', - `key_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '主id', - `value` varchar(10000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '值', - `btn_str` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '按钮权限', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '用户/角色/模块关系表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_user_business --- ---------------------------- -INSERT INTO `sys_user_business` VALUES (5, 'RoleFunctions', '4', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][1][14][243][15][234][16][18][236][245][248][198][258][259]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"btnStr\":\"1\"},{\"funId\":236,\"btnStr\":\"1\"},{\"funId\":245,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,2,7\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,7,2\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,7,2\"},{\"funId\":206,\"btnStr\":\"1,2,7\"},{\"funId\":212,\"btnStr\":\"1,7,2\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', NULL, 0); -INSERT INTO `sys_user_business` VALUES (6, 'RoleFunctions', '5', '[22][23][25][26][194][195][31][33][200][201][41][199][202]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (7, 'RoleFunctions', '6', '[22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"33\",\"btnStr\":\"4\"}]', NULL, 0); -INSERT INTO `sys_user_business` VALUES (9, 'RoleFunctions', '7', '[168][13][12][16][14][15][189][18][19][132]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (10, 'RoleFunctions', '8', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][247]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (11, 'RoleFunctions', '9', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][188]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (12, 'UserRole', '1', '[5]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (13, 'UserRole', '2', '[6][7]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (14, 'UserDepot', '2', '[1][2][6][7]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (15, 'UserDepot', '1', '[1][2][5][6][7][10][12][14][15][17]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (16, 'UserRole', '63', '[10]', NULL, 63, 0); -INSERT INTO `sys_user_business` VALUES (18, 'UserDepot', '63', '[14][15][19]', NULL, 63, 0); -INSERT INTO `sys_user_business` VALUES (19, 'UserDepot', '5', '[6][45][46][50]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (20, 'UserRole', '5', '[5]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (21, 'UserRole', '64', '[13]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (22, 'UserDepot', '64', '[1]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (23, 'UserRole', '65', '[5]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (24, 'UserDepot', '65', '[1]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (25, 'UserCustomer', '64', '[5][2]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (26, 'UserCustomer', '65', '[6]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (27, 'UserCustomer', '63', '[58][91]', NULL, 63, 0); -INSERT INTO `sys_user_business` VALUES (28, 'UserDepot', '96', '[7]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (29, 'UserRole', '96', '[6]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (30, 'UserRole', '113', '[10]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (32, 'RoleFunctions', '10', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][14][243][15][234][248][198][259]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,7,2\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,2,7\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,2,7\"},{\"funId\":206,\"btnStr\":\"1,7,2\"},{\"funId\":212,\"btnStr\":\"1,2,7\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', NULL, 0); -INSERT INTO `sys_user_business` VALUES (34, 'UserRole', '115', '[10]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (35, 'UserRole', '117', '[10]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (36, 'UserDepot', '117', '[8][9]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (37, 'UserCustomer', '117', '[52]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (38, 'UserRole', '120', '[4]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (41, 'RoleFunctions', '12', '', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (48, 'RoleFunctions', '13', '[59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (51, 'UserRole', '74', '[10]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (52, 'UserDepot', '121', '[13]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (54, 'UserDepot', '115', '[13]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (56, 'UserCustomer', '115', '[56]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (57, 'UserCustomer', '121', '[56]', NULL, NULL, 0); -INSERT INTO `sys_user_business` VALUES (67, 'UserRole', '131', '[17]', NULL, 63, 0); -INSERT INTO `sys_user_business` VALUES (68, 'RoleFunctions', '16', '[210][211][225]', '[{\"funId\":210,\"btnStr\":\"1\"}]', 63, 0); -INSERT INTO `sys_user_business` VALUES (69, 'RoleFunctions', '17', '[210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"241\",\"btnStr\":\"1,2\"},{\"funId\":\"33\",\"btnStr\":\"1,2\"},{\"funId\":\"199\",\"btnStr\":\"1,2\"},{\"funId\":\"242\",\"btnStr\":\"1,2\"},{\"funId\":\"41\",\"btnStr\":\"1,2\"},{\"funId\":\"200\",\"btnStr\":\"1,2\"},{\"funId\":\"210\",\"btnStr\":\"1,2\"},{\"funId\":\"211\",\"btnStr\":\"1,2\"},{\"funId\":\"197\",\"btnStr\":\"1\"},{\"funId\":\"203\",\"btnStr\":\"1\"},{\"funId\":\"204\",\"btnStr\":\"1\"},{\"funId\":\"205\",\"btnStr\":\"1\"},{\"funId\":\"206\",\"btnStr\":\"1\"},{\"funId\":\"212\",\"btnStr\":\"1\"},{\"funId\":\"201\",\"btnStr\":\"1,2\"},{\"funId\":\"202\",\"btnStr\":\"1,2\"},{\"funId\":\"40\",\"btnStr\":\"1,2\"},{\"funId\":\"232\",\"btnStr\":\"1,2\"},{\"funId\":\"233\",\"btnStr\":\"1,2\"}]', 63, 0); -INSERT INTO `sys_user_business` VALUES (83, 'UserRole', '146', '[10]', NULL, 146, 0); - --- ---------------------------- --- Table structure for sys_user_dept_rel --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_dept_rel`; -CREATE TABLE `sys_user_dept_rel` ( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `dept_id` bigint NOT NULL COMMENT '部门id', - `user_id` bigint NOT NULL COMMENT '用户id', - `user_dept_sort` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '用户在所属部门中显示顺序', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1154812104042483719 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '机构用户关系表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of sys_user_dept_rel --- ---------------------------- -INSERT INTO `sys_user_dept_rel` VALUES (1154490573424824344, 0, 1154756575114956805, 1151247731927683077, '1', 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154756575110762507, 0, 1154794589174239277, 1151247731927683077, '0', 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289408, NULL, 1154490573429018634, 1153648835588132900, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289409, NULL, 1154490573429018634, 1153648835588132912, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289412, NULL, 1154794589174239268, 1153648835588132897, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289420, NULL, 1154794589174239268, 1153648835588132895, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289431, NULL, 1154794589174239242, 1153648835588132893, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289436, NULL, 1154794589174239242, 1153648835588132879, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289446, NULL, 1154756575114956805, 1151247731927683073, '1', 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104038289447, NULL, 1154794589170044930, 1153648835588132870, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104042483713, NULL, 1154756575114956805, 1151247731927683082, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104042483715, NULL, 1154794589170044930, 1153648835588132865, NULL, 0, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_dept_rel` VALUES (1154812104042483718, NULL, 1154794589170044930, 1151934773204090880, NULL, 0, NULL, NULL, NULL, NULL); - --- ---------------------------- --- Table structure for sys_user_role_rel --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_role_rel`; -CREATE TABLE `sys_user_role_rel` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `user_id` bigint NULL DEFAULT NULL COMMENT '用户id', - `role_id` bigint NULL DEFAULT NULL COMMENT '角色id', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户角色关系表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_user_role_rel --- ---------------------------- -INSERT INTO `sys_user_role_rel` VALUES (2, 1151153829895868463, 1151247731927683077, 3333333, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1151154778412552229, 0, 1151247731927683077, 1151247731923488769, '2023-09-12 13:59:06', '2023-09-12 13:59:08', 0, 0); -INSERT INTO `sys_user_role_rel` VALUES (1155222611291410455, 0, 1153648835588132870, 1151153250280804356, '2023-09-23 19:22:39', '2023-09-23 19:22:42', NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155222611291410462, 0, 1153648835588132895, 1151153250280804400, '2023-09-23 19:23:14', '2023-09-23 19:23:17', NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155232990910353443, 0, 1153648835588132897, 1151153250280804397, '2023-09-23 20:04:31', NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155240913224994821, 0, 1153648835588132865, 1151153250280804397, '2023-09-23 20:35:26', NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155240913224994822, 0, 1153648835588132912, 1151153250280804400, NULL, NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155240913224994825, 0, 1153648835588132879, 1151153250280804400, '2023-09-23 20:35:45', NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155240913224994826, 0, 1153648835588132893, 1151153250280804356, '2023-09-23 20:36:09', NULL, NULL, NULL); -INSERT INTO `sys_user_role_rel` VALUES (1155240913224994831, 0, 1153648835588132900, 1151153250280804400, '2023-09-23 20:36:33', NULL, NULL, NULL); - --- ---------------------------- --- Table structure for sys_user_warehouse_rel --- ---------------------------- -DROP TABLE IF EXISTS `sys_user_warehouse_rel`; -CREATE TABLE `sys_user_warehouse_rel` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `user_id` bigint NOT NULL COMMENT '用户id', - `warehouse_id` bigint NOT NULL COMMENT '仓库id', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of sys_user_warehouse_rel --- ---------------------------- - --- ---------------------------- --- Table structure for warehouse --- ---------------------------- -DROP TABLE IF EXISTS `warehouse`; -CREATE TABLE `warehouse` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `principal` bigint NULL DEFAULT NULL COMMENT '负责人', - `name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '仓库名称', - `address` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '仓库地址', - `warehous_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '仓储费', - `truckage` decimal(24, 6) NULL DEFAULT NULL COMMENT '搬运费', - `type` int NULL DEFAULT NULL COMMENT '类型', - `status` tinyint(1) NULL DEFAULT 0 COMMENT '状态(0-启用,1-停用)', - `remark` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '描述', - `sort` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '排序', - `is_default` tinyint(1) NULL DEFAULT 0 COMMENT '是否默认仓库(0-启用,1-停用)', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_Flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '仓库表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of warehouse --- ---------------------------- -INSERT INTO `warehouse` VALUES (14, 63, 131, '仓库1', 'dizhi', 12.000000, 12.000000, 0, 1, '描述', '1', 1, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse` VALUES (15, 63, 131, '仓库2', '地址100', 555.000000, 666.000000, 0, 1, 'dfdf', '2', 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse` VALUES (17, 63, 131, '仓库3', '123123', 123.000000, 123.000000, 0, 1, '123', '3', 0, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse` VALUES (19, NULL, NULL, '仓库666', NULL, 11.000000, NULL, 0, 1, NULL, NULL, 0, NULL, NULL, NULL, NULL, 0); - --- ---------------------------- --- Table structure for warehouse_head --- ---------------------------- -DROP TABLE IF EXISTS `warehouse_head`; -CREATE TABLE `warehouse_head` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '主类型 (出库/入库)', - `sub_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '子类型(采购订单/采购退货/销售订单/组装单/拆卸单)', - `init_bill_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '初始票据号', - `bill_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '票据号', - `supplier_id` bigint NULL DEFAULT NULL COMMENT '供应商id', - `account_id` bigint NULL DEFAULT NULL COMMENT '账户id', - `change_amount` decimal(24, 6) NULL DEFAULT NULL COMMENT '变动金额(收款/付款)', - `back_amount` decimal(24, 6) NULL DEFAULT NULL COMMENT '找零金额', - `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额', - `pay_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '付款类型(现金、记账等)', - `bill_type` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '单据类型', - `remark` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `file_name` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '附件名称', - `sales_man` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '业务员(可以多个)', - `account_id_list` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '多账户ID列表', - `account_money_list` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '多账户金额列表', - `discount` decimal(24, 6) NULL DEFAULT NULL COMMENT '优惠率', - `discount_money` decimal(24, 6) NULL DEFAULT NULL COMMENT '优惠金额', - `discount_last_money` decimal(24, 6) NULL DEFAULT NULL COMMENT '优惠后金额', - `other_money` decimal(24, 6) NULL DEFAULT NULL COMMENT '销售或采购费用合计', - `deposit` decimal(24, 6) NULL DEFAULT NULL COMMENT '订金', - `status` tinyint(1) NULL DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售、9审核中', - `purchase_status` tinyint(1) NULL DEFAULT NULL COMMENT '采购状态,0未采购、2完成采购、3部分采购', - `source` tinyint(1) NULL DEFAULT 0 COMMENT '单据来源,0-pc,1-手机', - `correlation_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '关联订单号', - `operate_time` datetime NULL DEFAULT NULL COMMENT '操作时间(出/入库时间)', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK2A80F214B610FC06`(`supplier_id` ASC) USING BTREE, - INDEX `FK2A80F214AAE50527`(`account_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '单据主表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of warehouse_head --- ---------------------------- -INSERT INTO `warehouse_head` VALUES (258, 63, '其它', '采购订单', 'CGDD00000000630', 'CGDD00000000630', 57, NULL, NULL, NULL, -110.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2, 0, 0, NULL, '2021-06-02 00:21:44', '2021-06-02 00:21:54', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (259, 63, '入库', '采购', 'CGRK00000000631', 'CGRK00000000631', 57, 17, -110.000000, NULL, -110.000000, '现付', NULL, NULL, NULL, NULL, '', '', 0.000000, 0.000000, 110.000000, 0.000000, NULL, 0, 0, 0, 'CGDD00000000630', '2021-06-02 00:22:05', '2021-06-02 00:22:23', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (260, 63, '出库', '采购退货', 'CGTH00000000632', 'CGTH00000000632', 57, 17, 22.000000, 0.000000, 22.000000, '现付', NULL, NULL, '', NULL, '', '', 0.000000, 0.000000, 22.000000, 0.000000, 0.000000, 1, 0, 0, NULL, '2021-06-02 00:22:26', '2021-06-02 00:22:35', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (261, 63, '其它', '销售订单', 'XSDD00000000633', 'XSDD00000000633', 58, NULL, NULL, NULL, 44.000000, '现付', NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2, 0, 0, NULL, '2021-06-02 00:22:39', '2021-06-02 00:22:48', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (262, 63, '出库', '销售', 'XSCK00000000634', 'XSCK00000000634', 58, 17, 44.000000, NULL, 44.000000, '现付', NULL, NULL, NULL, '', '', '', 0.000000, 0.000000, 44.000000, 0.000000, NULL, 0, 0, 0, 'XSDD00000000633', '2021-06-02 00:22:54', '2021-06-02 00:23:03', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (263, 63, '入库', '销售退货', 'XSTH00000000635', 'XSTH00000000635', 71, 17, -22.000000, NULL, -22.000000, '现付', NULL, NULL, NULL, '', '', '', 0.000000, 0.000000, 22.000000, 0.000000, NULL, 0, 0, 0, NULL, '2021-06-02 00:23:05', '2021-06-02 00:23:12', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (264, 63, '出库', '零售', 'LSCK00000000636', 'LSCK00000000636', 60, 17, 22.000000, NULL, 22.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2021-06-02 00:23:14', '2021-06-02 00:23:21', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (265, 63, '入库', '零售退货', 'LSTH00000000637', 'LSTH00000000637', 60, 17, -1000.000000, 0.000000, -1000.000000, '现付', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, 0.000000, NULL, 0.000000, 0, 0, 0, NULL, '2021-06-02 00:23:23', '2021-06-02 00:23:29', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (266, 63, '入库', '其它', 'QTRK00000000638', 'QTRK00000000638', 57, NULL, NULL, NULL, -55.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, '2021-06-02 00:23:36', '2021-06-02 00:23:48', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (267, 63, '出库', '其它', 'QTCK00000000639', 'QTCK00000000639', 58, NULL, NULL, NULL, 30.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2021-06-02 00:23:50', '2021-06-02 00:23:59', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (268, 63, '出库', '调拨', 'DBCK00000000640', 'DBCK00000000640', NULL, NULL, 0.000000, 0.000000, 2442.000000, '现付', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, 0.000000, NULL, 0.000000, 0, 0, 0, NULL, '2021-06-02 00:24:00', '2021-06-02 00:24:09', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (269, 63, '其它', '组装单', 'ZZD00000000641', 'ZZD00000000641', NULL, NULL, NULL, NULL, 0.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2021-06-02 00:24:11', '2021-06-02 00:24:29', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (270, 63, '其它', '拆卸单', 'CXD00000000642', 'CXD00000000642', NULL, NULL, NULL, NULL, 0.000000, '现付', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2021-06-02 00:24:32', '2021-06-02 00:24:45', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (271, 63, '入库', '采购', 'CGRK00000000651', 'CGRK00000000651', 57, 17, -20.000000, NULL, -80.000000, '现付', NULL, NULL, NULL, NULL, '', '', 0.000000, 0.000000, 80.000000, 0.000000, NULL, 0, 0, 0, NULL, '2021-07-06 23:44:45', '2021-07-06 23:45:20', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (272, 63, '出库', '销售', 'XSCK00000000652', 'XSCK00000000652', 58, 17, 8.000000, NULL, 28.000000, '现付', NULL, NULL, NULL, '', '', '', 0.000000, 0.000000, 28.000000, 0.000000, NULL, 0, 0, 0, NULL, '2021-07-06 23:45:24', '2021-07-06 23:46:07', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (273, 63, '入库', '采购', 'CGRK00000000658', 'CGRK00000000658', 57, 17, -60.000000, NULL, -60.000000, '现付', NULL, NULL, NULL, NULL, '', '', 0.000000, 0.000000, 60.000000, 0.000000, NULL, 0, 0, 0, NULL, '2021-07-28 00:58:02', '2021-07-28 00:58:12', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (274, NULL, '出库', '零售', 'LSCK00000000663', 'LSCK00000000663', 92, 17, 100.000000, 0.000000, 100.000000, '现付', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, 0.000000, NULL, 0.000000, 0, 0, 0, NULL, '2023-08-30 18:09:18', '2023-08-30 18:09:51', NULL, 63, NULL, 1); -INSERT INTO `warehouse_head` VALUES (277, NULL, '入库', '零售退货', 'LSTH00000000665', 'LSTH00000000665', 60, 17, -15.000000, 0.000000, -15.000000, '现付', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2023-08-30 18:10:40', '2023-08-30 18:11:10', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (278, NULL, '其它', '采购订单', 'CGDD00000000666', 'CGDD00000000666', 68, 17, 0.000000, NULL, -240.000000, '现付', NULL, NULL, '', NULL, '', '', 0.000000, 0.000000, 240.000000, NULL, NULL, 0, 0, 0, NULL, '2023-08-30 18:11:31', '2023-08-30 18:12:02', NULL, 63, NULL, 0); -INSERT INTO `warehouse_head` VALUES (279, NULL, '出库', '采购退货', 'CGTH00000000668', 'CGTH00000000668', 57, 17, 22.000000, 0.000000, 22.000000, '现付', '', NULL, '', NULL, '', '', 0.000000, 0.000000, 22.000000, 0.000000, NULL, 1, 0, 0, '', '2023-09-02 13:40:02', '2023-09-02 13:40:06', NULL, 63, NULL, 0); - --- ---------------------------- --- Table structure for warehouse_item --- ---------------------------- -DROP TABLE IF EXISTS `warehouse_item`; -CREATE TABLE `warehouse_item` ( - `id` bigint NOT NULL COMMENT '主键', - `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', - `header_id` bigint NOT NULL COMMENT '表头Id', - `product_id` bigint NOT NULL COMMENT '商品Id', - `product_extend_id` bigint NULL DEFAULT NULL COMMENT '商品扩展id', - `product_unit` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '商品计量单位', - `multi_attribute` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '多属性', - `oper_number` decimal(24, 6) NULL DEFAULT NULL COMMENT '数量', - `basic_number` decimal(24, 6) NULL DEFAULT NULL COMMENT '基础数量,如kg、瓶', - `unit_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '单价', - `purchase_unit_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '采购单价', - `tax_unit_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '含税单价', - `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '金额', - `remark` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '备注', - `warehouse_id` bigint NULL DEFAULT NULL COMMENT '仓库ID', - `another_warehouse_id` bigint NULL DEFAULT NULL COMMENT '调拨时,对方仓库Id', - `tax_rate` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率', - `tax_money` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额', - `tax_last_money` decimal(24, 6) NULL DEFAULT NULL COMMENT '价税合计', - `product_type` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '商品类型', - `serial_numbers_list` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '序列号列表', - `batch_number` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '批次号', - `effective_date` datetime NULL DEFAULT NULL COMMENT '有效日期', - `correlation_id` bigint NULL DEFAULT NULL COMMENT '关联明细id', - `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', - `create_by` bigint NULL DEFAULT NULL COMMENT '创建人', - `update_by` bigint NULL DEFAULT NULL COMMENT '修改人', - `delete_flag` tinyint(1) NULL DEFAULT 0 COMMENT '删除标记,0未删除,1删除', - PRIMARY KEY (`id`) USING BTREE, - INDEX `FK2A819F475D61CCF7`(`product_id` ASC) USING BTREE, - INDEX `FK2A819F474BB6190E`(`header_id` ASC) USING BTREE, - INDEX `FK2A819F479485B3F5`(`warehouse_id` ASC) USING BTREE, - INDEX `FK2A819F47729F5392`(`another_warehouse_id` ASC) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '单据子表' ROW_FORMAT = DYNAMIC; - --- ---------------------------- --- Records of warehouse_item --- ---------------------------- -INSERT INTO `warehouse_item` VALUES (312, 63, 258, 588, 10, '个', NULL, 10.000000, 10.000000, 11.000000, NULL, NULL, 110.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (313, 63, 259, 588, 10, '个', NULL, 10.000000, 10.000000, 11.000000, NULL, NULL, 110.000000, NULL, 14, NULL, NULL, 0.000000, 110.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (315, 63, 261, 588, 10, '个', NULL, 2.000000, 2.000000, 22.000000, NULL, NULL, 44.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (316, 63, 262, 588, 10, '个', NULL, 2.000000, 2.000000, 22.000000, NULL, NULL, 44.000000, NULL, 14, NULL, NULL, 0.000000, 44.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (317, 63, 263, 588, 10, '个', NULL, 1.000000, 1.000000, 22.000000, NULL, 22.000000, 22.000000, NULL, 14, NULL, 0.000000, 0.000000, 22.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (318, 63, 264, 588, 10, '个', NULL, 1.000000, 1.000000, 22.000000, NULL, NULL, 22.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (320, 63, 266, 568, 2, '个', NULL, 5.000000, 5.000000, 11.000000, NULL, NULL, 55.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (321, 63, 267, 568, 2, '个', NULL, 2.000000, 2.000000, 15.000000, NULL, NULL, 30.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (323, 63, 269, 588, 10, '个', NULL, 1.000000, 1.000000, 0.000000, NULL, NULL, 0.000000, NULL, 14, NULL, NULL, NULL, NULL, '组合件', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (324, 63, 269, 568, 2, '个', NULL, 1.000000, 1.000000, 0.000000, NULL, NULL, 0.000000, NULL, 14, NULL, NULL, NULL, NULL, '普通子件', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (325, 63, 270, 588, 10, '个', NULL, 1.000000, 1.000000, 0.000000, NULL, NULL, 0.000000, NULL, 14, NULL, NULL, NULL, NULL, '组合件', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (326, 63, 270, 568, 2, '个', NULL, 1.000000, 1.000000, 0.000000, NULL, NULL, 0.000000, NULL, 14, NULL, NULL, NULL, NULL, '普通子件', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (327, 63, 271, 570, 4, '个', NULL, 10.000000, 10.000000, 8.000000, NULL, 8.000000, 80.000000, NULL, 14, NULL, 0.000000, 0.000000, 80.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (328, 63, 272, 570, 4, '个', NULL, 2.000000, 2.000000, 14.000000, NULL, 14.000000, 28.000000, NULL, 14, NULL, 0.000000, 0.000000, 28.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (330, 63, 273, 619, 37, '件', '橙色,L', 5.000000, 5.000000, 12.000000, NULL, 12.000000, 60.000000, NULL, 14, NULL, 0.000000, 0.000000, 60.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (333, NULL, 274, 619, 37, '件', '橙色,L', 1.000000, 1.000000, 80.000000, 12.000000, NULL, 80.000000, NULL, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `warehouse_item` VALUES (334, NULL, 274, 619, 37, '件', '橙色,L', 1.000000, 1.000000, 20.000000, 12.000000, NULL, 20.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1); -INSERT INTO `warehouse_item` VALUES (335, NULL, 277, 586, 9, '个', NULL, 1.000000, 1.000000, 15.000000, 12.000000, NULL, 15.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, '500', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (336, NULL, 265, 588, 10, '个', NULL, 20.000000, 20.000000, 50.000000, 11.000000, NULL, 1000.000000, NULL, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (337, NULL, 278, 619, 38, '件', '绿色,M', 20.000000, 20.000000, 12.000000, NULL, NULL, 240.000000, NULL, NULL, NULL, 0.000000, 0.000000, 240.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (338, NULL, 268, 568, 2, '个', NULL, 222.000000, 222.000000, 11.000000, NULL, NULL, 2442.000000, NULL, 14, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (339, NULL, 279, 588, 10, '个', NULL, 2.000000, 2.000000, 11.000000, NULL, NULL, 22.000000, NULL, 14, NULL, 0.000000, 0.000000, 22.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); -INSERT INTO `warehouse_item` VALUES (340, NULL, 260, 588, 10, '个', NULL, 2.000000, 2.000000, 11.000000, NULL, NULL, 22.000000, NULL, 14, NULL, 0.000000, 0.000000, 22.000000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/docs/wansenerp.sql b/docs/wansenerp.sql new file mode 100644 index 00000000..899dd634 --- /dev/null +++ b/docs/wansenerp.sql @@ -0,0 +1,1017 @@ +/* +Navicat MySQL Data Transfer + +Source Server : 127.0.0.1 +Source Server Version : 50704 +Source Host : 127.0.0.1:3306 +Source Database : jsh_erp + +Target Server Type : MYSQL +Target Server Version : 50704 +File Encoding : 65001 + +Date: 2023-06-21 19:00:09 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for jsh_account +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_account`; +CREATE TABLE `jsh_account` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(50) DEFAULT NULL COMMENT '名称', + `serial_no` varchar(50) DEFAULT NULL COMMENT '编号', + `initial_amount` decimal(24,6) DEFAULT NULL COMMENT '期初金额', + `current_amount` decimal(24,6) DEFAULT NULL COMMENT '当前余额', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `is_default` bit(1) DEFAULT NULL COMMENT '是否默认', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='账户信息'; + +-- ---------------------------- +-- Records of jsh_account +-- ---------------------------- +INSERT INTO `jsh_account` VALUES ('17', '账户1', 'zzz111', '100.000000', '829.000000', 'aabb', '', null, '', '63', '0'); +INSERT INTO `jsh_account` VALUES ('18', '账户2', '1234131324', '200.000000', '-1681.000000', 'bbbb', '', null, '\0', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_account_head +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_account_head`; +CREATE TABLE `jsh_account_head` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` varchar(50) DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)', + `organ_id` bigint(20) DEFAULT NULL COMMENT '单位Id(收款/付款单位)', + `hands_person_id` bigint(20) DEFAULT NULL COMMENT '经手人id', + `creator` bigint(20) DEFAULT NULL COMMENT '操作员', + `change_amount` decimal(24,6) DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)', + `discount_money` decimal(24,6) DEFAULT NULL COMMENT '优惠金额', + `total_price` decimal(24,6) DEFAULT NULL COMMENT '合计金额', + `account_id` bigint(20) DEFAULT NULL COMMENT '账户(收款/付款)', + `bill_no` varchar(50) DEFAULT NULL COMMENT '单据编号', + `bill_time` datetime DEFAULT NULL COMMENT '单据日期', + `remark` varchar(1000) DEFAULT NULL COMMENT '备注', + `file_name` varchar(500) DEFAULT NULL COMMENT '附件名称', + `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、9审核中', + `source` varchar(1) DEFAULT '0' COMMENT '单据来源,0-pc,1-手机', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK9F4C0D8DB610FC06` (`organ_id`), + KEY `FK9F4C0D8DAAE50527` (`account_id`), + KEY `FK9F4C0D8DC4170B37` (`hands_person_id`) +) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8 COMMENT='财务主表'; + +-- ---------------------------- +-- Records of jsh_account_head +-- ---------------------------- +INSERT INTO `jsh_account_head` VALUES ('118', '收入', '58', '16', '63', '55.000000', null, '55.000000', '17', 'SR00000000643', '2021-06-02 00:24:49', null, null, '1', '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('119', '支出', '68', '16', '63', '-66.000000', null, '-66.000000', '17', 'ZC00000000644', '2021-06-02 00:25:01', null, null, '0', '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('122', '转账', null, '17', '63', '-11.000000', null, '-11.000000', '17', 'ZZ00000000647', '2021-06-02 00:25:32', null, null, '0', '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('124', '收预付款', '60', '17', '63', '80.000000', '0.000000', '80.000000', null, 'SYF00000000649', '2021-07-06 23:43:48', null, null, '0', '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('125', '收款', '58', '17', '63', '10.000000', '0.000000', '10.000000', '17', 'SK00000000653', '2021-07-06 23:46:38', null, null, '0', '0', '63', '0'); +INSERT INTO `jsh_account_head` VALUES ('126', '付款', '57', '17', '63', '-50.000000', '0.000000', '-50.000000', '17', 'FK00000000654', '2021-07-06 23:47:23', null, null, '0', '0', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_account_item +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_account_item`; +CREATE TABLE `jsh_account_item` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `header_id` bigint(20) NOT NULL COMMENT '表头Id', + `account_id` bigint(20) DEFAULT NULL COMMENT '账户Id', + `in_out_item_id` bigint(20) DEFAULT NULL COMMENT '收支项目Id', + `bill_id` bigint(20) DEFAULT NULL COMMENT '单据id', + `need_debt` decimal(24,6) DEFAULT NULL COMMENT '应收欠款', + `finish_debt` decimal(24,6) DEFAULT NULL COMMENT '已收欠款', + `each_amount` decimal(24,6) DEFAULT NULL COMMENT '单项金额', + `remark` varchar(100) DEFAULT NULL COMMENT '单据备注', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK9F4CBAC0AAE50527` (`account_id`), + KEY `FK9F4CBAC0C5FE6007` (`header_id`), + KEY `FK9F4CBAC0D203EDC5` (`in_out_item_id`) +) ENGINE=InnoDB AUTO_INCREMENT=152 DEFAULT CHARSET=utf8 COMMENT='财务子表'; + +-- ---------------------------- +-- Records of jsh_account_item +-- ---------------------------- +INSERT INTO `jsh_account_item` VALUES ('143', '118', null, '23', null, null, null, '55.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('144', '119', null, '21', null, null, null, '66.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('147', '122', '17', null, null, null, null, '11.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('149', '124', '17', null, null, null, null, '80.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('150', '125', null, null, '272', '20.000000', '0.000000', '10.000000', '', '63', '0'); +INSERT INTO `jsh_account_item` VALUES ('151', '126', null, null, '271', '60.000000', '0.000000', '-50.000000', '', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_depot +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_depot`; +CREATE TABLE `jsh_depot` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(20) DEFAULT NULL COMMENT '仓库名称', + `address` varchar(50) DEFAULT NULL COMMENT '仓库地址', + `warehousing` decimal(24,6) DEFAULT NULL COMMENT '仓储费', + `truckage` decimal(24,6) DEFAULT NULL COMMENT '搬运费', + `type` int(10) DEFAULT NULL COMMENT '类型', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `remark` varchar(100) DEFAULT NULL COMMENT '描述', + `principal` bigint(20) DEFAULT NULL COMMENT '负责人', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + `is_default` bit(1) DEFAULT NULL COMMENT '是否默认', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='仓库表'; + +-- ---------------------------- +-- Records of jsh_depot +-- ---------------------------- +INSERT INTO `jsh_depot` VALUES ('14', '仓库1', 'dizhi', '12.000000', '12.000000', '0', '1', '描述', '131', '', '63', '0', ''); +INSERT INTO `jsh_depot` VALUES ('15', '仓库2', '地址100', '555.000000', '666.000000', '0', '2', 'dfdf', '131', '', '63', '0', '\0'); +INSERT INTO `jsh_depot` VALUES ('17', '仓库3', '123123', '123.000000', '123.000000', '0', '3', '123', '131', '', '63', '0', '\0'); + +-- ---------------------------- +-- Table structure for jsh_depot_head +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_depot_head`; +CREATE TABLE `jsh_depot_head` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` varchar(50) DEFAULT NULL COMMENT '类型(出库/入库)', + `sub_type` varchar(50) DEFAULT NULL COMMENT '出入库分类', + `default_number` varchar(50) DEFAULT NULL COMMENT '初始票据号', + `number` varchar(50) DEFAULT NULL COMMENT '票据号', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `oper_time` datetime DEFAULT NULL COMMENT '出入库时间', + `organ_id` bigint(20) DEFAULT NULL COMMENT '供应商id', + `creator` bigint(20) DEFAULT NULL COMMENT '操作员', + `account_id` bigint(20) DEFAULT NULL COMMENT '账户id', + `change_amount` decimal(24,6) DEFAULT NULL COMMENT '变动金额(收款/付款)', + `back_amount` decimal(24,6) DEFAULT NULL COMMENT '找零金额', + `total_price` decimal(24,6) DEFAULT NULL COMMENT '合计金额', + `pay_type` varchar(50) DEFAULT NULL COMMENT '付款类型(现金、记账等)', + `bill_type` varchar(50) DEFAULT NULL COMMENT '单据类型', + `remark` varchar(1000) DEFAULT NULL COMMENT '备注', + `file_name` varchar(1000) DEFAULT NULL COMMENT '附件名称', + `sales_man` varchar(50) DEFAULT NULL COMMENT '业务员(可以多个)', + `account_id_list` varchar(50) DEFAULT NULL COMMENT '多账户ID列表', + `account_money_list` varchar(200) DEFAULT NULL COMMENT '多账户金额列表', + `discount` decimal(24,6) DEFAULT NULL COMMENT '优惠率', + `discount_money` decimal(24,6) DEFAULT NULL COMMENT '优惠金额', + `discount_last_money` decimal(24,6) DEFAULT NULL COMMENT '优惠后金额', + `other_money` decimal(24,6) DEFAULT NULL COMMENT '销售或采购费用合计', + `deposit` decimal(24,6) DEFAULT NULL COMMENT '订金', + `status` varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售、9审核中', + `purchase_status` varchar(1) DEFAULT NULL COMMENT '采购状态,0未采购、2完成采购、3部分采购', + `source` varchar(1) DEFAULT '0' COMMENT '单据来源,0-pc,1-手机', + `link_number` varchar(50) DEFAULT NULL COMMENT '关联订单号', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK2A80F214B610FC06` (`organ_id`), + KEY `FK2A80F214AAE50527` (`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=274 DEFAULT CHARSET=utf8 COMMENT='单据主表'; + +-- ---------------------------- +-- Records of jsh_depot_head +-- ---------------------------- +INSERT INTO `jsh_depot_head` VALUES ('258', '其它', '采购订单', 'CGDD00000000630', 'CGDD00000000630', '2021-06-02 00:21:54', '2021-06-02 00:21:44', '57', '63', null, null, null, '-110.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '2', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('259', '入库', '采购', 'CGRK00000000631', 'CGRK00000000631', '2021-06-02 00:22:23', '2021-06-02 00:22:05', '57', '63', '17', '-110.000000', null, '-110.000000', '现付', null, null, null, null, '', '', '0.000000', '0.000000', '110.000000', '0.000000', null, '0', '0', '0', 'CGDD00000000630', '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('260', '出库', '采购退货', 'CGTH00000000632', 'CGTH00000000632', '2021-06-02 00:22:35', '2021-06-02 00:22:26', '57', '63', '17', '22.000000', null, '22.000000', '现付', null, null, null, null, null, null, '0.000000', '0.000000', '22.000000', '0.000000', null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('261', '其它', '销售订单', 'XSDD00000000633', 'XSDD00000000633', '2021-06-02 00:22:48', '2021-06-02 00:22:39', '58', '63', null, null, null, '44.000000', '现付', null, null, null, '', null, null, null, null, null, null, null, '2', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('262', '出库', '销售', 'XSCK00000000634', 'XSCK00000000634', '2021-06-02 00:23:03', '2021-06-02 00:22:54', '58', '63', '17', '44.000000', null, '44.000000', '现付', null, null, null, '', '', '', '0.000000', '0.000000', '44.000000', '0.000000', null, '0', '0', '0', 'XSDD00000000633', '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('263', '入库', '销售退货', 'XSTH00000000635', 'XSTH00000000635', '2021-06-02 00:23:12', '2021-06-02 00:23:05', '71', '63', '17', '-22.000000', null, '-22.000000', '现付', null, null, null, '', '', '', '0.000000', '0.000000', '22.000000', '0.000000', null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('264', '出库', '零售', 'LSCK00000000636', 'LSCK00000000636', '2021-06-02 00:23:21', '2021-06-02 00:23:14', '60', '63', '17', '22.000000', null, '22.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('265', '入库', '零售退货', 'LSTH00000000637', 'LSTH00000000637', '2021-06-02 00:23:29', '2021-06-02 00:23:23', '60', '63', '17', '-22.000000', null, '-22.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('266', '入库', '其它', 'QTRK00000000638', 'QTRK00000000638', '2021-06-02 00:23:48', '2021-06-02 00:23:36', '57', '63', null, null, null, '-55.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '1', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('267', '出库', '其它', 'QTCK00000000639', 'QTCK00000000639', '2021-06-02 00:23:59', '2021-06-02 00:23:50', '58', '63', null, null, null, '30.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('268', '出库', '调拨', 'DBCK00000000640', 'DBCK00000000640', '2021-06-02 00:24:09', '2021-06-02 00:24:00', null, '63', null, null, null, '11.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('269', '其它', '组装单', 'ZZD00000000641', 'ZZD00000000641', '2021-06-02 00:24:29', '2021-06-02 00:24:11', null, '63', null, null, null, '0.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('270', '其它', '拆卸单', 'CXD00000000642', 'CXD00000000642', '2021-06-02 00:24:45', '2021-06-02 00:24:32', null, '63', null, null, null, '0.000000', '现付', null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('271', '入库', '采购', 'CGRK00000000651', 'CGRK00000000651', '2021-07-06 23:45:20', '2021-07-06 23:44:45', '57', '63', '17', '-20.000000', null, '-80.000000', '现付', null, null, null, null, '', '', '0.000000', '0.000000', '80.000000', '0.000000', null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('272', '出库', '销售', 'XSCK00000000652', 'XSCK00000000652', '2021-07-06 23:46:07', '2021-07-06 23:45:24', '58', '63', '17', '8.000000', null, '28.000000', '现付', null, null, null, '', '', '', '0.000000', '0.000000', '28.000000', '0.000000', null, '0', '0', '0', null, '63', '0'); +INSERT INTO `jsh_depot_head` VALUES ('273', '入库', '采购', 'CGRK00000000658', 'CGRK00000000658', '2021-07-28 00:58:12', '2021-07-28 00:58:02', '57', '63', '17', '-60.000000', null, '-60.000000', '现付', null, null, null, null, '', '', '0.000000', '0.000000', '60.000000', '0.000000', null, '0', '0', '0', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_depot_item +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_depot_item`; +CREATE TABLE `jsh_depot_item` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `header_id` bigint(20) NOT NULL COMMENT '表头Id', + `material_id` bigint(20) NOT NULL COMMENT '商品Id', + `material_extend_id` bigint(20) DEFAULT NULL COMMENT '商品扩展id', + `material_unit` varchar(20) DEFAULT NULL COMMENT '商品计量单位', + `sku` varchar(50) DEFAULT NULL COMMENT '多属性', + `oper_number` decimal(24,6) DEFAULT NULL COMMENT '数量', + `basic_number` decimal(24,6) DEFAULT NULL COMMENT '基础数量,如kg、瓶', + `unit_price` decimal(24,6) DEFAULT NULL COMMENT '单价', + `purchase_unit_price` decimal(24,6) DEFAULT NULL COMMENT '采购单价', + `tax_unit_price` decimal(24,6) DEFAULT NULL COMMENT '含税单价', + `all_price` decimal(24,6) DEFAULT NULL COMMENT '金额', + `remark` varchar(200) DEFAULT NULL COMMENT '备注', + `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库ID', + `another_depot_id` bigint(20) DEFAULT NULL COMMENT '调拨时,对方仓库Id', + `tax_rate` decimal(24,6) DEFAULT NULL COMMENT '税率', + `tax_money` decimal(24,6) DEFAULT NULL COMMENT '税额', + `tax_last_money` decimal(24,6) DEFAULT NULL COMMENT '价税合计', + `material_type` varchar(20) DEFAULT NULL COMMENT '商品类型', + `sn_list` varchar(2000) DEFAULT NULL COMMENT '序列号列表', + `batch_number` varchar(100) DEFAULT NULL COMMENT '批号', + `expiration_date` datetime DEFAULT NULL COMMENT '有效日期', + `link_id` bigint(20) DEFAULT NULL COMMENT '关联明细id', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK2A819F475D61CCF7` (`material_id`), + KEY `FK2A819F474BB6190E` (`header_id`), + KEY `FK2A819F479485B3F5` (`depot_id`), + KEY `FK2A819F47729F5392` (`another_depot_id`) +) ENGINE=InnoDB AUTO_INCREMENT=331 DEFAULT CHARSET=utf8 COMMENT='单据子表'; + +-- ---------------------------- +-- Records of jsh_depot_item +-- ---------------------------- +INSERT INTO `jsh_depot_item` VALUES ('312', '258', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, null, '110.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('313', '259', '588', '10', '个', null, '10.000000', '10.000000', '11.000000', null, null, '110.000000', null, '14', null, null, '0.000000', '110.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('314', '260', '588', '10', '个', null, '2.000000', '2.000000', '11.000000', null, '11.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('315', '261', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, null, '44.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('316', '262', '588', '10', '个', null, '2.000000', '2.000000', '22.000000', null, null, '44.000000', null, '14', null, null, '0.000000', '44.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('317', '263', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, '22.000000', '22.000000', null, '14', null, '0.000000', '0.000000', '22.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('318', '264', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('319', '265', '588', '10', '个', null, '1.000000', '1.000000', '22.000000', null, null, '22.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('320', '266', '568', '2', '个', null, '5.000000', '5.000000', '11.000000', null, null, '55.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('321', '267', '568', '2', '个', null, '2.000000', '2.000000', '15.000000', null, null, '30.000000', null, '14', null, null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('322', '268', '568', '2', '个', null, '1.000000', '1.000000', '11.000000', null, null, '11.000000', null, '14', '15', null, null, null, null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('323', '269', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('324', '269', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('325', '270', '588', '10', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '组合件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('326', '270', '568', '2', '个', null, '1.000000', '1.000000', '0.000000', null, null, '0.000000', null, '14', null, null, null, null, '普通子件', null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('327', '271', '570', '4', '个', null, '10.000000', '10.000000', '8.000000', null, '8.000000', '80.000000', null, '14', null, '0.000000', '0.000000', '80.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('328', '272', '570', '4', '个', null, '2.000000', '2.000000', '14.000000', null, '14.000000', '28.000000', null, '14', null, '0.000000', '0.000000', '28.000000', null, null, null, null, null, '63', '0'); +INSERT INTO `jsh_depot_item` VALUES ('330', '273', '619', '37', '件', '橙色,L', '5.000000', '5.000000', '12.000000', null, '12.000000', '60.000000', null, '14', null, '0.000000', '0.000000', '60.000000', null, null, null, null, null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_function +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_function`; +CREATE TABLE `jsh_function` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `number` varchar(50) DEFAULT NULL COMMENT '编号', + `name` varchar(50) DEFAULT NULL COMMENT '名称', + `parent_number` varchar(50) DEFAULT NULL COMMENT '上级编号', + `url` varchar(100) DEFAULT NULL COMMENT '链接', + `component` varchar(100) DEFAULT NULL COMMENT '组件', + `state` bit(1) DEFAULT NULL COMMENT '收缩', + `sort` varchar(50) DEFAULT NULL COMMENT '排序', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `type` varchar(50) DEFAULT NULL COMMENT '类型', + `push_btn` varchar(50) DEFAULT NULL COMMENT '功能按钮', + `icon` varchar(50) DEFAULT NULL COMMENT '图标', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`url`) +) ENGINE=InnoDB AUTO_INCREMENT=260 DEFAULT CHARSET=utf8 COMMENT='功能模块表'; + +-- ---------------------------- +-- Records of jsh_function +-- ---------------------------- +INSERT INTO `jsh_function` VALUES ('1', '0001', '系统管理', '0', '/system', '/layouts/TabLayout', '', '0910', '', '电脑版', '', 'setting', '0'); +INSERT INTO `jsh_function` VALUES ('13', '000102', '角色管理', '0001', '/system/role', '/system/RoleList', '\0', '0130', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('14', '000103', '用户管理', '0001', '/system/user', '/system/UserList', '\0', '0140', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('15', '000104', '日志管理', '0001', '/system/log', '/system/LogList', '\0', '0160', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('16', '000105', '功能管理', '0001', '/system/function', '/system/FunctionList', '\0', '0166', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('18', '000109', '租户管理', '0001', '/system/tenant', '/system/TenantList', '\0', '0167', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('21', '0101', '商品管理', '0', '/material', '/layouts/TabLayout', '\0', '0620', '', '电脑版', null, 'shopping', '0'); +INSERT INTO `jsh_function` VALUES ('22', '010101', '商品类别', '0101', '/material/material_category', '/material/MaterialCategoryList', '\0', '0230', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('23', '010102', '商品信息', '0101', '/material/material', '/material/MaterialList', '\0', '0240', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('24', '0102', '基本资料', '0', '/systemA', '/layouts/TabLayout', '\0', '0750', '', '电脑版', null, 'appstore', '0'); +INSERT INTO `jsh_function` VALUES ('25', '01020101', '供应商信息', '0102', '/system/vendor', '/system/VendorList', '\0', '0260', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('26', '010202', '仓库信息', '0102', '/system/depot', '/system/DepotList', '\0', '0270', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('31', '010206', '经手人管理', '0102', '/system/person', '/system/PersonList', '\0', '0284', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('32', '0502', '采购管理', '0', '/bill', '/layouts/TabLayout', '\0', '0330', '', '电脑版', '', 'retweet', '0'); +INSERT INTO `jsh_function` VALUES ('33', '050201', '采购入库', '0502', '/bill/purchase_in', '/bill/PurchaseInList', '\0', '0340', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('38', '0603', '销售管理', '0', '/billB', '/layouts/TabLayout', '\0', '0390', '', '电脑版', '', 'shopping-cart', '0'); +INSERT INTO `jsh_function` VALUES ('40', '080107', '调拨出库', '0801', '/bill/allocation_out', '/bill/AllocationOutList', '\0', '0807', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('41', '060303', '销售出库', '0603', '/bill/sale_out', '/bill/SaleOutList', '\0', '0394', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('44', '0704', '财务管理', '0', '/financial', '/layouts/TabLayout', '\0', '0450', '', '电脑版', '', 'money-collect', '0'); +INSERT INTO `jsh_function` VALUES ('59', '030101', '进销存统计', '0301', '/report/in_out_stock_report', '/report/InOutStockReport', '\0', '0658', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('194', '010204', '收支项目', '0102', '/system/in_out_item', '/system/InOutItemList', '\0', '0282', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('195', '010205', '结算账户', '0102', '/system/account', '/system/AccountList', '\0', '0283', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('197', '070402', '收入单', '0704', '/financial/item_in', '/financial/ItemInList', '\0', '0465', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('198', '0301', '报表查询', '0', '/report', '/layouts/TabLayout', '\0', '0570', '', '电脑版', null, 'pie-chart', '0'); +INSERT INTO `jsh_function` VALUES ('199', '050204', '采购退货', '0502', '/bill/purchase_back', '/bill/PurchaseBackList', '\0', '0345', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('200', '060305', '销售退货', '0603', '/bill/sale_back', '/bill/SaleBackList', '\0', '0396', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('201', '080103', '其它入库', '0801', '/bill/other_in', '/bill/OtherInList', '\0', '0803', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('202', '080105', '其它出库', '0801', '/bill/other_out', '/bill/OtherOutList', '\0', '0805', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('203', '070403', '支出单', '0704', '/financial/item_out', '/financial/ItemOutList', '\0', '0470', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('204', '070404', '收款单', '0704', '/financial/money_in', '/financial/MoneyInList', '\0', '0475', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('205', '070405', '付款单', '0704', '/financial/money_out', '/financial/MoneyOutList', '\0', '0480', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('206', '070406', '转账单', '0704', '/financial/giro', '/financial/GiroList', '\0', '0490', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('207', '030102', '账户统计', '0301', '/report/account_report', '/report/AccountReport', '\0', '0610', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('208', '030103', '采购统计', '0301', '/report/buy_in_report', '/report/BuyInReport', '\0', '0620', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('209', '030104', '销售统计', '0301', '/report/sale_out_report', '/report/SaleOutReport', '\0', '0630', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('210', '040102', '零售出库', '0401', '/bill/retail_out', '/bill/RetailOutList', '\0', '0405', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('211', '040104', '零售退货', '0401', '/bill/retail_back', '/bill/RetailBackList', '\0', '0407', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('212', '070407', '收预付款', '0704', '/financial/advance_in', '/financial/AdvanceInList', '\0', '0495', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('217', '01020102', '客户信息', '0102', '/system/customer', '/system/CustomerList', '\0', '0262', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('218', '01020103', '会员信息', '0102', '/system/member', '/system/MemberList', '\0', '0263', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('220', '010103', '计量单位', '0101', '/system/unit', '/system/UnitList', '\0', '0245', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('225', '0401', '零售管理', '0', '/billC', '/layouts/TabLayout', '\0', '0101', '', '电脑版', '', 'gift', '0'); +INSERT INTO `jsh_function` VALUES ('226', '030106', '入库明细', '0301', '/report/in_detail', '/report/InDetail', '\0', '0640', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('227', '030107', '出库明细', '0301', '/report/out_detail', '/report/OutDetail', '\0', '0645', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('228', '030108', '入库汇总', '0301', '/report/in_material_count', '/report/InMaterialCount', '\0', '0650', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('229', '030109', '出库汇总', '0301', '/report/out_material_count', '/report/OutMaterialCount', '\0', '0655', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('232', '080109', '组装单', '0801', '/bill/assemble', '/bill/AssembleList', '\0', '0809', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('233', '080111', '拆卸单', '0801', '/bill/disassemble', '/bill/DisassembleList', '\0', '0811', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('234', '000105', '系统配置', '0001', '/system/system_config', '/system/SystemConfigList', '\0', '0165', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('235', '030110', '客户对账', '0301', '/report/customer_account', '/report/CustomerAccount', '\0', '0660', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('236', '000106', '商品属性', '0001', '/material/material_property', '/material/MaterialPropertyList', '\0', '0168', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('237', '030111', '供应商对账', '0301', '/report/vendor_account', '/report/VendorAccount', '\0', '0665', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('239', '0801', '仓库管理', '0', '/billD', '/layouts/TabLayout', '\0', '0420', '', '电脑版', '', 'hdd', '0'); +INSERT INTO `jsh_function` VALUES ('241', '050202', '采购订单', '0502', '/bill/purchase_order', '/bill/PurchaseOrderList', '\0', '0335', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('242', '060301', '销售订单', '0603', '/bill/sale_order', '/bill/SaleOrderList', '\0', '0392', '', '电脑版', '1,2,7', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('243', '000108', '机构管理', '0001', '/system/organization', '/system/OrganizationList', '', '0150', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('244', '030112', '库存预警', '0301', '/report/stock_warning_report', '/report/StockWarningReport', '\0', '0670', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('245', '000107', '插件管理', '0001', '/system/plugin', '/system/PluginList', '\0', '0170', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('246', '030113', '商品库存', '0301', '/report/material_stock', '/report/MaterialStock', '\0', '0605', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('247', '010105', '多属性', '0101', '/material/material_attribute', '/material/MaterialAttributeList', '\0', '0250', '', '电脑版', '1', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('248', '030150', '调拨明细', '0301', '/report/allocation_detail', '/report/AllocationDetail', '\0', '0646', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('258', '000112', '平台配置', '0001', '/system/platform_config', '/system/PlatformConfigList', '\0', '0175', '', '电脑版', '', 'profile', '0'); +INSERT INTO `jsh_function` VALUES ('259', '030105', '零售统计', '0301', '/report/retail_out_report', '/report/RetailOutReport', '\0', '0615', '', '电脑版', '', 'profile', '0'); + +-- ---------------------------- +-- Table structure for jsh_in_out_item +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_in_out_item`; +CREATE TABLE `jsh_in_out_item` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(50) DEFAULT NULL COMMENT '名称', + `type` varchar(20) DEFAULT NULL COMMENT '类型', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='收支项目'; + +-- ---------------------------- +-- Records of jsh_in_out_item +-- ---------------------------- +INSERT INTO `jsh_in_out_item` VALUES ('21', '快递费', '支出', '', '', null, '63', '0'); +INSERT INTO `jsh_in_out_item` VALUES ('22', '房租收入', '收入', '', '', null, '63', '0'); +INSERT INTO `jsh_in_out_item` VALUES ('23', '利息收入', '收入', '收入', '', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_log +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_log`; +CREATE TABLE `jsh_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `operation` varchar(500) DEFAULT NULL COMMENT '操作模块名称', + `client_ip` varchar(200) DEFAULT NULL COMMENT '客户端IP', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `status` tinyint(4) DEFAULT NULL COMMENT '操作状态 0==成功,1==失败', + `content` varchar(5000) DEFAULT NULL COMMENT '详情', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + PRIMARY KEY (`id`), + KEY `FKF2696AA13E226853` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7559 DEFAULT CHARSET=utf8 COMMENT='操作日志'; + +-- ---------------------------- +-- Records of jsh_log +-- ---------------------------- + +-- ---------------------------- +-- Table structure for jsh_material +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material`; +CREATE TABLE `jsh_material` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `category_id` bigint(20) DEFAULT NULL COMMENT '产品类型id', + `name` varchar(100) DEFAULT NULL COMMENT '名称', + `mfrs` varchar(50) DEFAULT NULL COMMENT '制造商', + `model` varchar(100) DEFAULT NULL COMMENT '型号', + `standard` varchar(100) DEFAULT NULL COMMENT '规格', + `color` varchar(50) DEFAULT NULL COMMENT '颜色', + `unit` varchar(50) DEFAULT NULL COMMENT '单位-单个', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `img_name` varchar(1000) DEFAULT NULL COMMENT '图片名称', + `unit_id` bigint(20) DEFAULT NULL COMMENT '计量单位Id', + `expiry_num` int(10) DEFAULT NULL COMMENT '保质期天数', + `weight` decimal(24,6) DEFAULT NULL COMMENT '基础重量(kg)', + `enabled` bit(1) DEFAULT NULL COMMENT '启用 0-禁用 1-启用', + `other_field1` varchar(50) DEFAULT NULL COMMENT '自定义1', + `other_field2` varchar(50) DEFAULT NULL COMMENT '自定义2', + `other_field3` varchar(50) DEFAULT NULL COMMENT '自定义3', + `enable_serial_number` varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是', + `enable_batch_number` varchar(1) DEFAULT '0' COMMENT '是否开启批号,0否,1是', + `position` varchar(100) DEFAULT NULL COMMENT '仓位货架', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK675951272AB6672C` (`category_id`), + KEY `UnitId` (`unit_id`) +) ENGINE=InnoDB AUTO_INCREMENT=620 DEFAULT CHARSET=utf8 COMMENT='产品表'; + +-- ---------------------------- +-- Records of jsh_material +-- ---------------------------- +INSERT INTO `jsh_material` VALUES ('568', '17', '商品1', '制1', 'sp1', '', '', '个', '', null, null, null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('569', '17', '商品2', '', 'sp2', '', '', '只', '', null, null, null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('570', '17', '商品3', '', 'sp3', '', '', '个', '', null, null, null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('577', null, '商品8', '', 'sp8', '', '', '', '', null, '15', null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('579', '21', '商品17', '', 'sp17', '', '', '', '', null, '15', null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('586', '17', '序列号商品测试', '', 'xlh123', '', '', '个', '', null, null, null, null, '', '', '', '', '1', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('587', '17', '商品test1', '南通中远', '', 'test1', '', '个', '', null, null, null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('588', '21', '商品200', 'fafda', 'weqwe', '300ml', '红色', '个', 'aaaabbbbb', null, null, null, null, '', '', '', '', '0', '0', null, '63', '0'); +INSERT INTO `jsh_material` VALUES ('619', null, '衣服', null, null, null, null, '件', null, '', null, null, null, '', null, null, null, '0', '0', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_material_attribute +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_attribute`; +CREATE TABLE `jsh_material_attribute` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `attribute_name` varchar(50) DEFAULT NULL COMMENT '属性名', + `attribute_value` varchar(500) DEFAULT NULL COMMENT '属性值', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='产品属性表'; + +-- ---------------------------- +-- Records of jsh_material_attribute +-- ---------------------------- +INSERT INTO `jsh_material_attribute` VALUES ('1', '多颜色', '红色|橙色|黄色|绿色|蓝色|紫色', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('2', '多尺寸', 'S|M|L|XL|XXL|XXXL', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('3', '自定义1', '小米|华为', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('4', '自定义2', null, '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('5', '自定义3', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_material_category +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_category`; +CREATE TABLE `jsh_material_category` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(50) DEFAULT NULL COMMENT '名称', + `category_level` smallint(6) DEFAULT NULL COMMENT '等级', + `parent_id` bigint(20) DEFAULT NULL COMMENT '上级id', + `sort` varchar(10) DEFAULT NULL COMMENT '显示顺序', + `serial_no` varchar(100) DEFAULT NULL COMMENT '编号', + `remark` varchar(1024) DEFAULT NULL COMMENT '备注', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`), + KEY `FK3EE7F725237A77D8` (`parent_id`) +) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='产品类型表'; + +-- ---------------------------- +-- Records of jsh_material_category +-- ---------------------------- +INSERT INTO `jsh_material_category` VALUES ('17', '目录1', null, null, '11', 'wae12', 'eee', '2019-04-10 22:18:12', '2021-02-17 15:11:35', '63', '0'); +INSERT INTO `jsh_material_category` VALUES ('21', '目录2', null, '17', '22', 'ada112', 'ddd', '2020-07-20 23:08:44', '2020-07-20 23:08:44', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_material_current_stock +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_current_stock`; +CREATE TABLE `jsh_material_current_stock` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `material_id` bigint(20) DEFAULT NULL COMMENT '产品id', + `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id', + `current_number` decimal(24,6) DEFAULT NULL COMMENT '当前库存数量', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品当前库存'; + +-- ---------------------------- +-- Records of jsh_material_current_stock +-- ---------------------------- +INSERT INTO `jsh_material_current_stock` VALUES ('19', '588', '14', '7.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('20', '568', '14', '2.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('21', '568', '15', '1.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('22', '570', '14', '8.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('23', '619', '14', '5.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('24', '619', '15', '0.000000', '63', '0'); +INSERT INTO `jsh_material_current_stock` VALUES ('25', '619', '17', '0.000000', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_material_extend +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_extend`; +CREATE TABLE `jsh_material_extend` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `material_id` bigint(20) DEFAULT NULL COMMENT '商品id', + `bar_code` varchar(50) DEFAULT NULL COMMENT '商品条码', + `commodity_unit` varchar(50) DEFAULT NULL COMMENT '商品单位', + `sku` varchar(50) DEFAULT NULL COMMENT '多属性', + `purchase_decimal` decimal(24,6) DEFAULT NULL COMMENT '采购价格', + `commodity_decimal` decimal(24,6) DEFAULT NULL COMMENT '零售价格', + `wholesale_decimal` decimal(24,6) DEFAULT NULL COMMENT '销售价格', + `low_decimal` decimal(24,6) DEFAULT NULL COMMENT '最低售价', + `default_flag` varchar(1) DEFAULT '1' COMMENT '是否为默认单位,1是,0否', + `create_time` datetime DEFAULT NULL COMMENT '创建日期', + `create_serial` varchar(50) DEFAULT NULL COMMENT '创建人编码', + `update_serial` varchar(50) DEFAULT NULL COMMENT '更新人编码', + `update_time` bigint(20) DEFAULT NULL COMMENT '更新时间戳', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品价格扩展'; + +-- ---------------------------- +-- Records of jsh_material_extend +-- ---------------------------- +INSERT INTO `jsh_material_extend` VALUES ('1', '587', '1000', '个', null, '11.000000', '22.000000', '22.000000', '22.000000', '1', '2020-02-20 23:22:03', 'jsh', 'jsh', '1595263657135', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('2', '568', '1001', '个', null, '11.000000', '15.000000', '15.000000', '15.000000', '1', '2020-02-20 23:44:57', 'jsh', 'jsh', '1595265439418', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('3', '569', '1002', '只', null, '10.000000', '15.000000', '15.000000', '13.000000', '1', '2020-02-20 23:45:15', 'jsh', 'jsh', '1582213514731', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('4', '570', '1003', '个', null, '8.000000', '15.000000', '14.000000', '13.000000', '1', '2020-02-20 23:45:37', 'jsh', 'jsh', '1587657604430', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('5', '577', '1004', '个', null, '10.000000', '20.000000', '20.000000', '20.000000', '1', '2020-02-20 23:46:36', 'jsh', 'jsh', '1582213596494', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('6', '577', '1005', '箱', null, '120.000000', '240.000000', '240.000000', '240.000000', '0', '2020-02-20 23:46:36', 'jsh', 'jsh', '1582213596497', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('7', '579', '1006', '个', null, '20.000000', '30.000000', '30.000000', '30.000000', '1', '2020-02-20 23:47:04', 'jsh', 'jsh', '1595264270458', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('8', '579', '1007', '箱', null, '240.000000', '360.000000', '360.000000', '360.000000', '0', '2020-02-20 23:47:04', 'jsh', 'jsh', '1595264270466', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('9', '586', '1008', '个', null, '12.000000', '15.000000', '15.000000', '15.000000', '1', '2020-02-20 23:47:23', 'jsh', 'jsh', '1595254981896', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('10', '588', '1009', '个', null, '11.000000', '22.000000', '22.000000', '22.000000', '1', '2020-07-21 00:58:15', 'jsh', 'jsh', '1614699799073', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('36', '619', '1014', '件', '橙色,M', '12.000000', '15.000000', '14.000000', null, '1', '2021-07-28 01:00:20', 'jsh', 'jsh', '1627405220316', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('37', '619', '1015', '件', '橙色,L', '12.000000', '15.000000', '14.000000', null, '0', '2021-07-28 01:00:20', 'jsh', 'jsh', '1627405220327', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('38', '619', '1016', '件', '绿色,M', '12.000000', '15.000000', '14.000000', null, '0', '2021-07-28 01:00:20', 'jsh', 'jsh', '1627405220336', '63', '0'); +INSERT INTO `jsh_material_extend` VALUES ('39', '619', '1017', '件', '绿色,L', '12.000000', '15.000000', '14.000000', null, '0', '2021-07-28 01:00:20', 'jsh', 'jsh', '1627405220346', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_material_initial_stock +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_initial_stock`; +CREATE TABLE `jsh_material_initial_stock` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `material_id` bigint(20) DEFAULT NULL COMMENT '产品id', + `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id', + `number` decimal(24,6) DEFAULT NULL COMMENT '初始库存数量', + `low_safe_stock` decimal(24,6) DEFAULT NULL COMMENT '最低库存数量', + `high_safe_stock` decimal(24,6) DEFAULT NULL COMMENT '最高库存数量', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=205 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品初始库存'; + +-- ---------------------------- +-- Records of jsh_material_initial_stock +-- ---------------------------- + +-- ---------------------------- +-- Table structure for jsh_material_property +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_material_property`; +CREATE TABLE `jsh_material_property` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `native_name` varchar(50) DEFAULT NULL COMMENT '原始名称', + `enabled` bit(1) DEFAULT NULL COMMENT '是否启用', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `another_name` varchar(50) DEFAULT NULL COMMENT '别名', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='产品扩展字段表'; + +-- ---------------------------- +-- Records of jsh_material_property +-- ---------------------------- +INSERT INTO `jsh_material_property` VALUES ('1', '制造商', '', '01', '制造商', '0'); +INSERT INTO `jsh_material_property` VALUES ('2', '自定义1', '', '02', '自定义1', '0'); +INSERT INTO `jsh_material_property` VALUES ('3', '自定义2', '', '03', '自定义2', '0'); +INSERT INTO `jsh_material_property` VALUES ('4', '自定义3', '', '04', '自定义3', '0'); + +-- ---------------------------- +-- Table structure for jsh_msg +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_msg`; +CREATE TABLE `jsh_msg` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `msg_title` varchar(100) DEFAULT NULL COMMENT '消息标题', + `msg_content` varchar(500) DEFAULT NULL COMMENT '消息内容', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `type` varchar(20) DEFAULT NULL COMMENT '消息类型', + `user_id` bigint(20) DEFAULT NULL COMMENT '接收人id', + `status` varchar(1) DEFAULT NULL COMMENT '状态,1未读 2已读', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_Flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='消息表'; + +-- ---------------------------- +-- Records of jsh_msg +-- ---------------------------- +INSERT INTO `jsh_msg` VALUES ('2', '标题1', '内容1', '2019-09-10 00:11:39', '类型1', '63', '2', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_organization +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_organization`; +CREATE TABLE `jsh_organization` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `org_no` varchar(20) DEFAULT NULL COMMENT '机构编号', + `org_abr` varchar(20) DEFAULT NULL COMMENT '机构简称', + `parent_id` bigint(20) DEFAULT NULL COMMENT '父机构id', + `sort` varchar(20) DEFAULT NULL COMMENT '机构显示顺序', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='机构表'; + +-- ---------------------------- +-- Records of jsh_organization +-- ---------------------------- +INSERT INTO `jsh_organization` VALUES ('12', '001', '测试机构', null, '2', 'aaaa2', '2019-12-28 12:13:01', '2019-12-28 12:13:01', '63', '0'); +INSERT INTO `jsh_organization` VALUES ('13', 'jg1', '机构1', '12', '3', '', '2020-07-21 00:09:57', '2020-07-21 00:10:22', '63', '0'); +INSERT INTO `jsh_organization` VALUES ('14', '12', '机构2', '13', '4', '', '2020-07-21 22:45:42', '2021-02-15 22:18:30', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_orga_user_rel +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_orga_user_rel`; +CREATE TABLE `jsh_orga_user_rel` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `orga_id` bigint(20) NOT NULL COMMENT '机构id', + `user_id` bigint(20) NOT NULL COMMENT '用户id', + `user_blng_orga_dspl_seq` varchar(20) DEFAULT NULL COMMENT '用户在所属机构中显示顺序', + `delete_flag` char(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `creator` bigint(20) DEFAULT NULL COMMENT '创建人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `updater` bigint(20) DEFAULT NULL COMMENT '更新人', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='机构用户关系表'; + +-- ---------------------------- +-- Records of jsh_orga_user_rel +-- ---------------------------- +INSERT INTO `jsh_orga_user_rel` VALUES ('10', '13', '131', '2', '0', '2019-12-28 12:13:15', '63', '2021-03-18 22:33:19', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('11', '12', '63', '15', '0', '2020-09-13 18:42:45', '63', '2021-03-19 00:11:40', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('12', '13', '135', '9', '0', '2021-03-18 22:24:25', '63', '2021-03-19 00:09:23', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('13', '13', '134', '1', '0', '2021-03-18 22:31:39', '63', '2021-03-18 23:59:55', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('14', '22', '133', '22', '0', '2021-03-18 22:31:44', '63', '2021-03-18 22:32:04', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('15', '12', '144', null, '0', '2021-03-19 00:00:40', '63', '2021-03-19 00:08:07', '63', '63'); +INSERT INTO `jsh_orga_user_rel` VALUES ('16', '12', '145', null, '0', '2021-03-19 00:03:44', '63', '2021-03-19 00:03:44', '63', '63'); + +-- ---------------------------- +-- Table structure for jsh_person +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_person`; +CREATE TABLE `jsh_person` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` varchar(20) DEFAULT NULL COMMENT '类型', + `name` varchar(50) DEFAULT NULL COMMENT '姓名', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='经手人表'; + +-- ---------------------------- +-- Records of jsh_person +-- ---------------------------- +INSERT INTO `jsh_person` VALUES ('14', '业务员', '小李', '', null, '63', '0'); +INSERT INTO `jsh_person` VALUES ('15', '仓管员', '小军', '', null, '63', '0'); +INSERT INTO `jsh_person` VALUES ('16', '财务员', '小夏', '', null, '63', '0'); +INSERT INTO `jsh_person` VALUES ('17', '财务员', '小曹', '', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_platform_config +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_platform_config`; +CREATE TABLE `jsh_platform_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `platform_key` varchar(100) DEFAULT NULL COMMENT '关键词', + `platform_key_info` varchar(100) DEFAULT NULL COMMENT '关键词名称', + `platform_value` varchar(200) DEFAULT NULL COMMENT '值', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='平台参数'; + +-- ---------------------------- +-- Records of jsh_platform_config +-- ---------------------------- +INSERT INTO `jsh_platform_config` VALUES ('1', 'platform_name', '平台名称', '华夏ERP'); +INSERT INTO `jsh_platform_config` VALUES ('2', 'activation_code', '激活码', ''); +INSERT INTO `jsh_platform_config` VALUES ('3', 'platform_url', '官方网站', 'http://www.huaxiaerp.com/'); +INSERT INTO `jsh_platform_config` VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0'); +INSERT INTO `jsh_platform_config` VALUES ('5', 'bill_print_url', '三联打印地址', ''); +INSERT INTO `jsh_platform_config` VALUES ('6', 'pay_fee_url', '租户续费地址', ''); +INSERT INTO `jsh_platform_config` VALUES ('7', 'register_flag', '注册启用标记', '1'); +INSERT INTO `jsh_platform_config` VALUES ('8', 'app_activation_code', '手机端激活码', ''); +INSERT INTO `jsh_platform_config` VALUES ('9', 'send_workflow_url', '发起流程地址', ''); +INSERT INTO `jsh_platform_config` VALUES ('10', 'weixinUrl', '微信url', ''); +INSERT INTO `jsh_platform_config` VALUES ('11', 'weixinAppid', '微信appid', ''); +INSERT INTO `jsh_platform_config` VALUES ('12', 'weixinSecret', '微信secret', ''); +INSERT INTO `jsh_platform_config` VALUES ('13', 'aliOss_endpoint', '阿里OSS-endpoint', ''); +INSERT INTO `jsh_platform_config` VALUES ('14', 'aliOss_accessKeyId', '阿里OSS-accessKeyId', ''); +INSERT INTO `jsh_platform_config` VALUES ('15', 'aliOss_accessKeySecret', '阿里OSS-accessKeySecret', ''); +INSERT INTO `jsh_platform_config` VALUES ('16', 'aliOss_bucketName', '阿里OSS-bucketName', ''); +INSERT INTO `jsh_platform_config` VALUES ('17', 'aliOss_linkUrl', '阿里OSS-linkUrl', ''); +INSERT INTO `jsh_platform_config` VALUES ('18', 'bill_excel_url', '单据Excel地址', ''); + +-- ---------------------------- +-- Table structure for jsh_role +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_role`; +CREATE TABLE `jsh_role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(50) DEFAULT NULL COMMENT '名称', + `type` varchar(50) DEFAULT NULL COMMENT '类型', + `price_limit` varchar(50) DEFAULT NULL COMMENT '价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价', + `value` varchar(200) DEFAULT NULL COMMENT '值', + `description` varchar(100) DEFAULT NULL COMMENT '描述', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='角色表'; + +-- ---------------------------- +-- Records of jsh_role +-- ---------------------------- +INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, null, '', null, null, '0'); +INSERT INTO `jsh_role` VALUES ('10', '租户', '全部数据', null, null, '', '', null, null, '0'); +INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, null, 'ddd', '', null, '63', '0'); +INSERT INTO `jsh_role` VALUES ('17', '销售代表', '个人数据', null, null, 'rrr', '', null, '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_sequence +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_sequence`; +CREATE TABLE `jsh_sequence` ( + `seq_name` varchar(50) NOT NULL COMMENT '序列名称', + `min_value` bigint(20) NOT NULL COMMENT '最小值', + `max_value` bigint(20) NOT NULL COMMENT '最大值', + `current_val` bigint(20) NOT NULL COMMENT '当前值', + `increment_val` int(11) NOT NULL DEFAULT '1' COMMENT '增长步数', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`seq_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='单据编号表'; + +-- ---------------------------- +-- Records of jsh_sequence +-- ---------------------------- +INSERT INTO `jsh_sequence` VALUES ('depot_number_seq', '1', '999999999999999999', '660', '1', '单据编号sequence'); + +-- ---------------------------- +-- Table structure for jsh_serial_number +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_serial_number`; +CREATE TABLE `jsh_serial_number` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `material_id` bigint(20) DEFAULT NULL COMMENT '产品表id', + `depot_id` bigint(20) DEFAULT NULL COMMENT '仓库id', + `serial_number` varchar(64) DEFAULT NULL COMMENT '序列号', + `is_sell` varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出', + `remark` varchar(1024) DEFAULT NULL COMMENT '备注', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `creator` bigint(20) DEFAULT NULL COMMENT '创建人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `updater` bigint(20) DEFAULT NULL COMMENT '更新人', + `in_bill_no` varchar(50) DEFAULT NULL COMMENT '入库单号', + `out_bill_no` varchar(50) DEFAULT NULL COMMENT '出库单号', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COMMENT='序列号表'; + +-- ---------------------------- +-- Records of jsh_serial_number +-- ---------------------------- +INSERT INTO `jsh_serial_number` VALUES ('105', '586', '14', '12312323423223', '0', 'abab', '0', '2019-12-28 12:14:39', '63', '2020-07-21 00:30:32', '63', null, null, '63'); +INSERT INTO `jsh_serial_number` VALUES ('108', '586', '14', '3215952626621201', '0', '', '0', '2020-07-21 00:31:02', '63', '2020-07-21 00:31:02', '63', null, null, '63'); +INSERT INTO `jsh_serial_number` VALUES ('109', '586', '14', '3215952626621202', '0', '', '0', '2020-07-21 00:31:02', '63', '2020-07-21 00:31:02', '63', null, null, '63'); + +-- ---------------------------- +-- Table structure for jsh_supplier +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_supplier`; +CREATE TABLE `jsh_supplier` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `supplier` varchar(255) NOT NULL COMMENT '供应商名称', + `contacts` varchar(100) DEFAULT NULL COMMENT '联系人', + `phone_num` varchar(30) DEFAULT NULL COMMENT '联系电话', + `email` varchar(50) DEFAULT NULL COMMENT '电子邮箱', + `description` varchar(500) DEFAULT NULL COMMENT '备注', + `isystem` tinyint(4) DEFAULT NULL COMMENT '是否系统自带 0==系统 1==非系统', + `type` varchar(20) DEFAULT NULL COMMENT '类型', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `advance_in` decimal(24,6) DEFAULT '0.000000' COMMENT '预收款', + `begin_need_get` decimal(24,6) DEFAULT NULL COMMENT '期初应收', + `begin_need_pay` decimal(24,6) DEFAULT NULL COMMENT '期初应付', + `all_need_get` decimal(24,6) DEFAULT NULL COMMENT '累计应收', + `all_need_pay` decimal(24,6) DEFAULT NULL COMMENT '累计应付', + `fax` varchar(30) DEFAULT NULL COMMENT '传真', + `telephone` varchar(30) DEFAULT NULL COMMENT '手机', + `address` varchar(50) DEFAULT NULL COMMENT '地址', + `tax_num` varchar(50) DEFAULT NULL COMMENT '纳税人识别号', + `bank_name` varchar(50) DEFAULT NULL COMMENT '开户行', + `account_number` varchar(50) DEFAULT NULL COMMENT '账号', + `tax_rate` decimal(24,6) DEFAULT NULL COMMENT '税率', + `sort` varchar(10) DEFAULT NULL COMMENT '排序', + `creator` bigint(20) DEFAULT NULL COMMENT '操作员', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8 COMMENT='供应商/客户信息表'; + +-- ---------------------------- +-- Records of jsh_supplier +-- ---------------------------- +INSERT INTO `jsh_supplier` VALUES ('57', '供应商1', '小军', '12345678', '', '', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '4.000000', '', '15000000000', '地址1', '', '', '', '12.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('58', '客户1', '小李', '12345678', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '-100.000000', null, '', '', '', '', '', '', '12.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('59', '客户2', '小陈', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('60', '12312666', '小曹', '', '', '', null, '会员', '', '970.000000', '0.000000', '0.000000', null, null, '', '13000000000', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('68', '供应商3', '晓丽', '12345678', '', 'fasdfadf', null, '供应商', '', '0.000000', '0.000000', '0.000000', '0.000000', '-35.000000', '', '13000000000', 'aaaa', '1341324', '', '', '13.000000', null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('71', '客户3', '小周', '', '', '', null, '客户', '', '0.000000', '0.000000', '0.000000', '0.000000', null, '', '', '', '', '', '', null, null, '63', '63', '0'); +INSERT INTO `jsh_supplier` VALUES ('74', '供应商5', '小季', '77779999', '', '', null, '供应商', '', '0.000000', '0.000000', '5.000000', '0.000000', '5.000000', '', '15806283912', '', '', '', '', '3.000000', null, '63', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_system_config +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_system_config`; +CREATE TABLE `jsh_system_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `company_name` varchar(50) DEFAULT NULL COMMENT '公司名称', + `company_contacts` varchar(20) DEFAULT NULL COMMENT '公司联系人', + `company_address` varchar(50) DEFAULT NULL COMMENT '公司地址', + `company_tel` varchar(20) DEFAULT NULL COMMENT '公司电话', + `company_fax` varchar(20) DEFAULT NULL COMMENT '公司传真', + `company_post_code` varchar(20) DEFAULT NULL COMMENT '公司邮编', + `sale_agreement` varchar(500) DEFAULT NULL COMMENT '销售协议', + `depot_flag` varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用', + `customer_flag` varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用', + `minus_stock_flag` varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用', + `purchase_by_sale_flag` varchar(1) DEFAULT '0' COMMENT '以销定购启用标记,0未启用,1启用', + `multi_level_approval_flag` varchar(1) DEFAULT '0' COMMENT '多级审核启用标记,0未启用,1启用', + `multi_bill_type` varchar(200) DEFAULT NULL COMMENT '流程类型,可多选', + `force_approval_flag` varchar(1) DEFAULT '0' COMMENT '强审核启用标记,0未启用,1启用', + `update_unit_price_flag` varchar(1) DEFAULT '1' COMMENT '更新单价启用标记,0未启用,1启用', + `over_link_bill_flag` varchar(1) DEFAULT '0' COMMENT '超出关联单据启用标记,0未启用,1启用', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='系统参数'; + +-- ---------------------------- +-- Records of jsh_system_config +-- ---------------------------- +INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '1', '0', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_tenant +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_tenant`; +CREATE TABLE `jsh_tenant` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `login_name` varchar(255) DEFAULT NULL COMMENT '登录名', + `user_num_limit` int(11) DEFAULT NULL COMMENT '用户数量限制', + `type` varchar(1) DEFAULT '0' COMMENT '租户类型,0免费租户,1付费租户', + `enabled` bit(1) DEFAULT b'1' COMMENT '启用 0-禁用 1-启用', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `expire_time` datetime DEFAULT NULL COMMENT '到期时间', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='租户'; + +-- ---------------------------- +-- Records of jsh_tenant +-- ---------------------------- +INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '2000', '1', '', '2021-02-17 23:19:17', '2099-02-17 23:19:17', null); + +-- ---------------------------- +-- Table structure for jsh_unit +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_unit`; +CREATE TABLE `jsh_unit` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `name` varchar(50) DEFAULT NULL COMMENT '名称,支持多单位', + `basic_unit` varchar(50) DEFAULT NULL COMMENT '基础单位', + `other_unit` varchar(50) DEFAULT NULL COMMENT '副单位', + `other_unit_two` varchar(50) DEFAULT NULL COMMENT '副单位2', + `other_unit_three` varchar(50) DEFAULT NULL COMMENT '副单位3', + `ratio` decimal(24,3) DEFAULT NULL COMMENT '比例', + `ratio_two` decimal(24,3) DEFAULT NULL COMMENT '比例2', + `ratio_three` decimal(24,3) DEFAULT NULL COMMENT '比例3', + `enabled` bit(1) DEFAULT NULL COMMENT '启用', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='多单位表'; + +-- ---------------------------- +-- Records of jsh_unit +-- ---------------------------- +INSERT INTO `jsh_unit` VALUES ('15', '个/(箱=12个)', '个', '箱', null, null, '12.000', null, null, '', '63', '0'); +INSERT INTO `jsh_unit` VALUES ('19', '个/(盒=15个)', '个', '盒', null, null, '15.000', null, null, '', '63', '0'); +INSERT INTO `jsh_unit` VALUES ('20', '盒/(箱=8盒)', '盒', '箱', null, null, '8.000', null, null, '', '63', '0'); +INSERT INTO `jsh_unit` VALUES ('21', '瓶/(箱=12瓶)', '瓶', '箱', null, null, '12.000', null, null, '', '63', '0'); + +-- ---------------------------- +-- Table structure for jsh_user +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_user`; +CREATE TABLE `jsh_user` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `username` varchar(255) NOT NULL COMMENT '用户姓名--例如张三', + `login_name` varchar(255) NOT NULL COMMENT '登录用户名', + `password` varchar(50) DEFAULT NULL COMMENT '登陆密码', + `leader_flag` varchar(1) DEFAULT '0' COMMENT '是否经理,0否,1是', + `position` varchar(200) DEFAULT NULL COMMENT '职位', + `department` varchar(255) DEFAULT NULL COMMENT '所属部门', + `email` varchar(100) DEFAULT NULL COMMENT '电子邮箱', + `phonenum` varchar(100) DEFAULT NULL COMMENT '手机号码', + `ismanager` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否为管理者 0==管理者 1==员工', + `isystem` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否系统自带数据 ', + `Status` tinyint(4) DEFAULT '0' COMMENT '状态,0:正常,1:删除,2封禁', + `description` varchar(500) DEFAULT NULL COMMENT '用户描述信息', + `remark` varchar(500) DEFAULT NULL COMMENT '备注', + `weixin_open_id` varchar(100) DEFAULT NULL COMMENT '微信绑定', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=146 DEFAULT CHARSET=utf8 COMMENT='用户表'; + +-- ---------------------------- +-- Records of jsh_user +-- ---------------------------- +INSERT INTO `jsh_user` VALUES ('63', '测试用户', 'jsh', 'e10adc3949ba59abbe56e057f20f883e', '0', '主管', null, '666666@qq.com', '1123123123132', '1', '1', '0', '', null, null, '63'); +INSERT INTO `jsh_user` VALUES ('120', '管理员', 'admin', 'e10adc3949ba59abbe56e057f20f883e', '0', null, null, null, null, '1', '0', '0', null, null, null, '0'); +INSERT INTO `jsh_user` VALUES ('131', 'test123', 'test123', 'e10adc3949ba59abbe56e057f20f883e', '0', '总监', null, '7777777@qq.com', '', '1', '0', '0', '', null, null, '63'); + +-- ---------------------------- +-- Table structure for jsh_user_business +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_user_business`; +CREATE TABLE `jsh_user_business` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `type` varchar(50) DEFAULT NULL COMMENT '类别', + `key_id` varchar(50) DEFAULT NULL COMMENT '主id', + `value` varchar(10000) DEFAULT NULL COMMENT '值', + `btn_str` varchar(2000) DEFAULT NULL COMMENT '按钮权限', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8 COMMENT='用户/角色/模块关系表'; + +-- ---------------------------- +-- Records of jsh_user_business +-- ---------------------------- +INSERT INTO `jsh_user_business` VALUES ('5', 'RoleFunctions', '4', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][1][14][243][15][234][16][18][236][245][248][198][258][259]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":16,\"btnStr\":\"1\"},{\"funId\":18,\"btnStr\":\"1\"},{\"funId\":236,\"btnStr\":\"1\"},{\"funId\":245,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,2,7\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,7,2\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,7,2\"},{\"funId\":206,\"btnStr\":\"1,2,7\"},{\"funId\":212,\"btnStr\":\"1,7,2\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', null, '0'); +INSERT INTO `jsh_user_business` VALUES ('6', 'RoleFunctions', '5', '[22][23][25][26][194][195][31][33][200][201][41][199][202]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('7', 'RoleFunctions', '6', '[22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"33\",\"btnStr\":\"4\"}]', null, '0'); +INSERT INTO `jsh_user_business` VALUES ('9', 'RoleFunctions', '7', '[168][13][12][16][14][15][189][18][19][132]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('10', 'RoleFunctions', '8', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][247]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('11', 'RoleFunctions', '9', '[168][13][12][16][14][15][189][18][19][132][22][23][25][26][27][157][158][155][156][125][31][127][126][128][33][34][35][36][37][39][40][41][42][43][46][47][48][49][50][51][52][53][54][55][56][57][192][59][60][61][62][63][65][66][68][69][70][71][73][74][76][77][79][191][81][82][83][85][89][161][86][176][165][160][28][134][91][92][29][94][95][97][104][99][100][101][102][105][107][108][110][111][113][114][116][117][118][120][121][131][135][123][122][20][130][146][147][138][148][149][153][140][145][184][152][143][170][171][169][166][167][163][164][172][173][179][178][181][182][183][186][187][188]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('12', 'UserRole', '1', '[5]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('13', 'UserRole', '2', '[6][7]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('14', 'UserDepot', '2', '[1][2][6][7]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('15', 'UserDepot', '1', '[1][2][5][6][7][10][12][14][15][17]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('16', 'UserRole', '63', '[10]', null, '63', '0'); +INSERT INTO `jsh_user_business` VALUES ('18', 'UserDepot', '63', '[14][15]', null, '63', '0'); +INSERT INTO `jsh_user_business` VALUES ('19', 'UserDepot', '5', '[6][45][46][50]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('20', 'UserRole', '5', '[5]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('21', 'UserRole', '64', '[13]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('22', 'UserDepot', '64', '[1]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('23', 'UserRole', '65', '[5]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('24', 'UserDepot', '65', '[1]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('25', 'UserCustomer', '64', '[5][2]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('26', 'UserCustomer', '65', '[6]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('27', 'UserCustomer', '63', '[58]', null, '63', '0'); +INSERT INTO `jsh_user_business` VALUES ('28', 'UserDepot', '96', '[7]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('29', 'UserRole', '96', '[6]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('30', 'UserRole', '113', '[10]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('32', 'RoleFunctions', '10', '[210][225][211][241][32][33][199][242][38][41][200][201][239][202][40][232][233][197][44][203][204][205][206][212][246][207][208][209][226][227][228][229][59][235][237][244][22][21][23][220][240][247][25][24][217][218][26][194][195][31][13][14][243][15][234][248][198][259]', '[{\"funId\":13,\"btnStr\":\"1\"},{\"funId\":14,\"btnStr\":\"1\"},{\"funId\":243,\"btnStr\":\"1\"},{\"funId\":234,\"btnStr\":\"1\"},{\"funId\":22,\"btnStr\":\"1\"},{\"funId\":23,\"btnStr\":\"1\"},{\"funId\":220,\"btnStr\":\"1\"},{\"funId\":240,\"btnStr\":\"1\"},{\"funId\":247,\"btnStr\":\"1\"},{\"funId\":25,\"btnStr\":\"1\"},{\"funId\":217,\"btnStr\":\"1\"},{\"funId\":218,\"btnStr\":\"1\"},{\"funId\":26,\"btnStr\":\"1\"},{\"funId\":194,\"btnStr\":\"1\"},{\"funId\":195,\"btnStr\":\"1\"},{\"funId\":31,\"btnStr\":\"1\"},{\"funId\":241,\"btnStr\":\"1,2,7\"},{\"funId\":33,\"btnStr\":\"1,2,7\"},{\"funId\":199,\"btnStr\":\"1,7,2\"},{\"funId\":242,\"btnStr\":\"1,2,7\"},{\"funId\":41,\"btnStr\":\"1,2,7\"},{\"funId\":200,\"btnStr\":\"1,2,7\"},{\"funId\":210,\"btnStr\":\"1,2,7\"},{\"funId\":211,\"btnStr\":\"1,2,7\"},{\"funId\":197,\"btnStr\":\"1,2,7\"},{\"funId\":203,\"btnStr\":\"1,7,2\"},{\"funId\":204,\"btnStr\":\"1,7,2\"},{\"funId\":205,\"btnStr\":\"1,2,7\"},{\"funId\":206,\"btnStr\":\"1,7,2\"},{\"funId\":212,\"btnStr\":\"1,2,7\"},{\"funId\":201,\"btnStr\":\"1,2,7\"},{\"funId\":202,\"btnStr\":\"1,2,7\"},{\"funId\":40,\"btnStr\":\"1,2,7\"},{\"funId\":232,\"btnStr\":\"1,2,7\"},{\"funId\":233,\"btnStr\":\"1,2,7\"}]', null, '0'); +INSERT INTO `jsh_user_business` VALUES ('34', 'UserRole', '115', '[10]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('35', 'UserRole', '117', '[10]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('36', 'UserDepot', '117', '[8][9]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('37', 'UserCustomer', '117', '[52]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('38', 'UserRole', '120', '[4]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('41', 'RoleFunctions', '12', '', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('48', 'RoleFunctions', '13', '[59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('51', 'UserRole', '74', '[10]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('52', 'UserDepot', '121', '[13]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('54', 'UserDepot', '115', '[13]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('56', 'UserCustomer', '115', '[56]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('57', 'UserCustomer', '121', '[56]', null, null, '0'); +INSERT INTO `jsh_user_business` VALUES ('67', 'UserRole', '131', '[17]', null, '63', '0'); +INSERT INTO `jsh_user_business` VALUES ('68', 'RoleFunctions', '16', '[210]', null, '63', '0'); +INSERT INTO `jsh_user_business` VALUES ('69', 'RoleFunctions', '17', '[210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]', '[{\"funId\":\"241\",\"btnStr\":\"1,2\"},{\"funId\":\"33\",\"btnStr\":\"1,2\"},{\"funId\":\"199\",\"btnStr\":\"1,2\"},{\"funId\":\"242\",\"btnStr\":\"1,2\"},{\"funId\":\"41\",\"btnStr\":\"1,2\"},{\"funId\":\"200\",\"btnStr\":\"1,2\"},{\"funId\":\"210\",\"btnStr\":\"1,2\"},{\"funId\":\"211\",\"btnStr\":\"1,2\"},{\"funId\":\"197\",\"btnStr\":\"1\"},{\"funId\":\"203\",\"btnStr\":\"1\"},{\"funId\":\"204\",\"btnStr\":\"1\"},{\"funId\":\"205\",\"btnStr\":\"1\"},{\"funId\":\"206\",\"btnStr\":\"1\"},{\"funId\":\"212\",\"btnStr\":\"1\"},{\"funId\":\"201\",\"btnStr\":\"1,2\"},{\"funId\":\"202\",\"btnStr\":\"1,2\"},{\"funId\":\"40\",\"btnStr\":\"1,2\"},{\"funId\":\"232\",\"btnStr\":\"1,2\"},{\"funId\":\"233\",\"btnStr\":\"1,2\"}]', '63', '0'); diff --git "a/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" "b/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" new file mode 100644 index 00000000..d6d815c0 --- /dev/null +++ "b/docs/\346\225\260\346\215\256\345\272\223\346\233\264\346\226\260\350\256\260\345\275\225-\351\246\226\346\254\241\345\256\211\350\243\205\350\257\267\345\213\277\344\275\277\347\224\250.txt" @@ -0,0 +1,1527 @@ +--------------------------------------------------------------------------------------------------- +****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库**** +****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库**** +****注意第一次初始化数据库不需要执行下面的内容,该文档会随着代码更新持续更新,方便大家手动升级数据库**** +--------------------------------------------------------------------------------------------------- + + +-- ---------------------------- +-- 时间:2019年1月21日 +-- version:1.0.0 +-- 此次更新添加序列号功能 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- + +-- ---------------------------- +-- 添加序列号表 +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_serial_number`; +CREATE TABLE `jsh_serial_number` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `material_Id` bigint(20) DEFAULT NULL COMMENT '产品表id', + `serial_Number` varchar(64) DEFAULT NULL COMMENT '序列号', + `is_Sell` bit(1) DEFAULT 0 COMMENT '是否卖出,0未卖出,1卖出', + `remark` varchar(1024) DEFAULT NULL COMMENT '备注', + `delete_Flag` bit(1) DEFAULT 0 COMMENT '删除标记,0未删除,1删除', + `create_Time` datetime DEFAULT NULL COMMENT '创建时间', + `creator` bigint(20) DEFAULT NULL COMMENT '创建人', + `update_Time` datetime DEFAULT NULL COMMENT '更新时间', + `updater` bigint(20) DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`Id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='序列号表'; + +-- ---------------------------- +-- 产品表新增字段是否启用序列号 +-- ---------------------------- +alter table jsh_material add enableSerialNumber bit(1) DEFAULT 0 COMMENT '是否开启序列号,0否,1是'; +-- ---------------------------- +-- 时间:2019年1月24日 +-- version:1.0.1 +-- 此次更新添加序列号菜单 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 添加序列号菜单 +-- ---------------------------- +delete from `jsh_functions` where Name='序列号'; +INSERT INTO `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) VALUES ('010104', '序列号', '0101', '../manage/serialNumber.html', b'0', '0246', b'1', '电脑版', ''); +-- ---------------------------- +-- 删除单据主表供应商id字段对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_3; +-- ---------------------------- +-- 序列号表添加单据主表id字段,用于跟踪序列号流向 +-- ---------------------------- +alter table jsh_serial_number add depothead_Id bigint(20) DEFAULT null COMMENT '单据主表id,用于跟踪序列号流向'; +-- ---------------------------- +-- 修改商品表enableSerialNumber字段类型为varchar(1) +-- ---------------------------- +alter table jsh_material change enableSerialNumber enableSerialNumber varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是'; +-- ---------------------------- +-- 修改序列号表is_Sell字段类型为varchar(1) +-- 修改序列号表delete_Flag字段类型为varchar(1) +-- ---------------------------- +alter table jsh_serial_number change is_Sell is_Sell varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出'; +alter table jsh_serial_number change delete_Flag delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- ---------------------------- +-- 删除单据子表单据主表id字段对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_depot_item DROP FOREIGN KEY jsh_depot_item_ibfk_1; +-- ---------------------------- +-- 时间:2019年2月1日 +-- version:1.0.2 +-- 此次更新添加sequence表,用于获取一个唯一的数值 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 添加表tbl_sequence +-- ---------------------------- +DROP TABLE IF EXISTS `tbl_sequence`; +CREATE TABLE tbl_sequence ( + seq_name VARCHAR(50) NOT NULL COMMENT '序列名称', + min_value bigint(20) NOT NULL COMMENT '最小值', + max_value bigint(20) NOT NULL COMMENT '最大值', + current_val bigint(20) NOT NULL COMMENT '当前值', + increment_val INT DEFAULT '1' NOT NULL COMMENT '增长步数', + remark VARCHAR(500) DEFAULT null COMMENT '备注', + PRIMARY KEY (seq_name) + )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='sequence表'; + +-- ---------------------------- +-- 添加表单据编号sequence +-- 插入数据前判断,防止数据重复插入 +-- ---------------------------- +insert into tbl_sequence (seq_name, min_value, max_value, current_val, increment_val,remark) +select 'depot_number_seq', 1, 999999999999999999, 1, 1,'单据编号sequence' from dual where not exists +(select * from tbl_sequence where seq_name='depot_number_seq'); +-- ---------------------------- +-- 创建function _nextval() 用于获取当前序列号 +-- ---------------------------- +DROP FUNCTION IF EXISTS `_nextval`; +DELIMITER ;; +CREATE FUNCTION `_nextval`(name varchar(50)) RETURNS mediumtext CHARSET utf8 +begin +declare _cur bigint; +declare _maxvalue bigint; -- 接收最大值 +declare _increment int; -- 接收增长步数 +set _increment = (select increment_val from tbl_sequence where seq_name = name); +set _maxvalue = (select max_value from tbl_sequence where seq_name = name); +set _cur = (select current_val from tbl_sequence where seq_name = name for update); +update tbl_sequence -- 更新当前值 + set current_val = _cur + increment_val + where seq_name = name ; +if(_cur + _increment >= _maxvalue) then -- 判断是都达到最大值 + update tbl_sequence + set current_val = minvalue + where seq_name = name ; +end if; +return _cur; +end +;; +DELIMITER ; + +-- ---------------------------- +-- 时间:2019年2月18日 +-- version:1.0.3 +-- 此次更新修改产品类型表jsh_materialcategory,添加一些字段 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 产品类型表添加字段sort,显示顺序 +-- ---------------------------- +alter table jsh_materialcategory add sort varchar(10) DEFAULT null COMMENT '显示顺序'; +-- ---------------------------- +-- 产品类型表添加字段status,状态,0系统默认,1启用,2删除 +-- ---------------------------- +alter table jsh_materialcategory add status varchar(1) DEFAULT '0' COMMENT '状态,0系统默认,1启用,2删除'; +-- ---------------------------- +-- 产品类型表添加字段serial_no,编号 +-- ---------------------------- +alter table jsh_materialcategory add serial_no varchar(100) DEFAULT null COMMENT '编号'; +-- ---------------------------- +-- 产品类型表添加字段remark,备注 +-- ---------------------------- +alter table jsh_materialcategory add remark varchar(1024) DEFAULT null COMMENT '备注'; +-- ---------------------------- +-- 产品类型表添加字段create_time,创建时间 +-- ---------------------------- +alter table jsh_materialcategory add create_time datetime DEFAULT null COMMENT '创建时间'; +-- ---------------------------- +-- 产品类型表添加字段creator,创建人 +-- ---------------------------- +alter table jsh_materialcategory add creator bigint(20) DEFAULT null COMMENT '创建人'; +-- ---------------------------- +-- 产品类型表添加字段update_time,更新时间 +-- ---------------------------- +alter table jsh_materialcategory add update_time datetime DEFAULT null COMMENT '更新时间'; +-- ---------------------------- +-- 产品类型表添加字段updater,更新人 +-- ---------------------------- +alter table jsh_materialcategory add updater bigint(20) DEFAULT null COMMENT '更新人'; + +-- ---------------------------- +-- 去掉jsh_materialcategory外键 +-- ---------------------------- +ALTER TABLE jsh_materialcategory DROP FOREIGN KEY FK3EE7F725237A77D8; + +-- ---------------------------- +-- 修改根目录父节点id为-1 +-- 设置根目录编号为1 +-- ---------------------------- +update jsh_materialcategory set ParentId='-1' where id='1'; + +-- ---------------------------- +-- 删除礼品卡管理、礼品充值、礼品销售、礼品卡统计的功能数据 +-- ---------------------------- +delete from jsh_functions where id in (213,214,215,216); + +-- ---------------------------- +-- 新增采购订单、销售订单的功能数据 +-- 主键自增长,直接指定主键插入数据的方式可能会和本地数据冲突 +-- 插入数据前判断,防止数据重复插入 +-- ---------------------------- +insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) +select '050202', '采购订单', '0502', '../materials/purchase_orders_list.html', b'0', '0335',b'1', '电脑版', '' from dual where not exists +(select * from jsh_functions where Number='050202' and PNumber='0502'); +insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) +select '060301', '销售订单', '0603', '../materials/sale_orders_list.html', b'0', '0392', b'1', '电脑版', '' from dual where not exists +(select * from jsh_functions where Number='060301' and PNumber='0603'); + +-- ---------------------------- +-- 改管理员的功能权限 +-- ---------------------------- +update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4', +Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]' +where Id = 5; + +-- ---------------------------- +-- 时间:2019年2月25日 +-- version:1.0.4 +-- 此次更新仓库添加负责人信息,负责人信息从用户表获取 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 仓库表添加字段principal,负责人 +-- ---------------------------- +alter table jsh_depot add principal bigint(20) DEFAULT null COMMENT '负责人'; + +-- ---------------------------- +-- 时间:2019年3月6日 +-- version:1.0.5 +-- 此次更新 +-- 1、添加机构表 +-- 2、添加机构用户关系表 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 添加机构表 +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_organization`; +CREATE TABLE `jsh_organization` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `org_no` varchar(20) DEFAULT NULL COMMENT '机构编号', + `org_full_name` varchar(500) DEFAULT NULL COMMENT '机构全称', + `org_abr` varchar(20) DEFAULT NULL COMMENT '机构简称', + `org_tpcd` varchar(9) DEFAULT NULL COMMENT '机构类型', + `org_stcd` char(1) DEFAULT NULL COMMENT '机构状态,1未营业、2正常营业、3暂停营业、4终止营业、5已除名', + `org_parent_no` varchar(20) DEFAULT NULL COMMENT '机构父节点编号', + `sort` varchar(20) DEFAULT NULL COMMENT '机构显示顺序', + remark VARCHAR(500) DEFAULT null COMMENT '备注', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `creator` bigint(20) DEFAULT NULL COMMENT '创建人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `updater` bigint(20) DEFAULT NULL COMMENT '更新人', + `org_create_time` datetime DEFAULT NULL COMMENT '机构创建时间', + `org_stop_time` datetime DEFAULT NULL COMMENT '机构停运时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='机构表'; +-- ---------------------------- +-- 添加机构用户关系表 +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_orga_user_rel`; +CREATE TABLE `jsh_orga_user_rel` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `orga_id` bigint(20) NOT NULL COMMENT '机构id', + `user_id` bigint(20) NOT NULL COMMENT '用户id', + `user_blng_orga_dspl_seq` varchar(20) DEFAULT NULL COMMENT '用户在所属机构中显示顺序', + `delete_flag` char(1) DEFAULT 0 COMMENT '删除标记,0未删除,1删除', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `creator` bigint(20) DEFAULT NULL COMMENT '创建人', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `updater` bigint(20) DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='机构用户关系表'; +-- ---------------------------- +-- 添加机构管理菜单 +-- 插入数据前判断,防止数据重复插入 +-- ---------------------------- +INSERT INTO `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) +select '000108', '机构管理', '0001', '../manage/organization.html', b'1', '0139', b'1', '电脑版', '' from dual where not exists +(select * from jsh_functions where Number='000108' and PNumber='0001'); +-- ---------------------------- +-- 添加根机构 +-- 插入时判断对应数据是否存在,防止多次执行产生重复数据 +-- ---------------------------- +INSERT INTO jsh_organization (org_no, org_full_name, org_abr, org_tpcd, org_stcd, org_parent_no, sort, remark, create_time, creator, update_time, updater, org_create_time, org_stop_time) +select '01', '根机构', '根机构', NULL, '2', '-1', '1', '根机构,初始化存在', NULL, NULL, NULL, NULL, NULL, NULL from dual where not exists +(select * from jsh_organization where org_no='01' and org_abr='根机构' and org_parent_no='-1' ); +-- ---------------------------- +-- 时间:2019年3月9日 +-- version:1.0.6 +-- 此次更新 +-- 整改jsh_systemconfig表的字段 +-- ---------------------------- +alter table jsh_systemconfig drop type; +alter table jsh_systemconfig drop name; +alter table jsh_systemconfig drop value; +alter table jsh_systemconfig drop description; +alter table jsh_systemconfig add company_name varchar(50) DEFAULT null COMMENT '公司名称'; +alter table jsh_systemconfig add company_contacts varchar(20) DEFAULT null COMMENT '公司联系人'; +alter table jsh_systemconfig add company_address varchar(50) DEFAULT null COMMENT '公司地址'; +alter table jsh_systemconfig add company_tel varchar(20) DEFAULT null COMMENT '公司电话'; +alter table jsh_systemconfig add company_fax varchar(20) DEFAULT null COMMENT '公司传真'; +alter table jsh_systemconfig add company_post_code varchar(20) DEFAULT null COMMENT '公司邮编'; +delete from jsh_systemconfig; +insert into jsh_systemconfig (`company_name`, `company_contacts`, `company_address`, `company_tel`, `company_fax`, `company_post_code`) values("南通jshERP公司","张三","南通市通州区某某路","0513-10101010","0513-18181818","226300"); + +-- ---------------------------- +-- 时间:2019年3月9日 +-- version:1.0.7 +-- 改管理员的功能权限 +-- ---------------------------- +update jsh_userbusiness SET +Value = '[13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]' +where Id = 5; +-- ---------------------------- +-- 给订单功能加审核和反审核的功能按钮权限 +-- ---------------------------- +update jsh_functions SET PushBtn = '3' where Number = '050202' and PNumber = '0502'; +update jsh_functions SET PushBtn = '3' where Number = '060301' and PNumber = '0603'; +-- ---------------------------- +-- 改管理员的按钮权限 +-- ---------------------------- +update jsh_userbusiness SET +BtnStr = '[{"funId":"25","btnStr":"1"},{"funId":"217","btnStr":"1"},{"funId":"218","btnStr":"1"},{"funId":"241","btnStr":"3"},{"funId":"242","btnStr":"3"}]' +where Id = 5; + +-- ---------------------------- +-- 时间:2019年3月10日 +-- version:1.0.8 +-- 改状态字段的类型,增加关联单据字段 +-- ---------------------------- +alter table jsh_depot_head change Status Status varchar(1) DEFAULT '0' COMMENT '状态,0未审核、1已审核、2已转采购|销售'; +alter table jsh_depot_head add `LinkNumber` varchar(50) DEFAULT null COMMENT '关联订单号'; +-- ---------------------------- +-- 时间:2019年3月12日 +-- version:1.0.9 +-- 此次更新 +-- 1、根据本地用户表中现有部门生成机构表数据,同时重建机构和用户的关联关系 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +DROP FUNCTION IF EXISTS `_buildOrgAndOrgUserRel`; +DELIMITER ;; +CREATE FUNCTION `_buildOrgAndOrgUserRel` (name varchar(50)) RETURNS mediumtext CHARSET utf8 +begin + +declare _org_full_name varchar(500); -- 机构全称 +declare _org_abr varchar(20); -- 机构简称 +declare _sort int default 0; +declare _success_msg varchar(50) default '重建机构及机构用户关系成功'; -- 机构全称 + -- 遍历数据结束标志 +declare done int DEFAULT 0; +-- 获取用户表中唯一的部门信息列表 +declare orgCur cursor for select distinct department from jsh_user where department!='' and department is not null; + + -- 将结束标志绑定到游标 +declare continue handler for not found set done = 1; + -- 循环部门信息列表在机构表插入数据 + -- 打开游标 + open orgCur; + -- 开始循环 + read_loop: loop + -- 提取游标里的数据,这里只有一个,多个的话也一样; + fetch orgCur into _org_full_name; + -- 声明结束的时候 + if done=1 then + leave read_loop; + end if; + -- 这里做你想做的循环的事件 + if length(_org_full_name)<=20 then + set _org_abr=_org_full_name; + else + set _org_abr=left(_org_full_name,20); + end if; + set _sort=_sort+1; + insert into jsh_organization (org_full_name, org_abr, org_stcd, org_parent_no, sort, remark) + values (_org_full_name,_org_abr, '1', '01', _sort, '机构表初始化'); + begin + declare _userId bigint; + declare _orgId bigint; + -- 遍历数据结束标志 + declare ogrUserRelDone int DEFAULT 0; + -- 根据用户表和机构表部门关联关系,重建用户和机构关联关系 + declare ogrUserRelCur cursor for select user.id as userId,org.id as orgId from jsh_user user,jsh_organization org + where 1=1 and user.department=org.org_full_name and user.department =_org_full_name; + -- 将结束标志绑定到游标 + declare continue handler for not found set ogrUserRelDone = 1; + -- 打开游标 + open ogrUserRelCur; + -- 开始循环 + rel_read_loop: loop + -- 提取游标里的数据,这里只有一个,多个的话也一样; + fetch ogrUserRelCur into _userId,_orgId; + -- 声明结束的时候 + if ogrUserRelDone=1 then + leave rel_read_loop; + end if; + insert into `jsh_orga_user_rel`(`orga_id`, `user_id`, `delete_flag`) VALUES (_orgId,_userId,'0'); + + end loop rel_read_loop; + -- 关闭游标 + close ogrUserRelCur; + end; + + end loop read_loop; + -- 关闭游标 + close orgCur; + +-- 清空用户表中的部门信息 +update jsh_user set department=null; + +return _success_msg; +end +;; +DELIMITER ; +-- ---------------------------- +-- 初始化机构数据,重建机构用户关系 +-- ---------------------------- +select _buildOrgAndOrgUserRel('初始化机构数据,重建机构用户关系') from dual; +-- ---------------------------- +-- 删除一次性函数 +-- ---------------------------- +DROP FUNCTION _buildOrgAndOrgUserRel; + +-- ---------------------------- +-- 时间:2019年3月13日 +-- version:1.0.10 +-- 此次更新 +-- 1、设置用户表的用户状态status默认值为0 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- + +alter table jsh_user change Status Status tinyint(4) DEFAULT '0' COMMENT '状态,0:正常,1:删除,2封禁'; +update jsh_user set status='0' where status is null; +-- ---------------------------- +-- 设置根目录编号为1 +-- ---------------------------- +update jsh_materialcategory set serial_no='1' where id='1'; + +-- ---------------------------- +-- 时间:2019年3月18日 +-- version:1.0.11 +-- 此次更新 +-- 1、批量增加大部分表的tenant_id租户字段 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +alter table jsh_account add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_accounthead add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_accountitem add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_asset add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_assetcategory add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_assetname add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_depot add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_depot_head add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_depot_item add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_inoutitem add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_log add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_material add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_materialcategory add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_orga_user_rel add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_organization add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_person add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_role add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_serial_number add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_supplier add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_systemconfig add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_unit add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; +alter table jsh_user add tenant_id bigint(20) DEFAULT null COMMENT '租户id'; + +-- ---------------------------- +-- 时间:2019年3月27日 +-- version:1.0.12 +-- 此次更新 +-- 添加删除标记,将物理删除修改为逻辑删除 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- 角色表 jsh_role +alter table jsh_role add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 用户 角色 模块关系表 jsh_userbusiness +alter table jsh_userbusiness add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 功能模块表 jsh_functions +alter table jsh_functions add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 应用表 jsh_app +alter table jsh_app add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 产品表 jsh_material +alter table jsh_material add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 产品扩展字段表 jsh_materialproperty +alter table jsh_materialproperty add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 经手人表 jsh_person +alter table jsh_person add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 供应商 客户信息表 jsh_supplier +alter table jsh_supplier add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 系统参数表 jsh_systemconfig +alter table jsh_systemconfig add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 多单位表 jsh_unit +alter table jsh_unit add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 仓库表 jsh_depot +alter table jsh_depot add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 账户信息表 jsh_account +alter table jsh_account add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 财务主表 jsh_accounthead +alter table jsh_accounthead add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 财务子表 jsh_accountitem +alter table jsh_accountitem add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 资产记录表 jsh_asset +alter table jsh_asset add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 资产类型表 jsh_assetcategory +alter table jsh_assetcategory add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 资产信息表 jsh_assetname +alter table jsh_assetname add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 单据主表 jsh_depot_head +alter table jsh_depot_head add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 单据子表 jsh_depot_item +alter table jsh_depot_item add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +-- 收支项目表 jsh_inoutitem +alter table jsh_inoutitem add delete_Flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +-- ---------------------------- +-- 时间:2019年4月11日 +-- version:1.0.13 +-- 此次更新 +-- 删除所有外键 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- + +-- ---------------------------- +-- 删除财务主表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DAAE50527; +ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DB610FC06; +ALTER TABLE jsh_accounthead DROP FOREIGN KEY FK9F4C0D8DC4170B37; +-- ---------------------------- +-- 删除财务子表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0AAE50527; +ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0C5FE6007; +ALTER TABLE jsh_accountitem DROP FOREIGN KEY FK9F4CBAC0D203EDC5; +-- ---------------------------- +-- 删除资产记录表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED27D23FE4; +ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED3E226853; +ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED61FE182C; +ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690ED9B6CB285; +ALTER TABLE jsh_asset DROP FOREIGN KEY FK353690EDAD45B659; +-- ---------------------------- +-- 删除资产信息表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_assetname DROP FOREIGN KEY FKA4ADCCF866BC8AD3; +-- ---------------------------- +-- 删除单据主表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_depot_head DROP FOREIGN KEY FK2A80F214AAE50527; +ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_1; +ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_4; +ALTER TABLE jsh_depot_head DROP FOREIGN KEY jsh_depot_head_ibfk_5; +-- ---------------------------- +-- 删除单据子表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_depot_item DROP FOREIGN KEY FK2A819F47729F5392; +ALTER TABLE jsh_depot_item DROP FOREIGN KEY FK2A819F479485B3F5; +ALTER TABLE jsh_depot_item DROP FOREIGN KEY jsh_depot_item_ibfk_2; +-- ---------------------------- +-- 删除操作日志表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_log DROP FOREIGN KEY FKF2696AA13E226853; +-- ---------------------------- +-- 删除产品表对应外键约束 +-- ---------------------------- +ALTER TABLE jsh_material DROP FOREIGN KEY FK675951272AB6672C; +ALTER TABLE jsh_material DROP FOREIGN KEY jsh_material_ibfk_1; + +-- ---------------------------- +-- 时间:2019年4月30日 +-- version:1.0.14 +-- 此次更新 +-- 增加仓库默认功能 增加库存预警功能 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +alter table jsh_depot add is_default bit(1) DEFAULT NULL COMMENT '是否默认'; +insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) +select '030112', '库存预警', '0301', '../reports/stock_warning_report.html', b'0', '0670', b'1', '电脑版', '' from dual where not exists +(select * from jsh_functions where Number='030112' and PNumber='0301'); + +-- ---------------------------- +-- 改管理员的功能权限 +-- ---------------------------- +update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4', +Value = '[13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212]' +where Id = 5; + +-- ---------------------------- +-- 给app的功能增加代号 在功能表增加个人信息 +-- ---------------------------- +update jsh_app SET Number = '02' where name='个人信息'; +insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`, `Enabled`, `Type`, `PushBtn`) +select '02', '个人信息', '0', '', b'1', '0005', b'1', '电脑版', '' from dual where not exists +(select * from jsh_functions where Number='02' and PNumber='0'); + +-- ---------------------------- +-- 时间:2019年6月23日 +-- 增加新手引导模块 +-- ---------------------------- +INSERT INTO `jsh_app` VALUES ('28', '09', '新手引导', 'app', 'userHelp.png', '../user/userHelp.html', '1000', '500', '\0', '\0', '\0', 'dock', '210', '', '', '0'); +INSERT INTO `jsh_functions` VALUES ('246', '09', '新手引导', '0', '', '', '0115', '', '电脑版', '', '0'); +update jsh_userbusiness SET Value = '[3][6][7][22][23][24][25][26][27][28]' +where Type = 'RoleAPP' and (KeyId = '4' or KeyId = '10'); +update jsh_userbusiness SET +Value = '[245][13][12][16][243][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][246]' +where Type = 'RoleFunctions' and KeyId = '4'; +update jsh_userbusiness SET +Value = '[245][13][243][14][15][234][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][244][210][211][241][33][199][242][41][200][201][202][40][232][233][197][203][204][205][206][212][246]' +where Type = 'RoleFunctions' and KeyId = '10'; + + +-- ---------------------------- +-- 时间:2019年6月26日 +-- 删除多余的资产相关表 +-- ---------------------------- +drop table jsh_asset; +drop table jsh_assetcategory; +drop table jsh_assetname; + + +-- ---------------------------- +-- 时间:2019年6月27日 +-- 增加租户表 +-- ---------------------------- +DROP TABLE IF EXISTS `jsh_tenant`; +CREATE TABLE `jsh_tenant` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `login_name` varchar(255) DEFAULT NULL COMMENT '登录名', + `user_num_limit` int(11) DEFAULT NULL COMMENT '用户数量限制', + `bills_num_limit` int(11) DEFAULT NULL COMMENT '单据数量限制', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8 COMMENT='租户'; + +-- ---------------------------- +-- 时间:2019年6月27日 +-- 给租户表增加数据 +-- ---------------------------- +INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null); + +-- ---------------------------- +-- 时间:2019年7月10日 +-- 删除函数 +-- ---------------------------- +DROP FUNCTION IF EXISTS `_nextval`; + +-- ---------------------------- +-- 时间:2019年8月1日 +-- 增加仓库和客户的启用标记 +-- ---------------------------- +alter table jsh_systemconfig add customer_flag varchar(1) DEFAULT '0' COMMENT '客户启用标记,0未启用,1启用' after company_post_code; +alter table jsh_systemconfig add depot_flag varchar(1) DEFAULT '0' COMMENT '仓库启用标记,0未启用,1启用' after company_post_code; + +-- ---------------------------- +-- 时间:2019年9月13日 +-- 给功能表增加icon字段 +-- ---------------------------- +alter table jsh_functions add icon varchar(50) DEFAULT NULL COMMENT '图标' after PushBtn; + +-- ---------------------------- +-- 时间:2019年9月13日 +-- 创建消息表 +-- ---------------------------- +CREATE TABLE `jsh_msg` ( +`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' , +`msg_title` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息标题' , +`msg_content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息内容' , +`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间' , +`type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息类型' , +`status` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态,1未读 2已读' , +`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' , +`delete_Flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' , +PRIMARY KEY (`id`) +) +ENGINE=InnoDB +DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci +COMMENT='消息表' +AUTO_INCREMENT=2 +ROW_FORMAT=COMPACT +; + +-- ---------------------------- +-- 时间:2019年9月13日 +-- 删除表 jsh_app databasechangelog databasechangeloglock +-- ---------------------------- +drop table databasechangelog; +drop table databasechangeloglock; +drop table jsh_app; + +-- ---------------------------- +-- 时间:2019年11月28日 +-- 单据编号表-改表名 +-- ---------------------------- +ALTER TABLE tbl_sequence RENAME TO jsh_sequence; + +-- ---------------------------- +-- 增加产品初始库存表 +-- 时间 2019-11-28 +-- by jishenghua +-- ---------------------------- +CREATE TABLE `jsh_material_stock` ( +`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' , +`material_id` bigint(20) NULL DEFAULT NULL COMMENT '产品id' , +`depot_id` bigint(20) NULL DEFAULT NULL COMMENT '仓库id' , +`number` decimal(24,6) NULL DEFAULT NULL COMMENT '初始库存数量' , +`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' , +`delete_fag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' , +PRIMARY KEY (`id`) +) +ENGINE=InnoDB +DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci +COMMENT='产品初始库存' +AUTO_INCREMENT=48 +ROW_FORMAT=COMPACT +; + +-- ---------------------------- +-- 增加商品扩展信息表 +-- 时间 2020-02-15 +-- by jishenghua +-- ---------------------------- +CREATE TABLE `jsh_material_extend` ( +`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' , +`material_id` bigint(20) NULL DEFAULT NULL COMMENT '商品id' , +`bar_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品条码' , +`commodity_unit` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品单位' , +`purchase_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '采购价格' , +`commodity_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '零售价格' , +`wholesale_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '销售价格' , +`low_decimal` decimal(24,6) NULL DEFAULT NULL COMMENT '最低售价' , +`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期' , +`create_serial` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人编码' , +`update_serial` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人编码' , +`update_time` bigint(20) NULL DEFAULT NULL COMMENT '更新时间戳' , +`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' , +`delete_Flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' , +PRIMARY KEY (`id`) +) +ENGINE=InnoDB +DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci +COMMENT='产品价格扩展' +AUTO_INCREMENT=1 +ROW_FORMAT=COMPACT +; + +-- ---------------------------- +-- 给单据明细表增加商品扩展id +-- 时间 2020-02-16 +-- by jishenghua +-- ---------------------------- +alter table jsh_depot_item add material_extend_id bigint(20) DEFAULT NULL COMMENT '商品扩展id' after MaterialId; + +-- ---------------------------- +-- 给单据主表删除字段ProjectId 和 AllocationProjectId +-- 时间 2020-02-18 +-- by jishenghua +-- ---------------------------- +alter table jsh_depot_head drop column ProjectId; +alter table jsh_depot_head drop column AllocationProjectId; + +-- ---------------------------- +-- 给计量单位表增加基础单位、副单位、比例三个字段 +-- 时间 2020-03-24 +-- by jishenghua +-- ---------------------------- +alter table jsh_unit add basic_unit varchar(50) DEFAULT NULL COMMENT '基础单位' after UName; +alter table jsh_unit add other_unit varchar(50) DEFAULT NULL COMMENT '副单位' after basic_unit; +alter table jsh_unit add ratio INT DEFAULT NULL COMMENT '比例' after other_unit; + +-- ---------------------------- +-- 时间:2020年03月31日 +-- by jishenghua +-- 给用户表增加 登录用户名 字段 +-- ---------------------------- +alter table jsh_user change loginame login_name varchar(255) NOT NULL COMMENT '登录用户名'; + +-- ---------------------------- +-- 时间:2020年04月12日 +-- by jishenghua +-- 给功能表增加插件管理 +-- ---------------------------- +INSERT INTO `jsh_functions` VALUES (245,'000107', '插件管理', '0001', '/pages/manage/plugin.html', '\0', '0170', '', '电脑版', '', 'icon-notebook', '0'); + +-- ---------------------------- +-- 时间:2020年04月25日 +-- by jishenghua +-- 给商品扩展表增加 是否默认基础单位 字段 +-- ---------------------------- +alter table jsh_material_extend add default_flag VARCHAR(1) DEFAULT 1 COMMENT '是否为默认单位,1是,0否' after low_decimal; + +-- ---------------------------- +-- 时间:2020年05月04日 +-- by jishenghua +-- 删除商品表的多价格相关的字段 +-- ---------------------------- +alter table jsh_material drop Packing; +alter table jsh_material drop RetailPrice; +alter table jsh_material drop LowPrice; +alter table jsh_material drop PresetPriceOne; +alter table jsh_material drop PresetPriceTwo; +alter table jsh_material drop FirstOutUnit; +alter table jsh_material drop FirstInUnit; +alter table jsh_material drop PriceStrategy; + +-- ---------------------------- +-- 时间:2020年6月18日 +-- 增加负库存的启用标记 +-- ---------------------------- +alter table jsh_systemconfig add minus_stock_flag varchar(1) DEFAULT '0' COMMENT '负库存启用标记,0未启用,1启用' after customer_flag; + +-- ---------------------------- +-- 时间 2020年07月13日 +-- by jishenghua +-- 增加产品当前库存表 +-- ---------------------------- +CREATE TABLE `jsh_material_current_stock` ( +`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' , +`material_id` bigint(20) NULL DEFAULT NULL COMMENT '产品id' , +`depot_id` bigint(20) NULL DEFAULT NULL COMMENT '仓库id' , +`current_number` decimal(24,6) NULL DEFAULT NULL COMMENT '当前库存数量' , +`tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '租户id' , +`delete_flag` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除' , +PRIMARY KEY (`id`) +) +ENGINE=InnoDB +DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci +COMMENT='产品当前库存' +AUTO_INCREMENT=1 +ROW_FORMAT=COMPACT +; + +-- -------------------------------------------------------- +-- 时间 2020年07月13日 +-- by jishenghua +-- 修改jsh_material_stock的表名为jsh_material_initial_stock +-- 修改jsh_material_initial_stock表的删除字段 +-- -------------------------------------------------------- +alter table jsh_material_stock rename to jsh_material_initial_stock; +alter table jsh_material_initial_stock change delete_fag delete_flag varchar(1) NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +-- -------------------------------------------------------- +-- 时间 2020年07月20日 +-- by jishenghua +-- 优化表和字段的格式 +-- -------------------------------------------------------- +alter table jsh_log change userID user_id bigint(20) DEFAULT NULL COMMENT '用户id'; +alter table jsh_log change clientIP client_ip varchar(50) DEFAULT NULL COMMENT '客户端IP'; +alter table jsh_log change createtime create_time datetime DEFAULT NULL COMMENT '创建时间'; +alter table jsh_log change contentdetails content varchar(1000) DEFAULT NULL COMMENT '详情'; +alter table jsh_log drop column remark; + +alter table jsh_materialcategory rename to jsh_material_category; +alter table jsh_material_category change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_material_category change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_material_category change CategoryLevel category_level smallint(6) DEFAULT NULL COMMENT '等级'; +alter table jsh_material_category change ParentId parent_id bigint(20) DEFAULT NULL COMMENT '上级id'; + +alter table jsh_materialproperty rename to jsh_material_property; +alter table jsh_material_property change nativeName native_name varchar(50) DEFAULT NULL COMMENT '原始名称'; +alter table jsh_material_property change anotherName another_name varchar(50) DEFAULT NULL COMMENT '别名'; +alter table jsh_material_property change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_role change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_role change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_role change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_person change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_person change Type type varchar(20) DEFAULT NULL COMMENT '类型'; +alter table jsh_person change Name name varchar(50) DEFAULT NULL COMMENT '姓名'; +alter table jsh_person change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_systemconfig rename to jsh_system_config; +alter table jsh_system_config change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_account change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_account change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_account change SerialNo serial_no varchar(50) DEFAULT NULL COMMENT '编号'; +alter table jsh_account change InitialAmount initial_amount decimal(24,6) DEFAULT NULL COMMENT '期初金额'; +alter table jsh_account change CurrentAmount current_amount decimal(24,6) DEFAULT NULL COMMENT '当前余额'; +alter table jsh_account change Remark remark varchar(100) DEFAULT NULL COMMENT '备注'; +alter table jsh_account change IsDefault is_default bit(1) DEFAULT NULL COMMENT '是否默认'; +alter table jsh_account change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_functions rename to jsh_function; +alter table jsh_function change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_function change Number number varchar(50) DEFAULT NULL COMMENT '编号'; +alter table jsh_function change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_function change PNumber parent_number varchar(50) DEFAULT NULL COMMENT '上级编号'; +alter table jsh_function change URL url varchar(100) DEFAULT NULL COMMENT '链接'; +alter table jsh_function change State state bit(1) DEFAULT NULL COMMENT '收缩'; +alter table jsh_function change Sort sort varchar(50) DEFAULT NULL COMMENT '排序'; +alter table jsh_function change Enabled enabled bit(1) DEFAULT NULL COMMENT '启用'; +alter table jsh_function change Type type varchar(50) DEFAULT NULL COMMENT '类型'; +alter table jsh_function change PushBtn push_btn varchar(50) DEFAULT NULL COMMENT '功能按钮'; +alter table jsh_function change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_userbusiness rename to jsh_user_business; +alter table jsh_user_business change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_user_business change Type type varchar(50) DEFAULT NULL COMMENT '类别'; +alter table jsh_user_business change KeyId key_id varchar(50) DEFAULT NULL COMMENT '主id'; +alter table jsh_user_business change Value value varchar(10000) DEFAULT NULL COMMENT '值'; +alter table jsh_user_business change BtnStr btn_str varchar(2000) DEFAULT NULL COMMENT '按钮权限'; +alter table jsh_user_business change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_unit change UName name varchar(50) DEFAULT NULL COMMENT '名称,支持多单位'; +alter table jsh_unit change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_inoutitem rename to jsh_in_out_item; +alter table jsh_in_out_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_in_out_item change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_in_out_item change Type type varchar(20) DEFAULT NULL COMMENT '类型'; +alter table jsh_in_out_item change Remark remark varchar(100) DEFAULT NULL COMMENT '备注'; +alter table jsh_in_out_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_serial_number change material_Id material_id bigint(20) DEFAULT NULL COMMENT '产品表id'; +alter table jsh_serial_number change serial_Number serial_number varchar(64) DEFAULT NULL COMMENT '序列号'; +alter table jsh_serial_number change is_Sell is_sell varchar(1) DEFAULT '0' COMMENT '是否卖出,0未卖出,1卖出'; +alter table jsh_serial_number change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +alter table jsh_serial_number change create_Time create_time datetime DEFAULT NULL COMMENT '创建时间'; +alter table jsh_serial_number change update_Time update_time datetime DEFAULT NULL COMMENT '更新时间'; +alter table jsh_serial_number change depothead_Id depot_head_id bigint(20) DEFAULT NULL COMMENT '单据主表id,用于跟踪序列号流向'; + +alter table jsh_supplier change phonenum phone_num varchar(30) DEFAULT NULL COMMENT '联系电话'; +alter table jsh_supplier change AdvanceIn advance_in decimal(24,6) DEFAULT '0.000000' COMMENT '预收款'; +alter table jsh_supplier change BeginNeedGet begin_need_get decimal(24,6) DEFAULT NULL COMMENT '期初应收'; +alter table jsh_supplier change BeginNeedPay begin_need_pay decimal(24,6) DEFAULT NULL COMMENT '期初应付'; +alter table jsh_supplier change AllNeedGet all_need_get decimal(24,6) DEFAULT NULL COMMENT '累计应收'; +alter table jsh_supplier change AllNeedPay all_need_pay decimal(24,6) DEFAULT NULL COMMENT '累计应付'; +alter table jsh_supplier change taxNum tax_num varchar(50) DEFAULT NULL COMMENT '纳税人识别号'; +alter table jsh_supplier change bankName bank_name varchar(50) DEFAULT NULL COMMENT '开户行'; +alter table jsh_supplier change accountNumber account_number varchar(50) DEFAULT NULL COMMENT '账号'; +alter table jsh_supplier change taxRate tax_rate decimal(24,6) DEFAULT NULL COMMENT '税率'; +alter table jsh_supplier change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_accounthead rename to jsh_account_head; +alter table jsh_account_head change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_account_head change Type type varchar(50) DEFAULT NULL COMMENT '类型(支出/收入/收款/付款/转账)'; +alter table jsh_account_head change OrganId organ_id bigint(20) DEFAULT NULL COMMENT '单位Id(收款/付款单位)'; +alter table jsh_account_head change HandsPersonId hands_person_id bigint(20) DEFAULT NULL COMMENT '经手人id'; +alter table jsh_account_head change ChangeAmount change_amount decimal(24,6) DEFAULT NULL COMMENT '变动金额(优惠/收款/付款/实付)'; +alter table jsh_account_head change TotalPrice total_price decimal(24,6) DEFAULT NULL COMMENT '合计金额'; +alter table jsh_account_head change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户(收款/付款)'; +alter table jsh_account_head change BillNo bill_no varchar(50) DEFAULT NULL COMMENT '单据编号'; +alter table jsh_account_head change BillTime bill_time datetime DEFAULT NULL COMMENT '单据日期'; +alter table jsh_account_head change Remark remark varchar(100) DEFAULT NULL COMMENT '备注'; +alter table jsh_account_head change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_accountitem rename to jsh_account_item; +alter table jsh_account_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_account_item change HeaderId header_id bigint(20) NOT NULL COMMENT '表头Id'; +alter table jsh_account_item change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户Id'; +alter table jsh_account_item change InOutItemId in_out_item_id bigint(20) DEFAULT NULL COMMENT '收支项目Id'; +alter table jsh_account_item change EachAmount each_amount decimal(24,6) DEFAULT NULL COMMENT '单项金额'; +alter table jsh_account_item change Remark remark varchar(100) DEFAULT NULL COMMENT '单据备注'; +alter table jsh_account_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_material change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_material change CategoryId category_id bigint(20) DEFAULT NULL COMMENT '产品类型id'; +alter table jsh_material change Name name varchar(50) DEFAULT NULL COMMENT '名称'; +alter table jsh_material change Mfrs mfrs varchar(50) DEFAULT NULL COMMENT '制造商'; +alter table jsh_material change SafetyStock safety_stock decimal(24,6) DEFAULT NULL COMMENT '安全存量(KG)'; +alter table jsh_material change Model model varchar(50) DEFAULT NULL COMMENT '型号'; +alter table jsh_material change Standard standard varchar(50) DEFAULT NULL COMMENT '规格'; +alter table jsh_material change Color color varchar(50) DEFAULT NULL COMMENT '颜色'; +alter table jsh_material change Unit unit varchar(50) DEFAULT NULL COMMENT '单位-单个'; +alter table jsh_material change Remark remark varchar(100) DEFAULT NULL COMMENT '备注'; +alter table jsh_material change UnitId unit_id bigint(20) DEFAULT NULL COMMENT '计量单位Id'; +alter table jsh_material change Enabled enabled bit(1) DEFAULT NULL COMMENT '启用 0-禁用 1-启用'; +alter table jsh_material change OtherField1 other_field1 varchar(50) DEFAULT NULL COMMENT '自定义1'; +alter table jsh_material change OtherField2 other_field2 varchar(50) DEFAULT NULL COMMENT '自定义2'; +alter table jsh_material change OtherField3 other_field3 varchar(50) DEFAULT NULL COMMENT '自定义3'; +alter table jsh_material change enableSerialNumber enable_serial_number varchar(1) DEFAULT '0' COMMENT '是否开启序列号,0否,1是'; +alter table jsh_material change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_depothead rename to jsh_depot_head; +alter table jsh_depot_head change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_depot_head change Type type varchar(50) DEFAULT NULL COMMENT '类型(出库/入库)'; +alter table jsh_depot_head change SubType sub_type varchar(50) DEFAULT NULL COMMENT '出入库分类'; +alter table jsh_depot_head change DefaultNumber default_number varchar(50) DEFAULT NULL COMMENT '初始票据号'; +alter table jsh_depot_head change Number number varchar(50) DEFAULT NULL COMMENT '票据号'; +alter table jsh_depot_head change OperPersonName oper_person_name varchar(50) DEFAULT NULL COMMENT '操作员名字'; +alter table jsh_depot_head change CreateTime create_time datetime DEFAULT NULL COMMENT '创建时间'; +alter table jsh_depot_head change OperTime oper_time datetime DEFAULT NULL COMMENT '出入库时间'; +alter table jsh_depot_head change OrganId organ_id bigint(20) DEFAULT NULL COMMENT '供应商id'; +alter table jsh_depot_head change HandsPersonId hands_person_id bigint(20) DEFAULT NULL COMMENT '采购/领料-经手人id'; +alter table jsh_depot_head change AccountId account_id bigint(20) DEFAULT NULL COMMENT '账户id'; +alter table jsh_depot_head change ChangeAmount change_amount decimal(24,6) DEFAULT NULL COMMENT '变动金额(收款/付款)'; +alter table jsh_depot_head change TotalPrice total_price decimal(24,6) DEFAULT NULL COMMENT '合计金额'; +alter table jsh_depot_head change PayType pay_type varchar(50) DEFAULT NULL COMMENT '付款类型(现金、记账等)'; +alter table jsh_depot_head change Remark remark varchar(1000) DEFAULT NULL COMMENT '备注'; +alter table jsh_depot_head change Salesman sales_man varchar(50) DEFAULT NULL COMMENT '业务员(可以多个)'; +alter table jsh_depot_head change AccountIdList account_id_list varchar(50) DEFAULT NULL COMMENT '多账户ID列表'; +alter table jsh_depot_head change AccountMoneyList account_money_list varchar(200) DEFAULT NULL COMMENT '多账户金额列表'; +alter table jsh_depot_head change Discount discount decimal(24,6) DEFAULT NULL COMMENT '优惠率'; +alter table jsh_depot_head change DiscountMoney discount_money decimal(24,6) DEFAULT NULL COMMENT '优惠金额'; +alter table jsh_depot_head change DiscountLastMoney discount_last_money decimal(24,6) DEFAULT NULL COMMENT '优惠后金额'; +alter table jsh_depot_head change OtherMoney other_money decimal(24,6) DEFAULT NULL COMMENT '销售或采购费用合计'; +alter table jsh_depot_head change OtherMoneyList other_money_list varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目Id数组(包括快递、招待等)'; +alter table jsh_depot_head change OtherMoneyItem other_money_item varchar(200) DEFAULT NULL COMMENT '销售或采购费用涉及项目(包括快递、招待等)'; +alter table jsh_depot_head change AccountDay account_day int(10) DEFAULT NULL COMMENT '结算天数'; +alter table jsh_depot_head change Status status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2已转采购|销售'; +alter table jsh_depot_head change LinkNumber link_number varchar(50) DEFAULT NULL COMMENT '关联订单号'; +alter table jsh_depot_head change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +alter table jsh_depotitem rename to jsh_depot_item; +alter table jsh_depot_item change Id id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键'; +alter table jsh_depot_item change HeaderId header_id bigint(20) NOT NULL COMMENT '表头Id'; +alter table jsh_depot_item change MaterialId material_id bigint(20) NOT NULL COMMENT '商品Id'; +alter table jsh_depot_item change MUnit material_unit varchar(20) DEFAULT NULL COMMENT '商品计量单位'; +alter table jsh_depot_item change OperNumber oper_number decimal(24,6) DEFAULT NULL COMMENT '数量'; +alter table jsh_depot_item change BasicNumber basic_number decimal(24,6) DEFAULT NULL COMMENT '基础数量,如kg、瓶'; +alter table jsh_depot_item change UnitPrice unit_price decimal(24,6) DEFAULT NULL COMMENT '单价'; +alter table jsh_depot_item change TaxUnitPrice tax_unit_price decimal(24,6) DEFAULT NULL COMMENT '含税单价'; +alter table jsh_depot_item change AllPrice all_price decimal(24,6) DEFAULT NULL COMMENT '金额'; +alter table jsh_depot_item change Remark remark varchar(200) DEFAULT NULL COMMENT '备注'; +alter table jsh_depot_item change Img img varchar(50) DEFAULT NULL COMMENT '图片'; +alter table jsh_depot_item change Incidentals incidentals decimal(24,6) DEFAULT NULL COMMENT '运杂费'; +alter table jsh_depot_item change DepotId depot_id bigint(20) DEFAULT NULL COMMENT '仓库ID'; +alter table jsh_depot_item change AnotherDepotId another_depot_id bigint(20) DEFAULT NULL COMMENT '调拨时,对方仓库Id'; +alter table jsh_depot_item change TaxRate tax_rate decimal(24,6) DEFAULT NULL COMMENT '税率'; +alter table jsh_depot_item change TaxMoney tax_money decimal(24,6) DEFAULT NULL COMMENT '税额'; +alter table jsh_depot_item change TaxLastMoney tax_last_money decimal(24,6) DEFAULT NULL COMMENT '价税合计'; +alter table jsh_depot_item change OtherField1 other_field1 varchar(50) DEFAULT NULL COMMENT '自定义字段1-名称'; +alter table jsh_depot_item change OtherField2 other_field2 varchar(50) DEFAULT NULL COMMENT '自定义字段2-型号'; +alter table jsh_depot_item change OtherField3 other_field3 varchar(50) DEFAULT NULL COMMENT '自定义字段3-制造商'; +alter table jsh_depot_item change OtherField4 other_field4 varchar(50) DEFAULT NULL COMMENT '自定义字段4-名称'; +alter table jsh_depot_item change OtherField5 other_field5 varchar(50) DEFAULT NULL COMMENT '自定义字段5-名称'; +alter table jsh_depot_item change MType material_type varchar(20) DEFAULT NULL COMMENT '商品类型'; +alter table jsh_depot_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; + +-- -------------------------------------------------------- +-- 时间 2020年09月13日 +-- by jishenghua +-- 给单据表增加操作员字段,去掉经手头姓名字段 +-- -------------------------------------------------------- +alter table jsh_depot_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id; +alter table jsh_account_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id; +alter table jsh_depot_head drop column oper_person_name; +update jsh_depot_head set creator=hands_person_id; + + +-- -------------------------------------------------------- +-- 时间 2020年10月17日 +-- by jishenghua +-- 增加平台表 +-- -------------------------------------------------------- +DROP TABLE IF EXISTS `jsh_platform_config`; +CREATE TABLE `jsh_platform_config` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `platform_key` varchar(100) DEFAULT NULL COMMENT '关键词', + `platform_key_info` varchar(100) DEFAULT NULL COMMENT '关键词名称', + `platform_value` varchar(200) DEFAULT NULL COMMENT '值', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='平台参数'; + +INSERT INTO `jsh_platform_config` VALUES ('1', 'platform_name', '平台名称', '华夏ERP'); +INSERT INTO `jsh_platform_config` VALUES ('2', 'activation_code', '激活码', null); + +-- -------------------------------------------------------- +-- 时间 2020年11月24日 +-- by jishenghua +-- 给单据主表增加单据类型字段bill_type +-- -------------------------------------------------------- +alter table jsh_depot_head add bill_type varchar(50) DEFAULT NULL COMMENT '单据类型' after pay_type; + +-- -------------------------------------------------------- +-- 时间 2021年1月19日 +-- by jishenghua +-- 给功能表增加组件字段component +-- -------------------------------------------------------- +alter table jsh_function add component varchar(100) DEFAULT NULL COMMENT '组件' after url; + +-- -------------------------------------------------------- +-- 时间 2021年2月13日 +-- by jishenghua +-- 优化机构和商品类型表的字段 +-- -------------------------------------------------------- +alter table jsh_organization change org_parent_no parent_id bigint(20) DEFAULT NULL COMMENT '父机构id'; +alter table jsh_organization change org_stcd delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +alter table jsh_organization drop column org_tpcd; +alter table jsh_organization drop column org_create_time; +alter table jsh_organization drop column org_stop_time; +alter table jsh_organization drop column creator; +alter table jsh_organization drop column updater; +alter table jsh_material_category drop column creator; +alter table jsh_material_category drop column updater; +alter table jsh_material_category change status delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; +update jsh_material_category set delete_flag='0'; + +-- -------------------------------------------------------- +-- 时间 2021年6月1日 +-- by jishenghua +-- 增加租户管理菜单 +-- -------------------------------------------------------- +INSERT INTO `jsh_function` (`id`, `number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('18', '000109', '租户管理', '0001', '/system/tenant', '/system/TenantList', b'0', '0167', b'1', '电脑版', '1', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年6月19日 +-- by jishenghua +-- 更新jsh_platform_config数据 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('3', 'platform_url', '官方网站', 'http://www.huaxiaerp.com/'); + +-- -------------------------------------------------------- +-- 时间 2021年6月20日 +-- by jishenghua +-- 将库存状态报表改为进销存统计报表 +-- -------------------------------------------------------- +update jsh_function set name='进销存统计', sort='0658' where id=59; + +-- -------------------------------------------------------- +-- 时间 2021年6月20日 +-- by jishenghua +-- 增加商品库存报表 +-- -------------------------------------------------------- +INSERT INTO `jsh_function` (`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('030113', '商品库存', '0301', '/report/material_stock', '/report/MaterialStock', b'0', '0605', b'1', '电脑版', '', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年6月29日 +-- by jishenghua +-- 给jsh_account_item增加字段进销存单据id 应收欠款 已收欠款 +-- 给jsh_depot_head增加附件字段附件名称 +-- 给jsh_account_head增加附件字段附件名称 优惠金额 +-- -------------------------------------------------------- +alter table jsh_account_item add bill_id bigint(20) DEFAULT NULL COMMENT '进销存单据id' after in_out_item_id; +alter table jsh_account_item add need_debt decimal(24,6) DEFAULT NULL COMMENT '应收欠款' after bill_id; +alter table jsh_account_item add finish_debt decimal(24,6) DEFAULT NULL COMMENT '已收欠款' after need_debt; +alter table jsh_depot_head add file_name varchar(1000) DEFAULT NULL COMMENT '附件名称' after remark; +alter table jsh_account_head add file_name varchar(500) DEFAULT NULL COMMENT '附件名称' after remark; +alter table jsh_account_head add discount_money decimal(24,6) DEFAULT NULL COMMENT '优惠金额' after change_amount; + +-- -------------------------------------------------------- +-- 时间 2021年7月1日 +-- by jishenghua +-- 给商品表增加附件名称字段 +-- -------------------------------------------------------- +alter table jsh_material add img_name varchar(1000) DEFAULT NULL COMMENT '图片名称' after remark; + +-- -------------------------------------------------------- +-- 时间 2021年7月6日 +-- by jishenghua +-- 给租户表增加字段enabled +-- -------------------------------------------------------- +alter table jsh_tenant add enabled bit(1) DEFAULT 1 COMMENT '启用 0-禁用 1-启用' after bills_num_limit; + +-- -------------------------------------------------------- +-- 时间 2021年7月21日 +-- by jishenghua +-- 增加商品属性表 +-- -------------------------------------------------------- +DROP TABLE IF EXISTS `jsh_material_attribute`; +CREATE TABLE `jsh_material_attribute` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `attribute_field` varchar(50) DEFAULT NULL COMMENT '属性字段', + `attribute_name` varchar(50) DEFAULT NULL COMMENT '属性名', + `attribute_value` varchar(500) DEFAULT NULL COMMENT '属性值', + `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id', + `delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='产品属性表'; + +INSERT INTO `jsh_material_attribute` VALUES ('1', 'manyColor', '多颜色', '红色|橙色|黄色|绿色|蓝色|紫色', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('2', 'manySize', '多尺寸', 'S|M|L|XL|XXL|XXXL', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('3', 'other1', '自定义1', '小米|华为', '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('4', 'other2', '自定义2', null, '63', '0'); +INSERT INTO `jsh_material_attribute` VALUES ('5', 'other3', '自定义3', null, '63', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年7月22日 +-- by jishenghua +-- 增加多属性设置菜单 +-- -------------------------------------------------------- +INSERT INTO `jsh_function` (`id`, `number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('247', '010105', '多属性', '0101', '/material/material_attribute', '/material/MaterialAttributeList', '\0', '0250', '', '电脑版', '1', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年7月22日 +-- by jishenghua +-- 移除机构表的全名字段 +-- 给商品扩展表加sku字段 +-- 给单据主表移除多余字段 +-- 给单据子表移除多余字段 +-- -------------------------------------------------------- +alter table jsh_organization drop column org_full_name; +alter table jsh_material_extend add sku varchar(50) DEFAULT NULL COMMENT '多属性' after commodity_unit; +alter table jsh_depot_head drop column hands_person_id; +alter table jsh_depot_head drop column other_money_list; +alter table jsh_depot_head drop column other_money_item; +alter table jsh_depot_head drop column account_day; +alter table jsh_depot_item drop column img; +alter table jsh_depot_item drop column incidentals; +alter table jsh_depot_item drop column other_field1; +alter table jsh_depot_item drop column other_field2; +alter table jsh_depot_item drop column other_field3; +alter table jsh_depot_item drop column other_field4; +alter table jsh_depot_item drop column other_field5; + +-- -------------------------------------------------------- +-- 时间 2021年7月27日 +-- by jishenghua +-- 给单据子表加sku字段 +-- -------------------------------------------------------- +alter table jsh_depot_item add sku varchar(50) DEFAULT NULL COMMENT '多属性' after material_unit; + +-- -------------------------------------------------------- +-- 时间 2021年7月29日 +-- by jishenghua +-- 增加调拨明细菜单 +-- -------------------------------------------------------- +INSERT INTO `jsh_function` VALUES ('248', '030150', '调拨明细', '0301', '/report/allocation_detail', '/report/AllocationDetail', '\0', '0646', '', '电脑版', '', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2021年8月24日 +-- by jishenghua +-- 给租户表加sku字段 +-- 给租户表移除单据数量限制字段 +-- -------------------------------------------------------- +alter table jsh_tenant add type varchar(1) DEFAULT '0' COMMENT '租户类型,0免费租户,1付费租户' after bills_num_limit; +alter table jsh_tenant drop column bills_num_limit; +alter table jsh_tenant add expire_time datetime DEFAULT NULL COMMENT '到期时间' after create_time; + +-- -------------------------------------------------------- +-- 时间 2021年8月29日 +-- by jishenghua +-- 给日志表的ip字段改长度 +-- -------------------------------------------------------- +alter table jsh_log change client_ip client_ip varchar(200) DEFAULT NULL COMMENT '客户端IP'; + +-- -------------------------------------------------------- +-- 时间 2021年9月5日 +-- by jishenghua +-- 给财务表增加状态字段,给历史数据赋值为0 +-- -------------------------------------------------------- +alter table jsh_account_head add status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核' after file_name; +update jsh_account_head set status=0; + +-- -------------------------------------------------------- +-- 时间 2021年9月12日 +-- by jishenghua +-- 插入jsh_platform_config数据,控制是否显示三联打印 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0'); +INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('5', 'bill_print_url', '三联打印地址', ''); + +-- -------------------------------------------------------- +-- 时间 2021年9月24日 +-- by jishenghua +-- 修改单据主表的状态字段描述 +-- -------------------------------------------------------- +alter table jsh_depot_head change status status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售'; + +-- -------------------------------------------------------- +-- 时间 2021年9月27日 +-- by jishenghua +-- 给商品表和单据字表增加字段 +-- -------------------------------------------------------- +alter table jsh_material add enable_batch_number varchar(1) DEFAULT 0 COMMENT '是否开启批号,0否,1是' after enable_serial_number; +alter table jsh_material add expiry_num int(10) DEFAULT NULL COMMENT '保质期天数' after unit_id; +alter table jsh_depot_item add sn_list varchar(2000) DEFAULT NULL COMMENT '序列号列表' after material_type; +alter table jsh_depot_item add batch_number varchar(100) DEFAULT NULL COMMENT '批号' after sn_list; +alter table jsh_depot_item add expiration_date datetime DEFAULT NULL COMMENT '有效日期' after batch_number; + +-- -------------------------------------------------------- +-- 时间 2021年9月27日 +-- by jishenghua +-- 插入jsh_platform_config数据,配置租户续费地址 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('pay_fee_url', '租户续费地址', ''); + +-- -------------------------------------------------------- +-- 时间 2021年9月28日 +-- by jishenghua +-- 给序列号表增加仓库id +-- -------------------------------------------------------- +alter table jsh_serial_number add depot_id bigint(20) DEFAULT NULL COMMENT '仓库id' after material_Id; + +-- -------------------------------------------------------- +-- 时间 2021年10月4日 +-- by jishenghua +-- 给序列号表增加入库单号和出库单号字段,另外去掉单据id字段 +-- 移除序列号菜单 +-- -------------------------------------------------------- +alter table jsh_serial_number add in_bill_no varchar(50) DEFAULT NULL COMMENT '入库单号' after updater; +alter table jsh_serial_number add out_bill_no varchar(50) DEFAULT NULL COMMENT '出库单号' after in_bill_no; +alter table jsh_serial_number drop column depot_head_id; +delete from jsh_function where number='010104'; + +-- -------------------------------------------------------- +-- 时间 2021年10月12日 +-- by jishenghua +-- 给租户表增加备注字段 +-- -------------------------------------------------------- +alter table jsh_tenant add remark varchar(500) DEFAULT NULL COMMENT '备注' after expire_time; + +-- -------------------------------------------------------- +-- 时间 2021年10月29日 +-- by jishenghua +-- 给商品初始库存表增加最低库存数量、最高库存数量字段 +-- 给商品表增加基础重量字段 +-- 给商品表移除安全库存字段 +-- -------------------------------------------------------- +alter table jsh_material_initial_stock add low_safe_stock decimal(24,6) DEFAULT NULL COMMENT '最低库存数量' after number; +alter table jsh_material_initial_stock add high_safe_stock decimal(24,6) DEFAULT NULL COMMENT '最高库存数量' after low_safe_stock; +alter table jsh_material add weight decimal(24,6) DEFAULT NULL COMMENT '基础重量(kg)' after expiry_num; +alter table jsh_material drop column safety_stock; + +-- -------------------------------------------------------- +-- 时间 2021年11月5日 +-- by jishenghua +-- 给用户/角色/模块关系表增加租户字段 +-- 给用户/角色/模块关系表的租户字段赋值 +-- -------------------------------------------------------- +alter table jsh_user_business add tenant_id bigint(20) DEFAULT null COMMENT '租户id' after btn_str; +update jsh_user_business ub left join jsh_user u on ub.key_id=u.id set ub.tenant_id=u.tenant_id +where (ub.type='UserRole' or ub.type='UserDepot' or ub.type='UserCustomer') and u.tenant_id!=0; +update jsh_user_business ub left join jsh_role r on ub.key_id=r.id set ub.tenant_id=r.tenant_id +where (ub.type='RoleFunctions') and r.tenant_id is not null; + +-- -------------------------------------------------------- +-- 时间 2021年11月30日 +-- by jishenghua +-- 给计量单位表增加副单位2、副单位3、比例2、比例3 四个字段 +-- -------------------------------------------------------- +alter table jsh_unit add other_unit_two varchar(50) DEFAULT NULL COMMENT '副单位2' after other_unit; +alter table jsh_unit add other_unit_three varchar(50) DEFAULT NULL COMMENT '副单位3' after other_unit_two; +alter table jsh_unit add ratio_two int(11) DEFAULT NULL COMMENT '比例2' after ratio; +alter table jsh_unit add ratio_three int(11) DEFAULT NULL COMMENT '比例3' after ratio_two; + +-- -------------------------------------------------------- +-- 时间 2021年12月07日 +-- by jishenghua +-- 更新菜单名称-进货统计改为采购统计 +-- 增加平台配置菜单 +-- 给平台配置增加注册启用标记 +-- 更新消息表中已有信息的状态 +-- -------------------------------------------------------- +update jsh_function set name='采购统计' where name='进货统计'; +insert into `jsh_function`(`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) + values ('000112', '平台配置', '0001', '/system/platform_config', '/system/PlatformConfigList', '\0', '0175', '', '电脑版', '', 'profile', '0'); +insert into `jsh_platform_config`(`platform_key`, `platform_key_info`, `platform_value`) + values ('register_flag', '注册启用标记', '1'); +update jsh_msg set status='2' where id=2; + +-- -------------------------------------------------------- +-- 时间 2021年12月12日 +-- by jishenghua +-- 给单据表增加找零字段backAmount +-- -------------------------------------------------------- +alter table jsh_depot_head add back_amount decimal(24,6) DEFAULT NULL COMMENT '找零金额' after change_amount; + +-- -------------------------------------------------------- +-- 时间 2022年04月21日 +-- by jishenghua +-- 修改商品表的名称字段的长度 +-- -------------------------------------------------------- +alter table jsh_material change name name varchar(100) DEFAULT NULL COMMENT '名称'; + +-- -------------------------------------------------------- +-- 时间 2022年05月03日 +-- by jishenghua +-- 给系统参数表增加销售协议字段 +-- -------------------------------------------------------- +alter table jsh_system_config add sale_agreement varchar(500) DEFAULT NULL COMMENT '销售协议' after company_post_code; + +-- -------------------------------------------------------- +-- 时间 2022年05月17日 +-- by jishenghua +-- 给单据主表增加采购状态字段 +-- 给系统参数表增加以销定购开关字段 +-- -------------------------------------------------------- +alter table jsh_depot_head add purchase_status varchar(1) DEFAULT NULL COMMENT '采购状态,0未采购、2完成采购、3部分采购' after status; +alter table jsh_system_config add purchase_by_sale_flag varchar(1) DEFAULT '0' COMMENT '以销定购启用标记,0未启用,1启用' after minus_stock_flag; +update jsh_depot_head set purchase_status='0'; + +-- -------------------------------------------------------- +-- 时间 2022年05月28日 +-- by jishenghua +-- 给单据子表增加关联明细id +-- 给单据主表增加订金字段 +-- -------------------------------------------------------- +alter table jsh_depot_item add link_id bigint(20) DEFAULT NULL COMMENT '关联明细id' after expiration_date; +alter table jsh_depot_head add deposit decimal(24,6) DEFAULT NULL COMMENT '订金' after other_money; + +-- -------------------------------------------------------- +-- 时间 2022年07月25日 +-- by jishenghua +-- 给平台参数表添加手机端激活码 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` VALUES ('8', 'app_activation_code', '手机端激活码', ''); + +-- -------------------------------------------------------- +-- 时间 2022年08月25日 +-- by jishenghua +-- 给部分表增加启用状态和排序字段 +-- -------------------------------------------------------- +alter table jsh_unit add enabled bit(1) DEFAULT NULL COMMENT '启用' after ratio_three; +update jsh_unit set enabled=1; +alter table jsh_supplier add sort varchar(10) DEFAULT NULL COMMENT '排序' after tax_rate; +alter table jsh_depot add enabled bit(1) DEFAULT NULL COMMENT '启用' after principal; +update jsh_depot set enabled=1; +alter table jsh_in_out_item add enabled bit(1) DEFAULT NULL COMMENT '启用' after remark; +alter table jsh_in_out_item add sort varchar(10) DEFAULT NULL COMMENT '排序' after enabled; +update jsh_in_out_item set enabled=1; +alter table jsh_account add enabled bit(1) DEFAULT NULL COMMENT '启用' after remark; +alter table jsh_account add sort varchar(10) DEFAULT NULL COMMENT '排序' after enabled; +update jsh_account set enabled=1; +alter table jsh_person add enabled bit(1) DEFAULT NULL COMMENT '启用' after name; +alter table jsh_person add sort varchar(10) DEFAULT NULL COMMENT '排序' after enabled; +update jsh_person set enabled=1; +alter table jsh_role add enabled bit(1) DEFAULT NULL COMMENT '启用' after description; +alter table jsh_role add sort varchar(10) DEFAULT NULL COMMENT '排序' after enabled; +update jsh_role set enabled=1; + +-- -------------------------------------------------------- +-- 时间 2022年08月30日 +-- by jishenghua +-- 给产品属性表移除属性字段 +-- -------------------------------------------------------- +alter table jsh_material_attribute drop column attribute_field; + +-- -------------------------------------------------------- +-- 时间 2022年09月13日 +-- by jishenghua +-- 给商品和财务单据的备注修改字段长度 +-- -------------------------------------------------------- +alter table jsh_material change remark remark varchar(500) DEFAULT NULL COMMENT '备注'; +alter table jsh_account_head change remark remark varchar(1000) DEFAULT NULL COMMENT '备注'; + +-- -------------------------------------------------------- +-- 时间 2022年10月2日 +-- by jishenghua +-- 给单据明细增加采购单价字段 +-- -------------------------------------------------------- +alter table jsh_depot_item add purchase_unit_price decimal(24,6) DEFAULT NULL COMMENT '采购单价' after unit_price; + +-- -------------------------------------------------------- +-- 时间 2022年10月23日 +-- by jishenghua +-- 给角色表增加价格屏蔽字段 +-- -------------------------------------------------------- +alter table jsh_role add price_limit varchar(50) DEFAULT NULL COMMENT '价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价' after type; + +-- -------------------------------------------------------- +-- 时间 2023年02月19日 +-- by jishenghua +-- 给系统参数表增加多级审核开关字段 +-- 给用户表增加是否经理字段,默认为否 +-- 给平台配置表增加发起流程地址 +-- -------------------------------------------------------- +alter table jsh_system_config add multi_level_approval_flag varchar(1) DEFAULT '0' COMMENT '多级审核启用标记,0未启用,1启用' after purchase_by_sale_flag; +alter table jsh_user add leader_flag varchar(1) DEFAULT '0' COMMENT '是否经理,0否,1是' after password; +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('send_workflow_url', '发起流程地址', ''); + +-- -------------------------------------------------------- +-- 时间 2023年02月25日 +-- by jishenghua +-- 给消息表增加接收人字段 +-- 更新接收人id字段的值 +-- 给系统参数表增加流程类型 +-- -------------------------------------------------------- +alter table jsh_msg add user_id bigint(20) DEFAULT NULL COMMENT '接收人id' after type; +update jsh_msg set user_id=tenant_id where user_id is null; +alter table jsh_system_config add multi_bill_type varchar(200) DEFAULT NULL COMMENT '流程类型,可多选' after multi_level_approval_flag; + +-- -------------------------------------------------------- +-- 时间 2023年03月08日 +-- by jishenghua +-- 给计量单位表修改比例的字段类型 +-- 给系统参数表增加金额审核启用标记 +-- 给单据增加来源字段 +-- -------------------------------------------------------- +alter table jsh_unit change ratio ratio decimal(24,3) DEFAULT NULL COMMENT '比例'; +alter table jsh_unit change ratio_two ratio_two decimal(24,3) DEFAULT NULL COMMENT '比例2'; +alter table jsh_unit change ratio_three ratio_three decimal(24,3) DEFAULT NULL COMMENT '比例3'; +alter table jsh_system_config add amount_approval_flag varchar(1) DEFAULT '0' COMMENT '金额审核启用标记,0未启用,1启用' after multi_bill_type; +alter table jsh_depot_head add source varchar(1) DEFAULT '0' COMMENT '单据来源,0-pc,1-手机' after purchase_status; +alter table jsh_account_head add source varchar(1) DEFAULT '0' COMMENT '单据来源,0-pc,1-手机' after status; + +-- -------------------------------------------------------- +-- 时间 2023年03月16日 +-- by jishenghua +-- 将系统参数表的金额审核启用标记改为强审核标记 +-- 增加零售统计菜单 +-- -------------------------------------------------------- +alter table jsh_system_config change amount_approval_flag force_approval_flag varchar(1) DEFAULT '0' COMMENT '强审核启用标记,0未启用,1启用'; +insert into `jsh_function` (`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('030105', '零售统计', '0301', '/report/retail_out_report', '/report/RetailOutReport', b'0', '0615', b'1', '电脑版', '', 'profile', '0'); + +-- -------------------------------------------------------- +-- 时间 2023年03月08日 +-- by jishenghua +-- 给系统参数表增加更新单价启用标记 +-- -------------------------------------------------------- +alter table jsh_system_config add update_unit_price_flag varchar(1) DEFAULT '1' COMMENT '更新单价启用标记,0未启用,1启用' after force_approval_flag; + +-- -------------------------------------------------------- +-- 时间 2023年05月10日 +-- by jishenghua +-- 给系统参数表增加超出关联单据启用标记 +-- -------------------------------------------------------- +alter table jsh_system_config add over_link_bill_flag varchar(1) DEFAULT '0' COMMENT '超出关联单据启用标记,0未启用,1启用' after update_unit_price_flag; + +-- -------------------------------------------------------- +-- 时间 2023年05月19日 +-- by jishenghua +-- 给商品主表增加仓位货架 +-- -------------------------------------------------------- +alter table jsh_material add position varchar(100) DEFAULT NULL COMMENT '仓位货架' after enable_batch_number; + +-- -------------------------------------------------------- +-- 时间 2023年05月28日 +-- by jishenghua +-- 给用户表增加微信绑定字段 +-- 给平台表增加微信登录的相关信息 +-- -------------------------------------------------------- +alter table jsh_user add weixin_open_id varchar(100) DEFAULT NULL COMMENT '微信绑定' after remark; +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('weixinUrl', '微信url', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('weixinAppid', '微信appid', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('weixinSecret', '微信secret', ''); + +-- -------------------------------------------------------- +-- 时间 2023年06月05日 +-- by jishenghua +-- 给平台表增加阿里云OSS的相关信息 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_endpoint', '阿里OSS-endpoint', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_accessKeyId', '阿里OSS-accessKeyId', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_accessKeySecret', '阿里OSS-accessKeySecret', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_bucketName', '阿里OSS-bucketName', ''); +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('aliOss_linkUrl', '阿里OSS-linkUrl', ''); + +-- -------------------------------------------------------- +-- 时间 2023年06月21日 +-- by jishenghua +-- 给商家表增加操作员字段,并给该字段赋默认值 +-- -------------------------------------------------------- +alter table jsh_supplier add creator bigint(20) DEFAULT NULL COMMENT '操作员' after sort; +update jsh_supplier set creator=tenant_id; + +-- -------------------------------------------------------- +-- 时间 2023年08月15日 +-- by jishenghua +-- 给平台配置表增加单据Excel地址 +-- -------------------------------------------------------- +INSERT INTO `jsh_platform_config` (`platform_key`, `platform_key_info`, `platform_value`) VALUES ('bill_excel_url', '单据Excel地址', ''); \ No newline at end of file diff --git a/domain/pom.xml b/domain/pom.xml index 2c6bc660..8c94f097 100644 --- a/domain/pom.xml +++ b/domain/pom.xml @@ -5,15 +5,15 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT domain - 21 - 21 + 17 + 17 UTF-8 diff --git a/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java b/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java new file mode 100644 index 00000000..3ea69f94 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java @@ -0,0 +1,22 @@ +package com.wansensoft.dto; + +import lombok.Data; + +/** + * 默认分页数据传输对象,针对需要进行分页查询的请求 + * 如果需要就继承该类 + */ +@Data +public class PageSizeDto { + + /** + * 查询列表总记录数 + */ + int pageTotal = 0; + + /** + * 每页显示条数,默认10 + */ + int pageSize = 10; + +} diff --git a/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java new file mode 100644 index 00000000..874cc626 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java @@ -0,0 +1,53 @@ +package com.wansensoft.dto.depot; + +import com.wansensoft.dto.PageSizeDto; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 零售出库查询数据请求Dto + */ +@Data +@Builder +@EqualsAndHashCode(callSuper = true) +public class RetailOutboundDto extends PageSizeDto { + + private String type; + + private String subType; + + private String roleType; + + private String hasDebt; + + private String status; + + private String purchaseStatus; + + private String number; + + private String linkNumber; + + private String beginTime; + + private String endTime; + + private String materialParam; + + private Long organId; + + private Long creator; + + private Long depotId; + + private Long accountId; + + private String remark; + + private int offset; + + private int rows; + + private String token; +} diff --git a/domain/src/main/java/com/wansensoft/dto/organization/DeptListDTO.java b/domain/src/main/java/com/wansensoft/dto/organization/DeptListDTO.java deleted file mode 100644 index 06fa88f3..00000000 --- a/domain/src/main/java/com/wansensoft/dto/organization/DeptListDTO.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.wansensoft.dto.organization; - -import com.wansensoft.dto.PageSizeDTO; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class DeptListDTO extends PageSizeDTO { - - private String deptName; - - private String leader; -} diff --git a/domain/src/main/java/com/wansensoft/dto/role/AddOrUpdateRoleDTO.kt b/domain/src/main/java/com/wansensoft/dto/role/AddOrUpdateRoleDTO.kt deleted file mode 100644 index 9c7182c8..00000000 --- a/domain/src/main/java/com/wansensoft/dto/role/AddOrUpdateRoleDTO.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.wansensoft.dto.role - -import com.wansensoft.dto.PageSizeDTO -import lombok.Data -import lombok.EqualsAndHashCode - -@Data -@EqualsAndHashCode(callSuper = true) -class AddOrUpdateRoleDTO : PageSizeDTO() { - - var id : Long? = null - - var roleName: String? = null - - var type: String? = null - - var priceLimit: Int? = null - - var status: Int? = null - - var description: String? = null -} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/dto/role/RoleListDTO.java b/domain/src/main/java/com/wansensoft/dto/role/RoleListDTO.java deleted file mode 100644 index 624ed26f..00000000 --- a/domain/src/main/java/com/wansensoft/dto/role/RoleListDTO.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.wansensoft.dto.role; - -import com.wansensoft.dto.PageSizeDTO; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class RoleListDTO extends PageSizeDTO { - - private String roleName; - - private Integer status; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/AccountLoginDTO.java b/domain/src/main/java/com/wansensoft/dto/user/AccountLoginDTO.java deleted file mode 100644 index 1e33ae15..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/AccountLoginDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.dto.user; - -import lombok.Data; - -@Data -public class AccountLoginDTO { - - String username; - - String password; - - String captchaId; - - String captcha; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/AccountRegisterDTO.java b/domain/src/main/java/com/wansensoft/dto/user/AccountRegisterDTO.java deleted file mode 100644 index 96a0b543..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/AccountRegisterDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.dto.user; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class AccountRegisterDTO { - - String username; - - String password; - - String phoneNumber; - - String sms; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/AddOrUpdateUserDTO.java b/domain/src/main/java/com/wansensoft/dto/user/AddOrUpdateUserDTO.java deleted file mode 100644 index 88c71e1b..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/AddOrUpdateUserDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.wansensoft.dto.user; - -import lombok.Data; - -import java.util.List; - -@Data -public class AddOrUpdateUserDTO { - - private Long id; - - private List deptId; - - private List roleId; - - private String name; - - private String username; - - private String password; - - private String phoneNumber; - - private String email; - - private String remake; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/MobileLoginDTO.java b/domain/src/main/java/com/wansensoft/dto/user/MobileLoginDTO.java deleted file mode 100644 index 8cb2e327..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/MobileLoginDTO.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.wansensoft.dto.user; - -import lombok.Data; - -@Data -public class MobileLoginDTO { - - private String phoneNumber; - - private Integer type; - - private String sms; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/UpdatePasswordDto.java b/domain/src/main/java/com/wansensoft/dto/user/UpdatePasswordDto.java deleted file mode 100644 index 258e16ab..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/UpdatePasswordDto.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.dto.user; - -import lombok.Data; - -@Data -public class UpdatePasswordDto { - - String username; - - String password; - - String phoneNumber; - - String sms; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/UpdateUserDTO.java b/domain/src/main/java/com/wansensoft/dto/user/UpdateUserDTO.java deleted file mode 100644 index 03f58d84..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/UpdateUserDTO.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.dto.user; - -import lombok.Data; - -@Data -public class UpdateUserDTO { - - private Long Id; - - private String name; - - private Integer status; - - private String email; - - private String phoneNumber; - - private String position; - - private Integer leaderFlag; -} diff --git a/domain/src/main/java/com/wansensoft/dto/user/UserListDTO.java b/domain/src/main/java/com/wansensoft/dto/user/UserListDTO.java deleted file mode 100644 index 9f63f027..00000000 --- a/domain/src/main/java/com/wansensoft/dto/user/UserListDTO.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.wansensoft.dto.user; - -import com.wansensoft.dto.PageSizeDTO; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class UserListDTO extends PageSizeDTO { - - private String username; - - private String email; - - private String name; - - private String phoneNumber; - - private String deptId; -} diff --git a/domain/src/main/java/com/wansensoft/entities/financial/FinancialAccount.java b/domain/src/main/java/com/wansensoft/entities/FinancialAccount.java similarity index 72% rename from domain/src/main/java/com/wansensoft/entities/financial/FinancialAccount.java rename to domain/src/main/java/com/wansensoft/entities/FinancialAccount.java index f7729e26..6a3f92cd 100644 --- a/domain/src/main/java/com/wansensoft/entities/financial/FinancialAccount.java +++ b/domain/src/main/java/com/wansensoft/entities/FinancialAccount.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.financial; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 账户信息 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/financial/FinancialMain.java b/domain/src/main/java/com/wansensoft/entities/FinancialMain.java similarity index 77% rename from domain/src/main/java/com/wansensoft/entities/financial/FinancialMain.java rename to domain/src/main/java/com/wansensoft/entities/FinancialMain.java index 851850e0..f231256d 100644 --- a/domain/src/main/java/com/wansensoft/entities/financial/FinancialMain.java +++ b/domain/src/main/java/com/wansensoft/entities/FinancialMain.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.financial; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 财务主表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/financial/FinancialSub.java b/domain/src/main/java/com/wansensoft/entities/FinancialSub.java similarity index 73% rename from domain/src/main/java/com/wansensoft/entities/financial/FinancialSub.java rename to domain/src/main/java/com/wansensoft/entities/FinancialSub.java index dbf5004a..53f5b51a 100644 --- a/domain/src/main/java/com/wansensoft/entities/financial/FinancialSub.java +++ b/domain/src/main/java/com/wansensoft/entities/FinancialSub.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.financial; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 财务子表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java b/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java index 92f0d792..8e0f49e3 100644 --- a/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java +++ b/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; @@ -25,6 +13,9 @@ *

* 收支项目 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/Operator.java b/domain/src/main/java/com/wansensoft/entities/Operator.java index a5a7ccd2..d9f9d53e 100644 --- a/domain/src/main/java/com/wansensoft/entities/Operator.java +++ b/domain/src/main/java/com/wansensoft/entities/Operator.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; @@ -25,6 +13,9 @@ *

* 经手人表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/Product.java b/domain/src/main/java/com/wansensoft/entities/Product.java similarity index 80% rename from domain/src/main/java/com/wansensoft/entities/product/Product.java rename to domain/src/main/java/com/wansensoft/entities/Product.java index bf83646f..5104e866 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/Product.java +++ b/domain/src/main/java/com/wansensoft/entities/Product.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 产品表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductAttribute.java b/domain/src/main/java/com/wansensoft/entities/ProductAttribute.java similarity index 66% rename from domain/src/main/java/com/wansensoft/entities/product/ProductAttribute.java rename to domain/src/main/java/com/wansensoft/entities/ProductAttribute.java index a76d349d..9e12595b 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductAttribute.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductAttribute.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 产品属性表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductCategory.java b/domain/src/main/java/com/wansensoft/entities/ProductCategory.java similarity index 70% rename from domain/src/main/java/com/wansensoft/entities/product/ProductCategory.java rename to domain/src/main/java/com/wansensoft/entities/ProductCategory.java index 79459dab..6b6039db 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductCategory.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductCategory.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 产品类型表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductExtendPrice.java b/domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java similarity index 74% rename from domain/src/main/java/com/wansensoft/entities/product/ProductExtendPrice.java rename to domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java index b215449e..9307c3bd 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductExtendPrice.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 产品价格扩展 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductExtendProperty.java b/domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java similarity index 68% rename from domain/src/main/java/com/wansensoft/entities/product/ProductExtendProperty.java rename to domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java index 5016888e..03ef28bd 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductExtendProperty.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 产品扩展字段表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductInventoryCurrent.java b/domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java similarity index 68% rename from domain/src/main/java/com/wansensoft/entities/product/ProductInventoryCurrent.java rename to domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java index a795e26d..901ead9d 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductInventoryCurrent.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 产品当前库存 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductInventoryInitial.java b/domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java similarity index 71% rename from domain/src/main/java/com/wansensoft/entities/product/ProductInventoryInitial.java rename to domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java index 8bd8bf10..96aaa255 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductInventoryInitial.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 产品初始库存 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/product/ProductUnit.java b/domain/src/main/java/com/wansensoft/entities/ProductUnit.java similarity index 73% rename from domain/src/main/java/com/wansensoft/entities/product/ProductUnit.java rename to domain/src/main/java/com/wansensoft/entities/ProductUnit.java index 3a4966f6..1a2894bb 100644 --- a/domain/src/main/java/com/wansensoft/entities/product/ProductUnit.java +++ b/domain/src/main/java/com/wansensoft/entities/ProductUnit.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.product; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 多单位表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/Sequence.java b/domain/src/main/java/com/wansensoft/entities/Sequence.java new file mode 100644 index 00000000..2a7f6761 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/Sequence.java @@ -0,0 +1,19 @@ +package com.wansensoft.entities; + +import lombok.Data; + +@Data +public class Sequence { + + private String seqName; + + private Long minValue; + + private Long maxValue; + + private Long currentValue; + + private Integer incrementVal; + + private String remark; +} diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysConfig.java b/domain/src/main/java/com/wansensoft/entities/SysConfig.java similarity index 78% rename from domain/src/main/java/com/wansensoft/entities/system/SysConfig.java rename to domain/src/main/java/com/wansensoft/entities/SysConfig.java index 4adf20e6..e11245ef 100644 --- a/domain/src/main/java/com/wansensoft/entities/system/SysConfig.java +++ b/domain/src/main/java/com/wansensoft/entities/SysConfig.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -24,6 +12,9 @@ *

* 系统参数 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysLog.java b/domain/src/main/java/com/wansensoft/entities/SysLog.java similarity index 66% rename from domain/src/main/java/com/wansensoft/entities/system/SysLog.java rename to domain/src/main/java/com/wansensoft/entities/SysLog.java index 281f6f7e..38b3cf49 100644 --- a/domain/src/main/java/com/wansensoft/entities/system/SysLog.java +++ b/domain/src/main/java/com/wansensoft/entities/SysLog.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 操作日志 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/SysMenu.java b/domain/src/main/java/com/wansensoft/entities/SysMenu.java new file mode 100644 index 00000000..43d637f5 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysMenu.java @@ -0,0 +1,115 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 功能模块表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_menu") +public class SysMenu implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 编号 + */ + private String number; + + /** + * 名称 + */ + private String name; + + /** + * 上级编号 + */ + private String parentNumber; + + /** + * 链接 + */ + private String url; + + /** + * 组件 + */ + private String component; + + /** + * 收缩 + */ + private Boolean shrink; + + /** + * 排序 + */ + private String sort; + + /** + * 状态(0-启用,1-停用) + */ + private Boolean status; + + /** + * 类型 + */ + private String type; + + /** + * 功能按钮 + */ + private String functionButton; + + /** + * 图标 + */ + private String icon; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysMsg.java b/domain/src/main/java/com/wansensoft/entities/SysMsg.java similarity index 66% rename from domain/src/main/java/com/wansensoft/entities/system/SysMsg.java rename to domain/src/main/java/com/wansensoft/entities/SysMsg.java index a809905c..33b7d21a 100644 --- a/domain/src/main/java/com/wansensoft/entities/system/SysMsg.java +++ b/domain/src/main/java/com/wansensoft/entities/SysMsg.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 消息表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/SysDepartment.java b/domain/src/main/java/com/wansensoft/entities/SysOrganization.java similarity index 58% rename from domain/src/main/java/com/wansensoft/entities/SysDepartment.java rename to domain/src/main/java/com/wansensoft/entities/SysOrganization.java index fa52e5da..71146aa6 100644 --- a/domain/src/main/java/com/wansensoft/entities/SysDepartment.java +++ b/domain/src/main/java/com/wansensoft/entities/SysOrganization.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; @@ -25,12 +13,15 @@ *

* 机构表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@TableName("sys_department") -public class SysDepartment implements Serializable { +@TableName("sys_organization") +public class SysOrganization implements Serializable { private static final long serialVersionUID = 1L; @@ -46,24 +37,19 @@ public class SysDepartment implements Serializable { private Long tenantId; /** - * 父级部门id + * 父机构id */ private Long parentId; /** - * 部门编号 - */ - private String number; - - /** - * 部门简称 + * 机构编号 */ - private String name; + private String organizationNumber; /** - * 部门负责人 + * 机构简称 */ - private String leader; + private String organizationName; /** * 备注 @@ -71,7 +57,7 @@ public class SysDepartment implements Serializable { private String remark; /** - * 部门显示顺序 + * 机构显示顺序 */ private String sort; diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysPlatformConfig.java b/domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java similarity index 64% rename from domain/src/main/java/com/wansensoft/entities/system/SysPlatformConfig.java rename to domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java index 9ba02461..1b7a61d3 100644 --- a/domain/src/main/java/com/wansensoft/entities/system/SysPlatformConfig.java +++ b/domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 平台参数 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/role/SysRole.java b/domain/src/main/java/com/wansensoft/entities/SysRole.java similarity index 61% rename from domain/src/main/java/com/wansensoft/entities/role/SysRole.java rename to domain/src/main/java/com/wansensoft/entities/SysRole.java index 50c4ee03..a7809a9c 100644 --- a/domain/src/main/java/com/wansensoft/entities/role/SysRole.java +++ b/domain/src/main/java/com/wansensoft/entities/SysRole.java @@ -1,26 +1,10 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.role; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; - -import java.io.Serial; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; - -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -29,15 +13,16 @@ *

* 角色表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_role") - public class SysRole implements Serializable { - @Serial private static final long serialVersionUID = 1L; /** @@ -49,7 +34,7 @@ public class SysRole implements Serializable { /** * 名称 */ - private String roleName; + private String name; /** * 类型 @@ -59,7 +44,7 @@ public class SysRole implements Serializable { /** * 价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价 */ - private Integer priceLimit; + private String priceLimit; /** * 描述 @@ -69,7 +54,7 @@ public class SysRole implements Serializable { /** * 状态(0-启用,1-停用) */ - private Integer status; + private Boolean status; /** * 创建时间 @@ -94,7 +79,7 @@ public class SysRole implements Serializable { /** * 删除标记,0未删除,1删除 */ - private Integer deleteFlag; + private Boolean deleteFlag; } diff --git a/domain/src/main/java/com/wansensoft/entities/role/SysRoleMenuRel.java b/domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java similarity index 61% rename from domain/src/main/java/com/wansensoft/entities/role/SysRoleMenuRel.java rename to domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java index c379d06e..93ac592e 100644 --- a/domain/src/main/java/com/wansensoft/entities/role/SysRoleMenuRel.java +++ b/domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.role; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 角色菜单关系表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) @@ -51,9 +42,9 @@ public class SysRoleMenuRel implements Serializable { private Long roleId; /** - * 菜单资源id 多个菜单ID合并到字符串 + * 菜单资源id */ - private String menuId; + private Long menuId; /** * 创建时间 diff --git a/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java b/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java index ad64de93..83857549 100644 --- a/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java +++ b/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; @@ -25,6 +13,9 @@ *

* 序列号表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/tenant/SysTenant.java b/domain/src/main/java/com/wansensoft/entities/SysTenant.java similarity index 68% rename from domain/src/main/java/com/wansensoft/entities/tenant/SysTenant.java rename to domain/src/main/java/com/wansensoft/entities/SysTenant.java index 919a9531..1e6e2312 100644 --- a/domain/src/main/java/com/wansensoft/entities/tenant/SysTenant.java +++ b/domain/src/main/java/com/wansensoft/entities/SysTenant.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.tenant; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* 租户 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/tenant/SysTenantUser.java b/domain/src/main/java/com/wansensoft/entities/SysTenantUser.java similarity index 70% rename from domain/src/main/java/com/wansensoft/entities/tenant/SysTenantUser.java rename to domain/src/main/java/com/wansensoft/entities/SysTenantUser.java index 6561588b..56567ba2 100644 --- a/domain/src/main/java/com/wansensoft/entities/tenant/SysTenantUser.java +++ b/domain/src/main/java/com/wansensoft/entities/SysTenantUser.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.tenant; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -25,6 +13,9 @@ *

* *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/user/SysUser.java b/domain/src/main/java/com/wansensoft/entities/SysUser.java similarity index 53% rename from domain/src/main/java/com/wansensoft/entities/user/SysUser.java rename to domain/src/main/java/com/wansensoft/entities/SysUser.java index ce42df6e..481597d2 100644 --- a/domain/src/main/java/com/wansensoft/entities/user/SysUser.java +++ b/domain/src/main/java/com/wansensoft/entities/SysUser.java @@ -1,25 +1,9 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.user; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; -import java.time.LocalDateTime; - -import jxl.write.DateTime; -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -28,10 +12,12 @@ *

* 用户表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) -@Builder @Accessors(chain = true) @TableName("sys_user") public class SysUser implements Serializable { @@ -47,17 +33,12 @@ public class SysUser implements Serializable { /** * 用户姓名--例如张三 */ - private String name; + private String username; /** * 登录用户名 */ - private String userName; - - /** - * - */ - private String avatar; + private String loginName; /** * 登陆密码 @@ -74,6 +55,11 @@ public class SysUser implements Serializable { */ private String position; + /** + * 所属部门 + */ + private String department; + /** * 电子邮箱 */ @@ -82,17 +68,17 @@ public class SysUser implements Serializable { /** * 手机号码 */ - private String phoneNumber; + private String phonenum; /** * 是否为管理者 0==管理者 1==员工 */ - private Integer isManager; + private Integer ismanager; /** * 是否系统自带数据 */ - private Integer isSystem; + private Integer isystem; /** * 状态,0:正常,1:删除,2封禁 @@ -112,35 +98,12 @@ public class SysUser implements Serializable { /** * 微信绑定 */ - private String wechatOpenId; + private String weixinOpenId; /** * 租户id */ private Long tenantId; - /** - * 创建时间 - */ - private LocalDateTime createTime; - - /** - * 更新时间 - */ - private LocalDateTime updateTime; - - /** - * 创建人 - */ - private Long createBy; - - /** - * 修改人 - */ - private Long updateBy; - /** - * 删除标记,0未删除,1删除 - */ - private Integer deleteFlag; } diff --git a/domain/src/main/java/com/wansensoft/entities/user/SysUserBusiness.java b/domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java similarity index 62% rename from domain/src/main/java/com/wansensoft/entities/user/SysUserBusiness.java rename to domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java index 84f2e364..9011b791 100644 --- a/domain/src/main/java/com/wansensoft/entities/user/SysUserBusiness.java +++ b/domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.user; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -24,6 +12,9 @@ *

* 用户/角色/模块关系表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/user/SysUserDeptRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java similarity index 55% rename from domain/src/main/java/com/wansensoft/entities/user/SysUserDeptRel.java rename to domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java index 9d6b314d..28f9e3c7 100644 --- a/domain/src/main/java/com/wansensoft/entities/user/SysUserDeptRel.java +++ b/domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java @@ -1,39 +1,27 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.user; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import java.io.Serializable; - -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** *

- * 用户部门关系表 + * 机构用户关系表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@TableName("sys_user_dept_rel") -@Builder -public class SysUserDeptRel implements Serializable { +@TableName("sys_user_org_rel") +public class SysUserOrgRel implements Serializable { private static final long serialVersionUID = 1L; @@ -49,9 +37,9 @@ public class SysUserDeptRel implements Serializable { private Long tenantId; /** - * 部门id + * 机构id */ - private Long deptId; + private Long organizationId; /** * 用户id @@ -59,9 +47,9 @@ public class SysUserDeptRel implements Serializable { private Long userId; /** - * 用户在所属部门中显示顺序 + * 用户在所属机构中显示顺序 */ - private String userDeptSort; + private String userOrganizationSort; /** * 删除标记,0未删除,1删除 diff --git a/domain/src/main/java/com/wansensoft/entities/user/SysUserRoleRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java similarity index 63% rename from domain/src/main/java/com/wansensoft/entities/user/SysUserRoleRel.java rename to domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java index a79d3ce3..1991beda 100644 --- a/domain/src/main/java/com/wansensoft/entities/user/SysUserRoleRel.java +++ b/domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java @@ -1,24 +1,10 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.user; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; - -import lombok.Builder; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -27,12 +13,14 @@ *

* 用户角色关系表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("sys_user_role_rel") -@Builder public class SysUserRoleRel implements Serializable { private static final long serialVersionUID = 1L; diff --git a/domain/src/main/java/com/wansensoft/entities/user/SysUserWarehouseRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java similarity index 63% rename from domain/src/main/java/com/wansensoft/entities/user/SysUserWarehouseRel.java rename to domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java index d55735a8..259da55b 100644 --- a/domain/src/main/java/com/wansensoft/entities/user/SysUserWarehouseRel.java +++ b/domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.user; +package com.wansensoft.entities; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.IdType; @@ -23,8 +11,11 @@ /** *

- * 用户仓库关系 + * *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/system/SystemSupplier.java b/domain/src/main/java/com/wansensoft/entities/SystemSupplier.java similarity index 80% rename from domain/src/main/java/com/wansensoft/entities/system/SystemSupplier.java rename to domain/src/main/java/com/wansensoft/entities/SystemSupplier.java index 63891ad8..e6464358 100644 --- a/domain/src/main/java/com/wansensoft/entities/system/SystemSupplier.java +++ b/domain/src/main/java/com/wansensoft/entities/SystemSupplier.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 供应商/客户信息表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/warehouse/Warehouse.java b/domain/src/main/java/com/wansensoft/entities/Warehouse.java similarity index 74% rename from domain/src/main/java/com/wansensoft/entities/warehouse/Warehouse.java rename to domain/src/main/java/com/wansensoft/entities/Warehouse.java index 44b23c0b..49bdb951 100644 --- a/domain/src/main/java/com/wansensoft/entities/warehouse/Warehouse.java +++ b/domain/src/main/java/com/wansensoft/entities/Warehouse.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.warehouse; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 仓库表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseHead.java b/domain/src/main/java/com/wansensoft/entities/WarehouseHead.java similarity index 84% rename from domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseHead.java rename to domain/src/main/java/com/wansensoft/entities/WarehouseHead.java index 0d7eb671..5b40f6f6 100644 --- a/domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseHead.java +++ b/domain/src/main/java/com/wansensoft/entities/WarehouseHead.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.warehouse; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 单据主表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseItem.java b/domain/src/main/java/com/wansensoft/entities/WarehouseItem.java similarity index 81% rename from domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseItem.java rename to domain/src/main/java/com/wansensoft/entities/WarehouseItem.java index a77651f5..4769c670 100644 --- a/domain/src/main/java/com/wansensoft/entities/warehouse/WarehouseItem.java +++ b/domain/src/main/java/com/wansensoft/entities/WarehouseItem.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.warehouse; +package com.wansensoft.entities; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,6 +14,9 @@ *

* 单据子表 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Data @EqualsAndHashCode(callSuper = false) diff --git a/domain/src/main/java/com/wansensoft/entities/account/Account.java b/domain/src/main/java/com/wansensoft/entities/account/Account.java new file mode 100644 index 00000000..547d2f96 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/Account.java @@ -0,0 +1,30 @@ +package com.wansensoft.entities.account; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Account { + private Long id; + + private String name; + + private String serialNo; + + private BigDecimal initialAmount; + + private BigDecimal currentAmount; + + private String remark; + + private Boolean enabled; + + private String sort; + + private Boolean isDefault; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountExample.java b/domain/src/main/java/com/wansensoft/entities/account/AccountExample.java new file mode 100644 index 00000000..92eb315d --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountExample.java @@ -0,0 +1,910 @@ +package com.wansensoft.entities.account; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class AccountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNull() { + addCriterion("serial_no is null"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNotNull() { + addCriterion("serial_no is not null"); + return (Criteria) this; + } + + public Criteria andSerialNoEqualTo(String value) { + addCriterion("serial_no =", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotEqualTo(String value) { + addCriterion("serial_no <>", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThan(String value) { + addCriterion("serial_no >", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThanOrEqualTo(String value) { + addCriterion("serial_no >=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThan(String value) { + addCriterion("serial_no <", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThanOrEqualTo(String value) { + addCriterion("serial_no <=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLike(String value) { + addCriterion("serial_no like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotLike(String value) { + addCriterion("serial_no not like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoIn(List values) { + addCriterion("serial_no in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotIn(List values) { + addCriterion("serial_no not in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoBetween(String value1, String value2) { + addCriterion("serial_no between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotBetween(String value1, String value2) { + addCriterion("serial_no not between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andInitialAmountIsNull() { + addCriterion("initial_amount is null"); + return (Criteria) this; + } + + public Criteria andInitialAmountIsNotNull() { + addCriterion("initial_amount is not null"); + return (Criteria) this; + } + + public Criteria andInitialAmountEqualTo(BigDecimal value) { + addCriterion("initial_amount =", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotEqualTo(BigDecimal value) { + addCriterion("initial_amount <>", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountGreaterThan(BigDecimal value) { + addCriterion("initial_amount >", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("initial_amount >=", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountLessThan(BigDecimal value) { + addCriterion("initial_amount <", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("initial_amount <=", value, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountIn(List values) { + addCriterion("initial_amount in", values, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotIn(List values) { + addCriterion("initial_amount not in", values, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("initial_amount between", value1, value2, "initialAmount"); + return (Criteria) this; + } + + public Criteria andInitialAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("initial_amount not between", value1, value2, "initialAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIsNull() { + addCriterion("current_amount is null"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIsNotNull() { + addCriterion("current_amount is not null"); + return (Criteria) this; + } + + public Criteria andCurrentAmountEqualTo(BigDecimal value) { + addCriterion("current_amount =", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotEqualTo(BigDecimal value) { + addCriterion("current_amount <>", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountGreaterThan(BigDecimal value) { + addCriterion("current_amount >", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("current_amount >=", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountLessThan(BigDecimal value) { + addCriterion("current_amount <", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("current_amount <=", value, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountIn(List values) { + addCriterion("current_amount in", values, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotIn(List values) { + addCriterion("current_amount not in", values, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_amount between", value1, value2, "currentAmount"); + return (Criteria) this; + } + + public Criteria andCurrentAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_amount not between", value1, value2, "currentAmount"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNull() { + addCriterion("is_default is null"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNotNull() { + addCriterion("is_default is not null"); + return (Criteria) this; + } + + public Criteria andIsDefaultEqualTo(Boolean value) { + addCriterion("is_default =", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotEqualTo(Boolean value) { + addCriterion("is_default <>", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThan(Boolean value) { + addCriterion("is_default >", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_default >=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThan(Boolean value) { + addCriterion("is_default <", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThanOrEqualTo(Boolean value) { + addCriterion("is_default <=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultIn(List values) { + addCriterion("is_default in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotIn(List values) { + addCriterion("is_default not in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultBetween(Boolean value1, Boolean value2) { + addCriterion("is_default between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_default not between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountHead.java b/domain/src/main/java/com/wansensoft/entities/account/AccountHead.java new file mode 100644 index 00000000..f5d4225e --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountHead.java @@ -0,0 +1,43 @@ +package com.wansensoft.entities.account; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AccountHead { + private Long id; + + private String type; + + private Long organId; + + private Long handsPersonId; + + private Long creator; + + private BigDecimal changeAmount; + + private BigDecimal discountMoney; + + private BigDecimal totalPrice; + + private Long accountId; + + private String billNo; + + private Date billTime; + + private String remark; + + private String fileName; + + private String status; + + private String source; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountHeadExample.java b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadExample.java new file mode 100644 index 00000000..4a934838 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadExample.java @@ -0,0 +1,1291 @@ +package com.wansensoft.entities.account; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class AccountHeadExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountHeadExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNull() { + addCriterion("organ_id is null"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNotNull() { + addCriterion("organ_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganIdEqualTo(Long value) { + addCriterion("organ_id =", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotEqualTo(Long value) { + addCriterion("organ_id <>", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThan(Long value) { + addCriterion("organ_id >", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThanOrEqualTo(Long value) { + addCriterion("organ_id >=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThan(Long value) { + addCriterion("organ_id <", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThanOrEqualTo(Long value) { + addCriterion("organ_id <=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdIn(List values) { + addCriterion("organ_id in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotIn(List values) { + addCriterion("organ_id not in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdBetween(Long value1, Long value2) { + addCriterion("organ_id between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotBetween(Long value1, Long value2) { + addCriterion("organ_id not between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIsNull() { + addCriterion("hands_person_id is null"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIsNotNull() { + addCriterion("hands_person_id is not null"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdEqualTo(Long value) { + addCriterion("hands_person_id =", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotEqualTo(Long value) { + addCriterion("hands_person_id <>", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdGreaterThan(Long value) { + addCriterion("hands_person_id >", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdGreaterThanOrEqualTo(Long value) { + addCriterion("hands_person_id >=", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdLessThan(Long value) { + addCriterion("hands_person_id <", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdLessThanOrEqualTo(Long value) { + addCriterion("hands_person_id <=", value, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdIn(List values) { + addCriterion("hands_person_id in", values, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotIn(List values) { + addCriterion("hands_person_id not in", values, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdBetween(Long value1, Long value2) { + addCriterion("hands_person_id between", value1, value2, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andHandsPersonIdNotBetween(Long value1, Long value2) { + addCriterion("hands_person_id not between", value1, value2, "handsPersonId"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNull() { + addCriterion("change_amount is null"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNotNull() { + addCriterion("change_amount is not null"); + return (Criteria) this; + } + + public Criteria andChangeAmountEqualTo(BigDecimal value) { + addCriterion("change_amount =", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotEqualTo(BigDecimal value) { + addCriterion("change_amount <>", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThan(BigDecimal value) { + addCriterion("change_amount >", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount >=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThan(BigDecimal value) { + addCriterion("change_amount <", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount <=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountIn(List values) { + addCriterion("change_amount in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotIn(List values) { + addCriterion("change_amount not in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount not between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNull() { + addCriterion("discount_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNotNull() { + addCriterion("discount_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyEqualTo(BigDecimal value) { + addCriterion("discount_money =", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_money <>", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_money >", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money >=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThan(BigDecimal value) { + addCriterion("discount_money <", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money <=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIn(List values) { + addCriterion("discount_money in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotIn(List values) { + addCriterion("discount_money not in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money not between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNull() { + addCriterion("total_price is null"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNotNull() { + addCriterion("total_price is not null"); + return (Criteria) this; + } + + public Criteria andTotalPriceEqualTo(BigDecimal value) { + addCriterion("total_price =", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotEqualTo(BigDecimal value) { + addCriterion("total_price <>", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThan(BigDecimal value) { + addCriterion("total_price >", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_price >=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThan(BigDecimal value) { + addCriterion("total_price <", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_price <=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceIn(List values) { + addCriterion("total_price in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotIn(List values) { + addCriterion("total_price not in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price not between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andBillNoIsNull() { + addCriterion("bill_no is null"); + return (Criteria) this; + } + + public Criteria andBillNoIsNotNull() { + addCriterion("bill_no is not null"); + return (Criteria) this; + } + + public Criteria andBillNoEqualTo(String value) { + addCriterion("bill_no =", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotEqualTo(String value) { + addCriterion("bill_no <>", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoGreaterThan(String value) { + addCriterion("bill_no >", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoGreaterThanOrEqualTo(String value) { + addCriterion("bill_no >=", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLessThan(String value) { + addCriterion("bill_no <", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLessThanOrEqualTo(String value) { + addCriterion("bill_no <=", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoLike(String value) { + addCriterion("bill_no like", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotLike(String value) { + addCriterion("bill_no not like", value, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoIn(List values) { + addCriterion("bill_no in", values, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotIn(List values) { + addCriterion("bill_no not in", values, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoBetween(String value1, String value2) { + addCriterion("bill_no between", value1, value2, "billNo"); + return (Criteria) this; + } + + public Criteria andBillNoNotBetween(String value1, String value2) { + addCriterion("bill_no not between", value1, value2, "billNo"); + return (Criteria) this; + } + + public Criteria andBillTimeIsNull() { + addCriterion("bill_time is null"); + return (Criteria) this; + } + + public Criteria andBillTimeIsNotNull() { + addCriterion("bill_time is not null"); + return (Criteria) this; + } + + public Criteria andBillTimeEqualTo(Date value) { + addCriterion("bill_time =", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotEqualTo(Date value) { + addCriterion("bill_time <>", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeGreaterThan(Date value) { + addCriterion("bill_time >", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeGreaterThanOrEqualTo(Date value) { + addCriterion("bill_time >=", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeLessThan(Date value) { + addCriterion("bill_time <", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeLessThanOrEqualTo(Date value) { + addCriterion("bill_time <=", value, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeIn(List values) { + addCriterion("bill_time in", values, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotIn(List values) { + addCriterion("bill_time not in", values, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeBetween(Date value1, Date value2) { + addCriterion("bill_time between", value1, value2, "billTime"); + return (Criteria) this; + } + + public Criteria andBillTimeNotBetween(Date value1, Date value2) { + addCriterion("bill_time not between", value1, value2, "billTime"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("source is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("source is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(String value) { + addCriterion("source =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(String value) { + addCriterion("source <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(String value) { + addCriterion("source >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(String value) { + addCriterion("source >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(String value) { + addCriterion("source <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(String value) { + addCriterion("source <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLike(String value) { + addCriterion("source like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotLike(String value) { + addCriterion("source not like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("source in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("source not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(String value1, String value2) { + addCriterion("source between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(String value1, String value2) { + addCriterion("source not between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4Body.java b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4Body.java new file mode 100644 index 00000000..91757fe9 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4Body.java @@ -0,0 +1,13 @@ +package com.wansensoft.entities.account; + +import lombok.Data; + +@Data +public class AccountHeadVo4Body { + + private Long id; + + private String info; + + private String rows; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4ListEx.java b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4ListEx.java new file mode 100644 index 00000000..ce0caa98 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountHeadVo4ListEx.java @@ -0,0 +1,17 @@ +package com.wansensoft.entities.account; + +import lombok.Data; + +@Data +public class AccountHeadVo4ListEx extends AccountHead{ + + private String organName; + + private String handsPersonName; + + private String userName; + + private String accountName; + + private String billTimeStr; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountItem.java b/domain/src/main/java/com/wansensoft/entities/account/AccountItem.java new file mode 100644 index 00000000..50932959 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountItem.java @@ -0,0 +1,30 @@ +package com.wansensoft.entities.account; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class AccountItem { + private Long id; + + private Long headerId; + + private Long accountId; + + private Long inOutItemId; + + private Long billId; + + private BigDecimal needDebt; + + private BigDecimal finishDebt; + + private BigDecimal eachAmount; + + private String remark; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/account/AccountItemExample.java b/domain/src/main/java/com/wansensoft/entities/account/AccountItemExample.java new file mode 100644 index 00000000..ca7f78bf --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/account/AccountItemExample.java @@ -0,0 +1,880 @@ +package com.wansensoft.entities.account; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class AccountItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public AccountItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNull() { + addCriterion("header_id is null"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNotNull() { + addCriterion("header_id is not null"); + return (Criteria) this; + } + + public Criteria andHeaderIdEqualTo(Long value) { + addCriterion("header_id =", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotEqualTo(Long value) { + addCriterion("header_id <>", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThan(Long value) { + addCriterion("header_id >", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThanOrEqualTo(Long value) { + addCriterion("header_id >=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThan(Long value) { + addCriterion("header_id <", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThanOrEqualTo(Long value) { + addCriterion("header_id <=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdIn(List values) { + addCriterion("header_id in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotIn(List values) { + addCriterion("header_id not in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdBetween(Long value1, Long value2) { + addCriterion("header_id between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotBetween(Long value1, Long value2) { + addCriterion("header_id not between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIsNull() { + addCriterion("in_out_item_id is null"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIsNotNull() { + addCriterion("in_out_item_id is not null"); + return (Criteria) this; + } + + public Criteria andInOutItemIdEqualTo(Long value) { + addCriterion("in_out_item_id =", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotEqualTo(Long value) { + addCriterion("in_out_item_id <>", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdGreaterThan(Long value) { + addCriterion("in_out_item_id >", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdGreaterThanOrEqualTo(Long value) { + addCriterion("in_out_item_id >=", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdLessThan(Long value) { + addCriterion("in_out_item_id <", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdLessThanOrEqualTo(Long value) { + addCriterion("in_out_item_id <=", value, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdIn(List values) { + addCriterion("in_out_item_id in", values, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotIn(List values) { + addCriterion("in_out_item_id not in", values, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdBetween(Long value1, Long value2) { + addCriterion("in_out_item_id between", value1, value2, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andInOutItemIdNotBetween(Long value1, Long value2) { + addCriterion("in_out_item_id not between", value1, value2, "inOutItemId"); + return (Criteria) this; + } + + public Criteria andBillIdIsNull() { + addCriterion("bill_id is null"); + return (Criteria) this; + } + + public Criteria andBillIdIsNotNull() { + addCriterion("bill_id is not null"); + return (Criteria) this; + } + + public Criteria andBillIdEqualTo(Long value) { + addCriterion("bill_id =", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotEqualTo(Long value) { + addCriterion("bill_id <>", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThan(Long value) { + addCriterion("bill_id >", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdGreaterThanOrEqualTo(Long value) { + addCriterion("bill_id >=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThan(Long value) { + addCriterion("bill_id <", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdLessThanOrEqualTo(Long value) { + addCriterion("bill_id <=", value, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdIn(List values) { + addCriterion("bill_id in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotIn(List values) { + addCriterion("bill_id not in", values, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdBetween(Long value1, Long value2) { + addCriterion("bill_id between", value1, value2, "billId"); + return (Criteria) this; + } + + public Criteria andBillIdNotBetween(Long value1, Long value2) { + addCriterion("bill_id not between", value1, value2, "billId"); + return (Criteria) this; + } + + public Criteria andNeedDebtIsNull() { + addCriterion("need_debt is null"); + return (Criteria) this; + } + + public Criteria andNeedDebtIsNotNull() { + addCriterion("need_debt is not null"); + return (Criteria) this; + } + + public Criteria andNeedDebtEqualTo(BigDecimal value) { + addCriterion("need_debt =", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotEqualTo(BigDecimal value) { + addCriterion("need_debt <>", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtGreaterThan(BigDecimal value) { + addCriterion("need_debt >", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("need_debt >=", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtLessThan(BigDecimal value) { + addCriterion("need_debt <", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtLessThanOrEqualTo(BigDecimal value) { + addCriterion("need_debt <=", value, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtIn(List values) { + addCriterion("need_debt in", values, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotIn(List values) { + addCriterion("need_debt not in", values, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("need_debt between", value1, value2, "needDebt"); + return (Criteria) this; + } + + public Criteria andNeedDebtNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("need_debt not between", value1, value2, "needDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtIsNull() { + addCriterion("finish_debt is null"); + return (Criteria) this; + } + + public Criteria andFinishDebtIsNotNull() { + addCriterion("finish_debt is not null"); + return (Criteria) this; + } + + public Criteria andFinishDebtEqualTo(BigDecimal value) { + addCriterion("finish_debt =", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotEqualTo(BigDecimal value) { + addCriterion("finish_debt <>", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtGreaterThan(BigDecimal value) { + addCriterion("finish_debt >", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("finish_debt >=", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtLessThan(BigDecimal value) { + addCriterion("finish_debt <", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtLessThanOrEqualTo(BigDecimal value) { + addCriterion("finish_debt <=", value, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtIn(List values) { + addCriterion("finish_debt in", values, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotIn(List values) { + addCriterion("finish_debt not in", values, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("finish_debt between", value1, value2, "finishDebt"); + return (Criteria) this; + } + + public Criteria andFinishDebtNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("finish_debt not between", value1, value2, "finishDebt"); + return (Criteria) this; + } + + public Criteria andEachAmountIsNull() { + addCriterion("each_amount is null"); + return (Criteria) this; + } + + public Criteria andEachAmountIsNotNull() { + addCriterion("each_amount is not null"); + return (Criteria) this; + } + + public Criteria andEachAmountEqualTo(BigDecimal value) { + addCriterion("each_amount =", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotEqualTo(BigDecimal value) { + addCriterion("each_amount <>", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountGreaterThan(BigDecimal value) { + addCriterion("each_amount >", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("each_amount >=", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountLessThan(BigDecimal value) { + addCriterion("each_amount <", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("each_amount <=", value, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountIn(List values) { + addCriterion("each_amount in", values, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotIn(List values) { + addCriterion("each_amount not in", values, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("each_amount between", value1, value2, "eachAmount"); + return (Criteria) this; + } + + public Criteria andEachAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("each_amount not between", value1, value2, "eachAmount"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/Depot.java b/domain/src/main/java/com/wansensoft/entities/depot/Depot.java new file mode 100644 index 00000000..2bc11438 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/Depot.java @@ -0,0 +1,34 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Depot { + private Long id; + + private String name; + + private String address; + + private BigDecimal warehousing; + + private BigDecimal truckage; + + private Integer type; + + private String sort; + + private String remark; + + private Long principal; + + private Boolean enabled; + + private Long tenantId; + + private String deleteFlag; + + private Boolean isDefault; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotEx.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotEx.java new file mode 100644 index 00000000..1558a682 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotEx.java @@ -0,0 +1,23 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * Description + */ +@Data +public class DepotEx extends Depot{ + //负责人名字 + private String principalName; + + private BigDecimal initStock; + + private BigDecimal currentStock; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + +} diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotExample.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotExample.java new file mode 100644 index 00000000..8d8ade29 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotExample.java @@ -0,0 +1,1030 @@ +package com.wansensoft.entities.depot; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class DepotExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DepotExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andWarehousingIsNull() { + addCriterion("warehousing is null"); + return (Criteria) this; + } + + public Criteria andWarehousingIsNotNull() { + addCriterion("warehousing is not null"); + return (Criteria) this; + } + + public Criteria andWarehousingEqualTo(BigDecimal value) { + addCriterion("warehousing =", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotEqualTo(BigDecimal value) { + addCriterion("warehousing <>", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingGreaterThan(BigDecimal value) { + addCriterion("warehousing >", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("warehousing >=", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingLessThan(BigDecimal value) { + addCriterion("warehousing <", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingLessThanOrEqualTo(BigDecimal value) { + addCriterion("warehousing <=", value, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingIn(List values) { + addCriterion("warehousing in", values, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotIn(List values) { + addCriterion("warehousing not in", values, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("warehousing between", value1, value2, "warehousing"); + return (Criteria) this; + } + + public Criteria andWarehousingNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("warehousing not between", value1, value2, "warehousing"); + return (Criteria) this; + } + + public Criteria andTruckageIsNull() { + addCriterion("truckage is null"); + return (Criteria) this; + } + + public Criteria andTruckageIsNotNull() { + addCriterion("truckage is not null"); + return (Criteria) this; + } + + public Criteria andTruckageEqualTo(BigDecimal value) { + addCriterion("truckage =", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotEqualTo(BigDecimal value) { + addCriterion("truckage <>", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageGreaterThan(BigDecimal value) { + addCriterion("truckage >", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("truckage >=", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageLessThan(BigDecimal value) { + addCriterion("truckage <", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageLessThanOrEqualTo(BigDecimal value) { + addCriterion("truckage <=", value, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageIn(List values) { + addCriterion("truckage in", values, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotIn(List values) { + addCriterion("truckage not in", values, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("truckage between", value1, value2, "truckage"); + return (Criteria) this; + } + + public Criteria andTruckageNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("truckage not between", value1, value2, "truckage"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNull() { + addCriterion("principal is null"); + return (Criteria) this; + } + + public Criteria andPrincipalIsNotNull() { + addCriterion("principal is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalEqualTo(Long value) { + addCriterion("principal =", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotEqualTo(Long value) { + addCriterion("principal <>", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThan(Long value) { + addCriterion("principal >", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalGreaterThanOrEqualTo(Long value) { + addCriterion("principal >=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThan(Long value) { + addCriterion("principal <", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalLessThanOrEqualTo(Long value) { + addCriterion("principal <=", value, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalIn(List values) { + addCriterion("principal in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotIn(List values) { + addCriterion("principal not in", values, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalBetween(Long value1, Long value2) { + addCriterion("principal between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andPrincipalNotBetween(Long value1, Long value2) { + addCriterion("principal not between", value1, value2, "principal"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNull() { + addCriterion("is_default is null"); + return (Criteria) this; + } + + public Criteria andIsDefaultIsNotNull() { + addCriterion("is_default is not null"); + return (Criteria) this; + } + + public Criteria andIsDefaultEqualTo(Boolean value) { + addCriterion("is_default =", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotEqualTo(Boolean value) { + addCriterion("is_default <>", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThan(Boolean value) { + addCriterion("is_default >", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultGreaterThanOrEqualTo(Boolean value) { + addCriterion("is_default >=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThan(Boolean value) { + addCriterion("is_default <", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultLessThanOrEqualTo(Boolean value) { + addCriterion("is_default <=", value, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultIn(List values) { + addCriterion("is_default in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotIn(List values) { + addCriterion("is_default not in", values, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultBetween(Boolean value1, Boolean value2) { + addCriterion("is_default between", value1, value2, "isDefault"); + return (Criteria) this; + } + + public Criteria andIsDefaultNotBetween(Boolean value1, Boolean value2) { + addCriterion("is_default not between", value1, value2, "isDefault"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotHead.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotHead.java new file mode 100644 index 00000000..dc759266 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotHead.java @@ -0,0 +1,71 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotHead { + private Long id; + + private String type; + + private String subType; + + private String defaultNumber; + + private String number; + + private Date createTime; + + private Date operTime; + + private Long organId; + + private Long creator; + + private Long accountId; + + private BigDecimal changeAmount; + + private BigDecimal backAmount; + + private BigDecimal totalPrice; + + private String payType; + + private String billType; + + private String remark; + + private String fileName; + + private String salesMan; + + private String accountIdList; + + private String accountMoneyList; + + private BigDecimal discount; + + private BigDecimal discountMoney; + + private BigDecimal discountLastMoney; + + private BigDecimal otherMoney; + + private BigDecimal deposit; + + private String status; + + private String purchaseStatus; + + private String source; + + private String linkNumber; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadExample.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadExample.java new file mode 100644 index 00000000..2f38672a --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadExample.java @@ -0,0 +1,2221 @@ +package com.wansensoft.entities.depot; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class DepotHeadExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DepotHeadExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSubTypeIsNull() { + addCriterion("sub_type is null"); + return (Criteria) this; + } + + public Criteria andSubTypeIsNotNull() { + addCriterion("sub_type is not null"); + return (Criteria) this; + } + + public Criteria andSubTypeEqualTo(String value) { + addCriterion("sub_type =", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotEqualTo(String value) { + addCriterion("sub_type <>", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeGreaterThan(String value) { + addCriterion("sub_type >", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeGreaterThanOrEqualTo(String value) { + addCriterion("sub_type >=", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLessThan(String value) { + addCriterion("sub_type <", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLessThanOrEqualTo(String value) { + addCriterion("sub_type <=", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeLike(String value) { + addCriterion("sub_type like", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotLike(String value) { + addCriterion("sub_type not like", value, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeIn(List values) { + addCriterion("sub_type in", values, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotIn(List values) { + addCriterion("sub_type not in", values, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeBetween(String value1, String value2) { + addCriterion("sub_type between", value1, value2, "subType"); + return (Criteria) this; + } + + public Criteria andSubTypeNotBetween(String value1, String value2) { + addCriterion("sub_type not between", value1, value2, "subType"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIsNull() { + addCriterion("default_number is null"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIsNotNull() { + addCriterion("default_number is not null"); + return (Criteria) this; + } + + public Criteria andDefaultNumberEqualTo(String value) { + addCriterion("default_number =", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotEqualTo(String value) { + addCriterion("default_number <>", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberGreaterThan(String value) { + addCriterion("default_number >", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberGreaterThanOrEqualTo(String value) { + addCriterion("default_number >=", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLessThan(String value) { + addCriterion("default_number <", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLessThanOrEqualTo(String value) { + addCriterion("default_number <=", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberLike(String value) { + addCriterion("default_number like", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotLike(String value) { + addCriterion("default_number not like", value, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberIn(List values) { + addCriterion("default_number in", values, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotIn(List values) { + addCriterion("default_number not in", values, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberBetween(String value1, String value2) { + addCriterion("default_number between", value1, value2, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andDefaultNumberNotBetween(String value1, String value2) { + addCriterion("default_number not between", value1, value2, "defaultNumber"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(String value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(String value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(String value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(String value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(String value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(String value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLike(String value) { + addCriterion("number like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotLike(String value) { + addCriterion("number not like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(String value1, String value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(String value1, String value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andOperTimeIsNull() { + addCriterion("oper_time is null"); + return (Criteria) this; + } + + public Criteria andOperTimeIsNotNull() { + addCriterion("oper_time is not null"); + return (Criteria) this; + } + + public Criteria andOperTimeEqualTo(Date value) { + addCriterion("oper_time =", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotEqualTo(Date value) { + addCriterion("oper_time <>", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeGreaterThan(Date value) { + addCriterion("oper_time >", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeGreaterThanOrEqualTo(Date value) { + addCriterion("oper_time >=", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeLessThan(Date value) { + addCriterion("oper_time <", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeLessThanOrEqualTo(Date value) { + addCriterion("oper_time <=", value, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeIn(List values) { + addCriterion("oper_time in", values, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotIn(List values) { + addCriterion("oper_time not in", values, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeBetween(Date value1, Date value2) { + addCriterion("oper_time between", value1, value2, "operTime"); + return (Criteria) this; + } + + public Criteria andOperTimeNotBetween(Date value1, Date value2) { + addCriterion("oper_time not between", value1, value2, "operTime"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNull() { + addCriterion("organ_id is null"); + return (Criteria) this; + } + + public Criteria andOrganIdIsNotNull() { + addCriterion("organ_id is not null"); + return (Criteria) this; + } + + public Criteria andOrganIdEqualTo(Long value) { + addCriterion("organ_id =", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotEqualTo(Long value) { + addCriterion("organ_id <>", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThan(Long value) { + addCriterion("organ_id >", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdGreaterThanOrEqualTo(Long value) { + addCriterion("organ_id >=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThan(Long value) { + addCriterion("organ_id <", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdLessThanOrEqualTo(Long value) { + addCriterion("organ_id <=", value, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdIn(List values) { + addCriterion("organ_id in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotIn(List values) { + addCriterion("organ_id not in", values, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdBetween(Long value1, Long value2) { + addCriterion("organ_id between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andOrganIdNotBetween(Long value1, Long value2) { + addCriterion("organ_id not between", value1, value2, "organId"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNull() { + addCriterion("account_id is null"); + return (Criteria) this; + } + + public Criteria andAccountIdIsNotNull() { + addCriterion("account_id is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdEqualTo(Long value) { + addCriterion("account_id =", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotEqualTo(Long value) { + addCriterion("account_id <>", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThan(Long value) { + addCriterion("account_id >", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdGreaterThanOrEqualTo(Long value) { + addCriterion("account_id >=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThan(Long value) { + addCriterion("account_id <", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdLessThanOrEqualTo(Long value) { + addCriterion("account_id <=", value, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdIn(List values) { + addCriterion("account_id in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotIn(List values) { + addCriterion("account_id not in", values, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdBetween(Long value1, Long value2) { + addCriterion("account_id between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andAccountIdNotBetween(Long value1, Long value2) { + addCriterion("account_id not between", value1, value2, "accountId"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNull() { + addCriterion("change_amount is null"); + return (Criteria) this; + } + + public Criteria andChangeAmountIsNotNull() { + addCriterion("change_amount is not null"); + return (Criteria) this; + } + + public Criteria andChangeAmountEqualTo(BigDecimal value) { + addCriterion("change_amount =", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotEqualTo(BigDecimal value) { + addCriterion("change_amount <>", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThan(BigDecimal value) { + addCriterion("change_amount >", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount >=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThan(BigDecimal value) { + addCriterion("change_amount <", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("change_amount <=", value, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountIn(List values) { + addCriterion("change_amount in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotIn(List values) { + addCriterion("change_amount not in", values, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andChangeAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("change_amount not between", value1, value2, "changeAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountIsNull() { + addCriterion("back_amount is null"); + return (Criteria) this; + } + + public Criteria andBackAmountIsNotNull() { + addCriterion("back_amount is not null"); + return (Criteria) this; + } + + public Criteria andBackAmountEqualTo(BigDecimal value) { + addCriterion("back_amount =", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotEqualTo(BigDecimal value) { + addCriterion("back_amount <>", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountGreaterThan(BigDecimal value) { + addCriterion("back_amount >", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("back_amount >=", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountLessThan(BigDecimal value) { + addCriterion("back_amount <", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountLessThanOrEqualTo(BigDecimal value) { + addCriterion("back_amount <=", value, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountIn(List values) { + addCriterion("back_amount in", values, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotIn(List values) { + addCriterion("back_amount not in", values, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("back_amount between", value1, value2, "backAmount"); + return (Criteria) this; + } + + public Criteria andBackAmountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("back_amount not between", value1, value2, "backAmount"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNull() { + addCriterion("total_price is null"); + return (Criteria) this; + } + + public Criteria andTotalPriceIsNotNull() { + addCriterion("total_price is not null"); + return (Criteria) this; + } + + public Criteria andTotalPriceEqualTo(BigDecimal value) { + addCriterion("total_price =", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotEqualTo(BigDecimal value) { + addCriterion("total_price <>", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThan(BigDecimal value) { + addCriterion("total_price >", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("total_price >=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThan(BigDecimal value) { + addCriterion("total_price <", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("total_price <=", value, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceIn(List values) { + addCriterion("total_price in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotIn(List values) { + addCriterion("total_price not in", values, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andTotalPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("total_price not between", value1, value2, "totalPrice"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNull() { + addCriterion("pay_type is null"); + return (Criteria) this; + } + + public Criteria andPayTypeIsNotNull() { + addCriterion("pay_type is not null"); + return (Criteria) this; + } + + public Criteria andPayTypeEqualTo(String value) { + addCriterion("pay_type =", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotEqualTo(String value) { + addCriterion("pay_type <>", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThan(String value) { + addCriterion("pay_type >", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeGreaterThanOrEqualTo(String value) { + addCriterion("pay_type >=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThan(String value) { + addCriterion("pay_type <", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLessThanOrEqualTo(String value) { + addCriterion("pay_type <=", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeLike(String value) { + addCriterion("pay_type like", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotLike(String value) { + addCriterion("pay_type not like", value, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeIn(List values) { + addCriterion("pay_type in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotIn(List values) { + addCriterion("pay_type not in", values, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeBetween(String value1, String value2) { + addCriterion("pay_type between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andPayTypeNotBetween(String value1, String value2) { + addCriterion("pay_type not between", value1, value2, "payType"); + return (Criteria) this; + } + + public Criteria andBillTypeIsNull() { + addCriterion("bill_type is null"); + return (Criteria) this; + } + + public Criteria andBillTypeIsNotNull() { + addCriterion("bill_type is not null"); + return (Criteria) this; + } + + public Criteria andBillTypeEqualTo(String value) { + addCriterion("bill_type =", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotEqualTo(String value) { + addCriterion("bill_type <>", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeGreaterThan(String value) { + addCriterion("bill_type >", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeGreaterThanOrEqualTo(String value) { + addCriterion("bill_type >=", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLessThan(String value) { + addCriterion("bill_type <", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLessThanOrEqualTo(String value) { + addCriterion("bill_type <=", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeLike(String value) { + addCriterion("bill_type like", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotLike(String value) { + addCriterion("bill_type not like", value, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeIn(List values) { + addCriterion("bill_type in", values, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotIn(List values) { + addCriterion("bill_type not in", values, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeBetween(String value1, String value2) { + addCriterion("bill_type between", value1, value2, "billType"); + return (Criteria) this; + } + + public Criteria andBillTypeNotBetween(String value1, String value2) { + addCriterion("bill_type not between", value1, value2, "billType"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andSalesManIsNull() { + addCriterion("sales_man is null"); + return (Criteria) this; + } + + public Criteria andSalesManIsNotNull() { + addCriterion("sales_man is not null"); + return (Criteria) this; + } + + public Criteria andSalesManEqualTo(String value) { + addCriterion("sales_man =", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotEqualTo(String value) { + addCriterion("sales_man <>", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManGreaterThan(String value) { + addCriterion("sales_man >", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManGreaterThanOrEqualTo(String value) { + addCriterion("sales_man >=", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLessThan(String value) { + addCriterion("sales_man <", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLessThanOrEqualTo(String value) { + addCriterion("sales_man <=", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManLike(String value) { + addCriterion("sales_man like", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotLike(String value) { + addCriterion("sales_man not like", value, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManIn(List values) { + addCriterion("sales_man in", values, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotIn(List values) { + addCriterion("sales_man not in", values, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManBetween(String value1, String value2) { + addCriterion("sales_man between", value1, value2, "salesMan"); + return (Criteria) this; + } + + public Criteria andSalesManNotBetween(String value1, String value2) { + addCriterion("sales_man not between", value1, value2, "salesMan"); + return (Criteria) this; + } + + public Criteria andAccountIdListIsNull() { + addCriterion("account_id_list is null"); + return (Criteria) this; + } + + public Criteria andAccountIdListIsNotNull() { + addCriterion("account_id_list is not null"); + return (Criteria) this; + } + + public Criteria andAccountIdListEqualTo(String value) { + addCriterion("account_id_list =", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotEqualTo(String value) { + addCriterion("account_id_list <>", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListGreaterThan(String value) { + addCriterion("account_id_list >", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListGreaterThanOrEqualTo(String value) { + addCriterion("account_id_list >=", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLessThan(String value) { + addCriterion("account_id_list <", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLessThanOrEqualTo(String value) { + addCriterion("account_id_list <=", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListLike(String value) { + addCriterion("account_id_list like", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotLike(String value) { + addCriterion("account_id_list not like", value, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListIn(List values) { + addCriterion("account_id_list in", values, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotIn(List values) { + addCriterion("account_id_list not in", values, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListBetween(String value1, String value2) { + addCriterion("account_id_list between", value1, value2, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountIdListNotBetween(String value1, String value2) { + addCriterion("account_id_list not between", value1, value2, "accountIdList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIsNull() { + addCriterion("account_money_list is null"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIsNotNull() { + addCriterion("account_money_list is not null"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListEqualTo(String value) { + addCriterion("account_money_list =", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotEqualTo(String value) { + addCriterion("account_money_list <>", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListGreaterThan(String value) { + addCriterion("account_money_list >", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListGreaterThanOrEqualTo(String value) { + addCriterion("account_money_list >=", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLessThan(String value) { + addCriterion("account_money_list <", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLessThanOrEqualTo(String value) { + addCriterion("account_money_list <=", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListLike(String value) { + addCriterion("account_money_list like", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotLike(String value) { + addCriterion("account_money_list not like", value, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListIn(List values) { + addCriterion("account_money_list in", values, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotIn(List values) { + addCriterion("account_money_list not in", values, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListBetween(String value1, String value2) { + addCriterion("account_money_list between", value1, value2, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andAccountMoneyListNotBetween(String value1, String value2) { + addCriterion("account_money_list not between", value1, value2, "accountMoneyList"); + return (Criteria) this; + } + + public Criteria andDiscountIsNull() { + addCriterion("discount is null"); + return (Criteria) this; + } + + public Criteria andDiscountIsNotNull() { + addCriterion("discount is not null"); + return (Criteria) this; + } + + public Criteria andDiscountEqualTo(BigDecimal value) { + addCriterion("discount =", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotEqualTo(BigDecimal value) { + addCriterion("discount <>", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThan(BigDecimal value) { + addCriterion("discount >", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount >=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThan(BigDecimal value) { + addCriterion("discount <", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount <=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountIn(List values) { + addCriterion("discount in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotIn(List values) { + addCriterion("discount not in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount not between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNull() { + addCriterion("discount_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIsNotNull() { + addCriterion("discount_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyEqualTo(BigDecimal value) { + addCriterion("discount_money =", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_money <>", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_money >", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money >=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThan(BigDecimal value) { + addCriterion("discount_money <", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_money <=", value, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyIn(List values) { + addCriterion("discount_money in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotIn(List values) { + addCriterion("discount_money not in", values, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_money not between", value1, value2, "discountMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIsNull() { + addCriterion("discount_last_money is null"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIsNotNull() { + addCriterion("discount_last_money is not null"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyEqualTo(BigDecimal value) { + addCriterion("discount_last_money =", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotEqualTo(BigDecimal value) { + addCriterion("discount_last_money <>", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyGreaterThan(BigDecimal value) { + addCriterion("discount_last_money >", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_last_money >=", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyLessThan(BigDecimal value) { + addCriterion("discount_last_money <", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_last_money <=", value, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyIn(List values) { + addCriterion("discount_last_money in", values, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotIn(List values) { + addCriterion("discount_last_money not in", values, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_last_money between", value1, value2, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andDiscountLastMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_last_money not between", value1, value2, "discountLastMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIsNull() { + addCriterion("other_money is null"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIsNotNull() { + addCriterion("other_money is not null"); + return (Criteria) this; + } + + public Criteria andOtherMoneyEqualTo(BigDecimal value) { + addCriterion("other_money =", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotEqualTo(BigDecimal value) { + addCriterion("other_money <>", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyGreaterThan(BigDecimal value) { + addCriterion("other_money >", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("other_money >=", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyLessThan(BigDecimal value) { + addCriterion("other_money <", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("other_money <=", value, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyIn(List values) { + addCriterion("other_money in", values, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotIn(List values) { + addCriterion("other_money not in", values, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("other_money between", value1, value2, "otherMoney"); + return (Criteria) this; + } + + public Criteria andOtherMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("other_money not between", value1, value2, "otherMoney"); + return (Criteria) this; + } + + public Criteria andDepositIsNull() { + addCriterion("deposit is null"); + return (Criteria) this; + } + + public Criteria andDepositIsNotNull() { + addCriterion("deposit is not null"); + return (Criteria) this; + } + + public Criteria andDepositEqualTo(BigDecimal value) { + addCriterion("deposit =", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositNotEqualTo(BigDecimal value) { + addCriterion("deposit <>", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositGreaterThan(BigDecimal value) { + addCriterion("deposit >", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("deposit >=", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositLessThan(BigDecimal value) { + addCriterion("deposit <", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositLessThanOrEqualTo(BigDecimal value) { + addCriterion("deposit <=", value, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositIn(List values) { + addCriterion("deposit in", values, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositNotIn(List values) { + addCriterion("deposit not in", values, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("deposit between", value1, value2, "deposit"); + return (Criteria) this; + } + + public Criteria andDepositNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("deposit not between", value1, value2, "deposit"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusIsNull() { + addCriterion("purchase_status is null"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusIsNotNull() { + addCriterion("purchase_status is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusEqualTo(String value) { + addCriterion("purchase_status =", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusNotEqualTo(String value) { + addCriterion("purchase_status <>", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusGreaterThan(String value) { + addCriterion("purchase_status >", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusGreaterThanOrEqualTo(String value) { + addCriterion("purchase_status >=", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusLessThan(String value) { + addCriterion("purchase_status <", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusLessThanOrEqualTo(String value) { + addCriterion("purchase_status <=", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusLike(String value) { + addCriterion("purchase_status like", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusNotLike(String value) { + addCriterion("purchase_status not like", value, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusIn(List values) { + addCriterion("purchase_status in", values, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusNotIn(List values) { + addCriterion("purchase_status not in", values, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusBetween(String value1, String value2) { + addCriterion("purchase_status between", value1, value2, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andPurchaseStatusNotBetween(String value1, String value2) { + addCriterion("purchase_status not between", value1, value2, "purchaseStatus"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("source is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("source is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(String value) { + addCriterion("source =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(String value) { + addCriterion("source <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(String value) { + addCriterion("source >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(String value) { + addCriterion("source >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(String value) { + addCriterion("source <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(String value) { + addCriterion("source <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLike(String value) { + addCriterion("source like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotLike(String value) { + addCriterion("source not like", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("source in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("source not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(String value1, String value2) { + addCriterion("source between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(String value1, String value2) { + addCriterion("source not between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andLinkNumberIsNull() { + addCriterion("link_number is null"); + return (Criteria) this; + } + + public Criteria andLinkNumberIsNotNull() { + addCriterion("link_number is not null"); + return (Criteria) this; + } + + public Criteria andLinkNumberEqualTo(String value) { + addCriterion("link_number =", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotEqualTo(String value) { + addCriterion("link_number <>", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberGreaterThan(String value) { + addCriterion("link_number >", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberGreaterThanOrEqualTo(String value) { + addCriterion("link_number >=", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLessThan(String value) { + addCriterion("link_number <", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLessThanOrEqualTo(String value) { + addCriterion("link_number <=", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberLike(String value) { + addCriterion("link_number like", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotLike(String value) { + addCriterion("link_number not like", value, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberIn(List values) { + addCriterion("link_number in", values, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotIn(List values) { + addCriterion("link_number not in", values, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberBetween(String value1, String value2) { + addCriterion("link_number between", value1, value2, "linkNumber"); + return (Criteria) this; + } + + public Criteria andLinkNumberNotBetween(String value1, String value2) { + addCriterion("link_number not between", value1, value2, "linkNumber"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadVo4Body.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadVo4Body.java new file mode 100644 index 00000000..1f67c6a5 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotHeadVo4Body.java @@ -0,0 +1,17 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotHeadVo4Body { + + private Long id; + + private String info; + + private String rows; + + private BigDecimal preTotalPrice; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItem.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItem.java new file mode 100644 index 00000000..cb16160f --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItem.java @@ -0,0 +1,59 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotItem { + private Long id; + + private Long headerId; + + private Long materialId; + + private Long materialExtendId; + + private String materialUnit; + + private String sku; + + private BigDecimal operNumber; + + private BigDecimal basicNumber; + + private BigDecimal unitPrice; + + private BigDecimal purchaseUnitPrice; + + private BigDecimal taxUnitPrice; + + private BigDecimal allPrice; + + private String remark; + + private Long depotId; + + private Long anotherDepotId; + + private BigDecimal taxRate; + + private BigDecimal taxMoney; + + private BigDecimal taxLastMoney; + + private String materialType; + + private String snList; + + private String batchNumber; + + private Date expirationDate; + + private Long linkId; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItemExample.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemExample.java new file mode 100644 index 00000000..773124cd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemExample.java @@ -0,0 +1,1771 @@ +package com.wansensoft.entities.depot; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class DepotItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public DepotItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNull() { + addCriterion("header_id is null"); + return (Criteria) this; + } + + public Criteria andHeaderIdIsNotNull() { + addCriterion("header_id is not null"); + return (Criteria) this; + } + + public Criteria andHeaderIdEqualTo(Long value) { + addCriterion("header_id =", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotEqualTo(Long value) { + addCriterion("header_id <>", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThan(Long value) { + addCriterion("header_id >", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdGreaterThanOrEqualTo(Long value) { + addCriterion("header_id >=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThan(Long value) { + addCriterion("header_id <", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdLessThanOrEqualTo(Long value) { + addCriterion("header_id <=", value, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdIn(List values) { + addCriterion("header_id in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotIn(List values) { + addCriterion("header_id not in", values, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdBetween(Long value1, Long value2) { + addCriterion("header_id between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andHeaderIdNotBetween(Long value1, Long value2) { + addCriterion("header_id not between", value1, value2, "headerId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIsNull() { + addCriterion("material_extend_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIsNotNull() { + addCriterion("material_extend_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdEqualTo(Long value) { + addCriterion("material_extend_id =", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotEqualTo(Long value) { + addCriterion("material_extend_id <>", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdGreaterThan(Long value) { + addCriterion("material_extend_id >", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_extend_id >=", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdLessThan(Long value) { + addCriterion("material_extend_id <", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdLessThanOrEqualTo(Long value) { + addCriterion("material_extend_id <=", value, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdIn(List values) { + addCriterion("material_extend_id in", values, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotIn(List values) { + addCriterion("material_extend_id not in", values, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdBetween(Long value1, Long value2) { + addCriterion("material_extend_id between", value1, value2, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialExtendIdNotBetween(Long value1, Long value2) { + addCriterion("material_extend_id not between", value1, value2, "materialExtendId"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIsNull() { + addCriterion("material_unit is null"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIsNotNull() { + addCriterion("material_unit is not null"); + return (Criteria) this; + } + + public Criteria andMaterialUnitEqualTo(String value) { + addCriterion("material_unit =", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotEqualTo(String value) { + addCriterion("material_unit <>", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitGreaterThan(String value) { + addCriterion("material_unit >", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitGreaterThanOrEqualTo(String value) { + addCriterion("material_unit >=", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLessThan(String value) { + addCriterion("material_unit <", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLessThanOrEqualTo(String value) { + addCriterion("material_unit <=", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitLike(String value) { + addCriterion("material_unit like", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotLike(String value) { + addCriterion("material_unit not like", value, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitIn(List values) { + addCriterion("material_unit in", values, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotIn(List values) { + addCriterion("material_unit not in", values, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitBetween(String value1, String value2) { + addCriterion("material_unit between", value1, value2, "materialUnit"); + return (Criteria) this; + } + + public Criteria andMaterialUnitNotBetween(String value1, String value2) { + addCriterion("material_unit not between", value1, value2, "materialUnit"); + return (Criteria) this; + } + + public Criteria andSkuIsNull() { + addCriterion("sku is null"); + return (Criteria) this; + } + + public Criteria andSkuIsNotNull() { + addCriterion("sku is not null"); + return (Criteria) this; + } + + public Criteria andSkuEqualTo(String value) { + addCriterion("sku =", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotEqualTo(String value) { + addCriterion("sku <>", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThan(String value) { + addCriterion("sku >", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThanOrEqualTo(String value) { + addCriterion("sku >=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThan(String value) { + addCriterion("sku <", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThanOrEqualTo(String value) { + addCriterion("sku <=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLike(String value) { + addCriterion("sku like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotLike(String value) { + addCriterion("sku not like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuIn(List values) { + addCriterion("sku in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotIn(List values) { + addCriterion("sku not in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuBetween(String value1, String value2) { + addCriterion("sku between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotBetween(String value1, String value2) { + addCriterion("sku not between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andOperNumberIsNull() { + addCriterion("oper_number is null"); + return (Criteria) this; + } + + public Criteria andOperNumberIsNotNull() { + addCriterion("oper_number is not null"); + return (Criteria) this; + } + + public Criteria andOperNumberEqualTo(BigDecimal value) { + addCriterion("oper_number =", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotEqualTo(BigDecimal value) { + addCriterion("oper_number <>", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberGreaterThan(BigDecimal value) { + addCriterion("oper_number >", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("oper_number >=", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberLessThan(BigDecimal value) { + addCriterion("oper_number <", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("oper_number <=", value, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberIn(List values) { + addCriterion("oper_number in", values, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotIn(List values) { + addCriterion("oper_number not in", values, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("oper_number between", value1, value2, "operNumber"); + return (Criteria) this; + } + + public Criteria andOperNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("oper_number not between", value1, value2, "operNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberIsNull() { + addCriterion("basic_number is null"); + return (Criteria) this; + } + + public Criteria andBasicNumberIsNotNull() { + addCriterion("basic_number is not null"); + return (Criteria) this; + } + + public Criteria andBasicNumberEqualTo(BigDecimal value) { + addCriterion("basic_number =", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotEqualTo(BigDecimal value) { + addCriterion("basic_number <>", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberGreaterThan(BigDecimal value) { + addCriterion("basic_number >", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("basic_number >=", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberLessThan(BigDecimal value) { + addCriterion("basic_number <", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("basic_number <=", value, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberIn(List values) { + addCriterion("basic_number in", values, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotIn(List values) { + addCriterion("basic_number not in", values, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("basic_number between", value1, value2, "basicNumber"); + return (Criteria) this; + } + + public Criteria andBasicNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("basic_number not between", value1, value2, "basicNumber"); + return (Criteria) this; + } + + public Criteria andUnitPriceIsNull() { + addCriterion("unit_price is null"); + return (Criteria) this; + } + + public Criteria andUnitPriceIsNotNull() { + addCriterion("unit_price is not null"); + return (Criteria) this; + } + + public Criteria andUnitPriceEqualTo(BigDecimal value) { + addCriterion("unit_price =", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("unit_price <>", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceGreaterThan(BigDecimal value) { + addCriterion("unit_price >", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("unit_price >=", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceLessThan(BigDecimal value) { + addCriterion("unit_price <", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("unit_price <=", value, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceIn(List values) { + addCriterion("unit_price in", values, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotIn(List values) { + addCriterion("unit_price not in", values, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("unit_price between", value1, value2, "unitPrice"); + return (Criteria) this; + } + + public Criteria andUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("unit_price not between", value1, value2, "unitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceIsNull() { + addCriterion("purchase_unit_price is null"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceIsNotNull() { + addCriterion("purchase_unit_price is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price =", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price <>", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceGreaterThan(BigDecimal value) { + addCriterion("purchase_unit_price >", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price >=", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceLessThan(BigDecimal value) { + addCriterion("purchase_unit_price <", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_unit_price <=", value, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceIn(List values) { + addCriterion("purchase_unit_price in", values, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotIn(List values) { + addCriterion("purchase_unit_price not in", values, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_unit_price between", value1, value2, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andPurchaseUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_unit_price not between", value1, value2, "purchaseUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIsNull() { + addCriterion("tax_unit_price is null"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIsNotNull() { + addCriterion("tax_unit_price is not null"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceEqualTo(BigDecimal value) { + addCriterion("tax_unit_price =", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotEqualTo(BigDecimal value) { + addCriterion("tax_unit_price <>", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceGreaterThan(BigDecimal value) { + addCriterion("tax_unit_price >", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_unit_price >=", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceLessThan(BigDecimal value) { + addCriterion("tax_unit_price <", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_unit_price <=", value, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceIn(List values) { + addCriterion("tax_unit_price in", values, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotIn(List values) { + addCriterion("tax_unit_price not in", values, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_unit_price between", value1, value2, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andTaxUnitPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_unit_price not between", value1, value2, "taxUnitPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceIsNull() { + addCriterion("all_price is null"); + return (Criteria) this; + } + + public Criteria andAllPriceIsNotNull() { + addCriterion("all_price is not null"); + return (Criteria) this; + } + + public Criteria andAllPriceEqualTo(BigDecimal value) { + addCriterion("all_price =", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotEqualTo(BigDecimal value) { + addCriterion("all_price <>", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceGreaterThan(BigDecimal value) { + addCriterion("all_price >", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_price >=", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceLessThan(BigDecimal value) { + addCriterion("all_price <", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_price <=", value, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceIn(List values) { + addCriterion("all_price in", values, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotIn(List values) { + addCriterion("all_price not in", values, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_price between", value1, value2, "allPrice"); + return (Criteria) this; + } + + public Criteria andAllPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_price not between", value1, value2, "allPrice"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIsNull() { + addCriterion("another_depot_id is null"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIsNotNull() { + addCriterion("another_depot_id is not null"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdEqualTo(Long value) { + addCriterion("another_depot_id =", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotEqualTo(Long value) { + addCriterion("another_depot_id <>", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdGreaterThan(Long value) { + addCriterion("another_depot_id >", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("another_depot_id >=", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdLessThan(Long value) { + addCriterion("another_depot_id <", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdLessThanOrEqualTo(Long value) { + addCriterion("another_depot_id <=", value, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdIn(List values) { + addCriterion("another_depot_id in", values, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotIn(List values) { + addCriterion("another_depot_id not in", values, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdBetween(Long value1, Long value2) { + addCriterion("another_depot_id between", value1, value2, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andAnotherDepotIdNotBetween(Long value1, Long value2) { + addCriterion("another_depot_id not between", value1, value2, "anotherDepotId"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNull() { + addCriterion("tax_rate is null"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNotNull() { + addCriterion("tax_rate is not null"); + return (Criteria) this; + } + + public Criteria andTaxRateEqualTo(BigDecimal value) { + addCriterion("tax_rate =", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotEqualTo(BigDecimal value) { + addCriterion("tax_rate <>", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThan(BigDecimal value) { + addCriterion("tax_rate >", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate >=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThan(BigDecimal value) { + addCriterion("tax_rate <", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate <=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateIn(List values) { + addCriterion("tax_rate in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotIn(List values) { + addCriterion("tax_rate not in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate not between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIsNull() { + addCriterion("tax_money is null"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIsNotNull() { + addCriterion("tax_money is not null"); + return (Criteria) this; + } + + public Criteria andTaxMoneyEqualTo(BigDecimal value) { + addCriterion("tax_money =", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotEqualTo(BigDecimal value) { + addCriterion("tax_money <>", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyGreaterThan(BigDecimal value) { + addCriterion("tax_money >", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_money >=", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyLessThan(BigDecimal value) { + addCriterion("tax_money <", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_money <=", value, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyIn(List values) { + addCriterion("tax_money in", values, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotIn(List values) { + addCriterion("tax_money not in", values, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_money between", value1, value2, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_money not between", value1, value2, "taxMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIsNull() { + addCriterion("tax_last_money is null"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIsNotNull() { + addCriterion("tax_last_money is not null"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyEqualTo(BigDecimal value) { + addCriterion("tax_last_money =", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotEqualTo(BigDecimal value) { + addCriterion("tax_last_money <>", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyGreaterThan(BigDecimal value) { + addCriterion("tax_last_money >", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_last_money >=", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyLessThan(BigDecimal value) { + addCriterion("tax_last_money <", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_last_money <=", value, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyIn(List values) { + addCriterion("tax_last_money in", values, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotIn(List values) { + addCriterion("tax_last_money not in", values, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_last_money between", value1, value2, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andTaxLastMoneyNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_last_money not between", value1, value2, "taxLastMoney"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIsNull() { + addCriterion("material_type is null"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIsNotNull() { + addCriterion("material_type is not null"); + return (Criteria) this; + } + + public Criteria andMaterialTypeEqualTo(String value) { + addCriterion("material_type =", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotEqualTo(String value) { + addCriterion("material_type <>", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeGreaterThan(String value) { + addCriterion("material_type >", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeGreaterThanOrEqualTo(String value) { + addCriterion("material_type >=", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLessThan(String value) { + addCriterion("material_type <", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLessThanOrEqualTo(String value) { + addCriterion("material_type <=", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeLike(String value) { + addCriterion("material_type like", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotLike(String value) { + addCriterion("material_type not like", value, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeIn(List values) { + addCriterion("material_type in", values, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotIn(List values) { + addCriterion("material_type not in", values, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeBetween(String value1, String value2) { + addCriterion("material_type between", value1, value2, "materialType"); + return (Criteria) this; + } + + public Criteria andMaterialTypeNotBetween(String value1, String value2) { + addCriterion("material_type not between", value1, value2, "materialType"); + return (Criteria) this; + } + + public Criteria andSnListIsNull() { + addCriterion("sn_list is null"); + return (Criteria) this; + } + + public Criteria andSnListIsNotNull() { + addCriterion("sn_list is not null"); + return (Criteria) this; + } + + public Criteria andSnListEqualTo(String value) { + addCriterion("sn_list =", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotEqualTo(String value) { + addCriterion("sn_list <>", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListGreaterThan(String value) { + addCriterion("sn_list >", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListGreaterThanOrEqualTo(String value) { + addCriterion("sn_list >=", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLessThan(String value) { + addCriterion("sn_list <", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLessThanOrEqualTo(String value) { + addCriterion("sn_list <=", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListLike(String value) { + addCriterion("sn_list like", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotLike(String value) { + addCriterion("sn_list not like", value, "snList"); + return (Criteria) this; + } + + public Criteria andSnListIn(List values) { + addCriterion("sn_list in", values, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotIn(List values) { + addCriterion("sn_list not in", values, "snList"); + return (Criteria) this; + } + + public Criteria andSnListBetween(String value1, String value2) { + addCriterion("sn_list between", value1, value2, "snList"); + return (Criteria) this; + } + + public Criteria andSnListNotBetween(String value1, String value2) { + addCriterion("sn_list not between", value1, value2, "snList"); + return (Criteria) this; + } + + public Criteria andBatchNumberIsNull() { + addCriterion("batch_number is null"); + return (Criteria) this; + } + + public Criteria andBatchNumberIsNotNull() { + addCriterion("batch_number is not null"); + return (Criteria) this; + } + + public Criteria andBatchNumberEqualTo(String value) { + addCriterion("batch_number =", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotEqualTo(String value) { + addCriterion("batch_number <>", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberGreaterThan(String value) { + addCriterion("batch_number >", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberGreaterThanOrEqualTo(String value) { + addCriterion("batch_number >=", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLessThan(String value) { + addCriterion("batch_number <", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLessThanOrEqualTo(String value) { + addCriterion("batch_number <=", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberLike(String value) { + addCriterion("batch_number like", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotLike(String value) { + addCriterion("batch_number not like", value, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberIn(List values) { + addCriterion("batch_number in", values, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotIn(List values) { + addCriterion("batch_number not in", values, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberBetween(String value1, String value2) { + addCriterion("batch_number between", value1, value2, "batchNumber"); + return (Criteria) this; + } + + public Criteria andBatchNumberNotBetween(String value1, String value2) { + addCriterion("batch_number not between", value1, value2, "batchNumber"); + return (Criteria) this; + } + + public Criteria andExpirationDateIsNull() { + addCriterion("expiration_date is null"); + return (Criteria) this; + } + + public Criteria andExpirationDateIsNotNull() { + addCriterion("expiration_date is not null"); + return (Criteria) this; + } + + public Criteria andExpirationDateEqualTo(Date value) { + addCriterion("expiration_date =", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotEqualTo(Date value) { + addCriterion("expiration_date <>", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateGreaterThan(Date value) { + addCriterion("expiration_date >", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateGreaterThanOrEqualTo(Date value) { + addCriterion("expiration_date >=", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateLessThan(Date value) { + addCriterion("expiration_date <", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateLessThanOrEqualTo(Date value) { + addCriterion("expiration_date <=", value, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateIn(List values) { + addCriterion("expiration_date in", values, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotIn(List values) { + addCriterion("expiration_date not in", values, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateBetween(Date value1, Date value2) { + addCriterion("expiration_date between", value1, value2, "expirationDate"); + return (Criteria) this; + } + + public Criteria andExpirationDateNotBetween(Date value1, Date value2) { + addCriterion("expiration_date not between", value1, value2, "expirationDate"); + return (Criteria) this; + } + + public Criteria andLinkIdIsNull() { + addCriterion("link_id is null"); + return (Criteria) this; + } + + public Criteria andLinkIdIsNotNull() { + addCriterion("link_id is not null"); + return (Criteria) this; + } + + public Criteria andLinkIdEqualTo(Long value) { + addCriterion("link_id =", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdNotEqualTo(Long value) { + addCriterion("link_id <>", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdGreaterThan(Long value) { + addCriterion("link_id >", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdGreaterThanOrEqualTo(Long value) { + addCriterion("link_id >=", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdLessThan(Long value) { + addCriterion("link_id <", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdLessThanOrEqualTo(Long value) { + addCriterion("link_id <=", value, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdIn(List values) { + addCriterion("link_id in", values, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdNotIn(List values) { + addCriterion("link_id not in", values, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdBetween(Long value1, Long value2) { + addCriterion("link_id between", value1, value2, "linkId"); + return (Criteria) this; + } + + public Criteria andLinkIdNotBetween(Long value1, Long value2) { + addCriterion("link_id not between", value1, value2, "linkId"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4DetailByTypeAndMId.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4DetailByTypeAndMId.java new file mode 100644 index 00000000..080a076c --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4DetailByTypeAndMId.java @@ -0,0 +1,26 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotItemVo4DetailByTypeAndMId { + + private String number; + + private String barCode; + + private String materialName; + + private String type; + + private String subType; + + private BigDecimal bnum; + + private String depotName; + + private Date otime; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4Material.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4Material.java new file mode 100644 index 00000000..f04d1d4b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4Material.java @@ -0,0 +1,11 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +@Data +public class DepotItemVo4Material extends DepotItem{ + + private String mname; + + private String mmodel; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4MaterialAndSum.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4MaterialAndSum.java new file mode 100644 index 00000000..302625bb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4MaterialAndSum.java @@ -0,0 +1,13 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotItemVo4MaterialAndSum { + + private Long materialExtendId; + + private BigDecimal operNumber; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4WithInfoEx.java b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4WithInfoEx.java new file mode 100644 index 00000000..a927bfbb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/depot/DepotItemVo4WithInfoEx.java @@ -0,0 +1,57 @@ +package com.wansensoft.entities.depot; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotItemVo4WithInfoEx extends DepotItem{ + + private Long MId; + + private String MName; + + private String MModel; + + private String MaterialUnit; + + private String MColor; + + private String MStandard; + + private String MMfrs; + + private String MOtherField1; + + private String MOtherField2; + + private String MOtherField3; + + private String enableSerialNumber; + + private String enableBatchNumber; + + private String DepotName; + + private String AnotherDepotName; + + private Long UnitId; + + private String unitName; + + private Integer ratio; + + private String otherUnit; + + private BigDecimal presetPriceOne; + + private String priceStrategy; + + private BigDecimal purchaseDecimal; + + private String barCode; + + private BigDecimal weight; + + private String imgName; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/function/Function.java b/domain/src/main/java/com/wansensoft/entities/function/Function.java new file mode 100644 index 00000000..1a2e94be --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/function/Function.java @@ -0,0 +1,32 @@ +package com.wansensoft.entities.function; + +import lombok.Data; + +@Data +public class Function { + private Long id; + + private String number; + + private String name; + + private String parentNumber; + + private String url; + + private String component; + + private Boolean state; + + private String sort; + + private Boolean enabled; + + private String type; + + private String pushBtn; + + private String icon; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/function/FunctionEx.java b/domain/src/main/java/com/wansensoft/entities/function/FunctionEx.java new file mode 100644 index 00000000..0f5e4fd6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/function/FunctionEx.java @@ -0,0 +1,9 @@ +package com.wansensoft.entities.function; + +import lombok.Data; + +@Data +public class FunctionEx extends Function { + + private String parentName; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/function/FunctionExample.java b/domain/src/main/java/com/wansensoft/entities/function/FunctionExample.java new file mode 100644 index 00000000..c78c6de0 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/function/FunctionExample.java @@ -0,0 +1,1079 @@ +package com.wansensoft.entities.function; + +import java.util.ArrayList; +import java.util.List; + +public class FunctionExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public FunctionExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(String value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(String value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(String value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(String value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(String value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(String value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLike(String value) { + addCriterion("number like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotLike(String value) { + addCriterion("number not like", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(String value1, String value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(String value1, String value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andParentNumberIsNull() { + addCriterion("parent_number is null"); + return (Criteria) this; + } + + public Criteria andParentNumberIsNotNull() { + addCriterion("parent_number is not null"); + return (Criteria) this; + } + + public Criteria andParentNumberEqualTo(String value) { + addCriterion("parent_number =", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotEqualTo(String value) { + addCriterion("parent_number <>", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberGreaterThan(String value) { + addCriterion("parent_number >", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberGreaterThanOrEqualTo(String value) { + addCriterion("parent_number >=", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLessThan(String value) { + addCriterion("parent_number <", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLessThanOrEqualTo(String value) { + addCriterion("parent_number <=", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberLike(String value) { + addCriterion("parent_number like", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotLike(String value) { + addCriterion("parent_number not like", value, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberIn(List values) { + addCriterion("parent_number in", values, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotIn(List values) { + addCriterion("parent_number not in", values, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberBetween(String value1, String value2) { + addCriterion("parent_number between", value1, value2, "parentNumber"); + return (Criteria) this; + } + + public Criteria andParentNumberNotBetween(String value1, String value2) { + addCriterion("parent_number not between", value1, value2, "parentNumber"); + return (Criteria) this; + } + + public Criteria andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andComponentIsNull() { + addCriterion("component is null"); + return (Criteria) this; + } + + public Criteria andComponentIsNotNull() { + addCriterion("component is not null"); + return (Criteria) this; + } + + public Criteria andComponentEqualTo(String value) { + addCriterion("component =", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotEqualTo(String value) { + addCriterion("component <>", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThan(String value) { + addCriterion("component >", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentGreaterThanOrEqualTo(String value) { + addCriterion("component >=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThan(String value) { + addCriterion("component <", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLessThanOrEqualTo(String value) { + addCriterion("component <=", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentLike(String value) { + addCriterion("component like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotLike(String value) { + addCriterion("component not like", value, "component"); + return (Criteria) this; + } + + public Criteria andComponentIn(List values) { + addCriterion("component in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotIn(List values) { + addCriterion("component not in", values, "component"); + return (Criteria) this; + } + + public Criteria andComponentBetween(String value1, String value2) { + addCriterion("component between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andComponentNotBetween(String value1, String value2) { + addCriterion("component not between", value1, value2, "component"); + return (Criteria) this; + } + + public Criteria andStateIsNull() { + addCriterion("state is null"); + return (Criteria) this; + } + + public Criteria andStateIsNotNull() { + addCriterion("state is not null"); + return (Criteria) this; + } + + public Criteria andStateEqualTo(Boolean value) { + addCriterion("state =", value, "state"); + return (Criteria) this; + } + + public Criteria andStateNotEqualTo(Boolean value) { + addCriterion("state <>", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThan(Boolean value) { + addCriterion("state >", value, "state"); + return (Criteria) this; + } + + public Criteria andStateGreaterThanOrEqualTo(Boolean value) { + addCriterion("state >=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThan(Boolean value) { + addCriterion("state <", value, "state"); + return (Criteria) this; + } + + public Criteria andStateLessThanOrEqualTo(Boolean value) { + addCriterion("state <=", value, "state"); + return (Criteria) this; + } + + public Criteria andStateIn(List values) { + addCriterion("state in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateNotIn(List values) { + addCriterion("state not in", values, "state"); + return (Criteria) this; + } + + public Criteria andStateBetween(Boolean value1, Boolean value2) { + addCriterion("state between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andStateNotBetween(Boolean value1, Boolean value2) { + addCriterion("state not between", value1, value2, "state"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andPushBtnIsNull() { + addCriterion("push_btn is null"); + return (Criteria) this; + } + + public Criteria andPushBtnIsNotNull() { + addCriterion("push_btn is not null"); + return (Criteria) this; + } + + public Criteria andPushBtnEqualTo(String value) { + addCriterion("push_btn =", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotEqualTo(String value) { + addCriterion("push_btn <>", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnGreaterThan(String value) { + addCriterion("push_btn >", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnGreaterThanOrEqualTo(String value) { + addCriterion("push_btn >=", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLessThan(String value) { + addCriterion("push_btn <", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLessThanOrEqualTo(String value) { + addCriterion("push_btn <=", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnLike(String value) { + addCriterion("push_btn like", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotLike(String value) { + addCriterion("push_btn not like", value, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnIn(List values) { + addCriterion("push_btn in", values, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotIn(List values) { + addCriterion("push_btn not in", values, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnBetween(String value1, String value2) { + addCriterion("push_btn between", value1, value2, "pushBtn"); + return (Criteria) this; + } + + public Criteria andPushBtnNotBetween(String value1, String value2) { + addCriterion("push_btn not between", value1, value2, "pushBtn"); + return (Criteria) this; + } + + public Criteria andIconIsNull() { + addCriterion("icon is null"); + return (Criteria) this; + } + + public Criteria andIconIsNotNull() { + addCriterion("icon is not null"); + return (Criteria) this; + } + + public Criteria andIconEqualTo(String value) { + addCriterion("icon =", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotEqualTo(String value) { + addCriterion("icon <>", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThan(String value) { + addCriterion("icon >", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconGreaterThanOrEqualTo(String value) { + addCriterion("icon >=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThan(String value) { + addCriterion("icon <", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLessThanOrEqualTo(String value) { + addCriterion("icon <=", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconLike(String value) { + addCriterion("icon like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotLike(String value) { + addCriterion("icon not like", value, "icon"); + return (Criteria) this; + } + + public Criteria andIconIn(List values) { + addCriterion("icon in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotIn(List values) { + addCriterion("icon not in", values, "icon"); + return (Criteria) this; + } + + public Criteria andIconBetween(String value1, String value2) { + addCriterion("icon between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andIconNotBetween(String value1, String value2) { + addCriterion("icon not between", value1, value2, "icon"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItem.java b/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItem.java new file mode 100644 index 00000000..83f2ce1e --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItem.java @@ -0,0 +1,22 @@ +package com.wansensoft.entities.inOutItem; + +import lombok.Data; + +@Data +public class InOutItem { + private Long id; + + private String name; + + private String type; + + private String remark; + + private Boolean enabled; + + private String sort; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItemExample.java b/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItemExample.java new file mode 100644 index 00000000..142a4ccb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/inOutItem/InOutItemExample.java @@ -0,0 +1,729 @@ +package com.wansensoft.entities.inOutItem; + +import java.util.ArrayList; +import java.util.List; + +public class InOutItemExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public InOutItemExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/log/Log.java b/domain/src/main/java/com/wansensoft/entities/log/Log.java new file mode 100644 index 00000000..0cc4ecbf --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/log/Log.java @@ -0,0 +1,24 @@ +package com.wansensoft.entities.log; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Log { + private Long id; + + private Long userId; + + private String operation; + + private String clientIp; + + private Date createTime; + + private Byte status; + + private String content; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/log/LogExample.java b/domain/src/main/java/com/wansensoft/entities/log/LogExample.java new file mode 100644 index 00000000..a46ac2ff --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/log/LogExample.java @@ -0,0 +1,710 @@ +package com.wansensoft.entities.log; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public LogExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andOperationIsNull() { + addCriterion("operation is null"); + return (Criteria) this; + } + + public Criteria andOperationIsNotNull() { + addCriterion("operation is not null"); + return (Criteria) this; + } + + public Criteria andOperationEqualTo(String value) { + addCriterion("operation =", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotEqualTo(String value) { + addCriterion("operation <>", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThan(String value) { + addCriterion("operation >", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationGreaterThanOrEqualTo(String value) { + addCriterion("operation >=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThan(String value) { + addCriterion("operation <", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLessThanOrEqualTo(String value) { + addCriterion("operation <=", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationLike(String value) { + addCriterion("operation like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotLike(String value) { + addCriterion("operation not like", value, "operation"); + return (Criteria) this; + } + + public Criteria andOperationIn(List values) { + addCriterion("operation in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotIn(List values) { + addCriterion("operation not in", values, "operation"); + return (Criteria) this; + } + + public Criteria andOperationBetween(String value1, String value2) { + addCriterion("operation between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andOperationNotBetween(String value1, String value2) { + addCriterion("operation not between", value1, value2, "operation"); + return (Criteria) this; + } + + public Criteria andClientIpIsNull() { + addCriterion("client_ip is null"); + return (Criteria) this; + } + + public Criteria andClientIpIsNotNull() { + addCriterion("client_ip is not null"); + return (Criteria) this; + } + + public Criteria andClientIpEqualTo(String value) { + addCriterion("client_ip =", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotEqualTo(String value) { + addCriterion("client_ip <>", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpGreaterThan(String value) { + addCriterion("client_ip >", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpGreaterThanOrEqualTo(String value) { + addCriterion("client_ip >=", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLessThan(String value) { + addCriterion("client_ip <", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLessThanOrEqualTo(String value) { + addCriterion("client_ip <=", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpLike(String value) { + addCriterion("client_ip like", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotLike(String value) { + addCriterion("client_ip not like", value, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpIn(List values) { + addCriterion("client_ip in", values, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotIn(List values) { + addCriterion("client_ip not in", values, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpBetween(String value1, String value2) { + addCriterion("client_ip between", value1, value2, "clientIp"); + return (Criteria) this; + } + + public Criteria andClientIpNotBetween(String value1, String value2) { + addCriterion("client_ip not between", value1, value2, "clientIp"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Byte value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Byte value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Byte value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Byte value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Byte value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Byte value1, Byte value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Byte value1, Byte value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andContentIsNull() { + addCriterion("content is null"); + return (Criteria) this; + } + + public Criteria andContentIsNotNull() { + addCriterion("content is not null"); + return (Criteria) this; + } + + public Criteria andContentEqualTo(String value) { + addCriterion("content =", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotEqualTo(String value) { + addCriterion("content <>", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThan(String value) { + addCriterion("content >", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThanOrEqualTo(String value) { + addCriterion("content >=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThan(String value) { + addCriterion("content <", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThanOrEqualTo(String value) { + addCriterion("content <=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLike(String value) { + addCriterion("content like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotLike(String value) { + addCriterion("content not like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentIn(List values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List values) { + addCriterion("content not in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentBetween(String value1, String value2) { + addCriterion("content between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andContentNotBetween(String value1, String value2) { + addCriterion("content not between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/Material.java b/domain/src/main/java/com/wansensoft/entities/material/Material.java new file mode 100644 index 00000000..e8e4f656 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/Material.java @@ -0,0 +1,52 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Material { + private Long id; + + private Long categoryId; + + private String name; + + private String mfrs; + + private String model; + + private String standard; + + private String color; + + private String unit; + + private String remark; + + private String imgName; + + private Long unitId; + + private Integer expiryNum; + + private BigDecimal weight; + + private Boolean enabled; + + private String otherField1; + + private String otherField2; + + private String otherField3; + + private String enableSerialNumber; + + private String enableBatchNumber; + + private String position; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialAttribute.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialAttribute.java new file mode 100644 index 00000000..be3b25e4 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialAttribute.java @@ -0,0 +1,16 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +@Data +public class MaterialAttribute { + private Long id; + + private String attributeName; + + private String attributeValue; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialAttributeExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialAttributeExample.java new file mode 100644 index 00000000..bf516db4 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialAttributeExample.java @@ -0,0 +1,529 @@ +package com.wansensoft.entities.material; + +import java.util.ArrayList; +import java.util.List; + +public class MaterialAttributeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialAttributeExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andAttributeNameIsNull() { + addCriterion("attribute_name is null"); + return (Criteria) this; + } + + public Criteria andAttributeNameIsNotNull() { + addCriterion("attribute_name is not null"); + return (Criteria) this; + } + + public Criteria andAttributeNameEqualTo(String value) { + addCriterion("attribute_name =", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotEqualTo(String value) { + addCriterion("attribute_name <>", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameGreaterThan(String value) { + addCriterion("attribute_name >", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameGreaterThanOrEqualTo(String value) { + addCriterion("attribute_name >=", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLessThan(String value) { + addCriterion("attribute_name <", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLessThanOrEqualTo(String value) { + addCriterion("attribute_name <=", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameLike(String value) { + addCriterion("attribute_name like", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotLike(String value) { + addCriterion("attribute_name not like", value, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameIn(List values) { + addCriterion("attribute_name in", values, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotIn(List values) { + addCriterion("attribute_name not in", values, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameBetween(String value1, String value2) { + addCriterion("attribute_name between", value1, value2, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeNameNotBetween(String value1, String value2) { + addCriterion("attribute_name not between", value1, value2, "attributeName"); + return (Criteria) this; + } + + public Criteria andAttributeValueIsNull() { + addCriterion("attribute_value is null"); + return (Criteria) this; + } + + public Criteria andAttributeValueIsNotNull() { + addCriterion("attribute_value is not null"); + return (Criteria) this; + } + + public Criteria andAttributeValueEqualTo(String value) { + addCriterion("attribute_value =", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotEqualTo(String value) { + addCriterion("attribute_value <>", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueGreaterThan(String value) { + addCriterion("attribute_value >", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueGreaterThanOrEqualTo(String value) { + addCriterion("attribute_value >=", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLessThan(String value) { + addCriterion("attribute_value <", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLessThanOrEqualTo(String value) { + addCriterion("attribute_value <=", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueLike(String value) { + addCriterion("attribute_value like", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotLike(String value) { + addCriterion("attribute_value not like", value, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueIn(List values) { + addCriterion("attribute_value in", values, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotIn(List values) { + addCriterion("attribute_value not in", values, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueBetween(String value1, String value2) { + addCriterion("attribute_value between", value1, value2, "attributeValue"); + return (Criteria) this; + } + + public Criteria andAttributeValueNotBetween(String value1, String value2) { + addCriterion("attribute_value not between", value1, value2, "attributeValue"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialCategory.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialCategory.java new file mode 100644 index 00000000..42a72ac0 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialCategory.java @@ -0,0 +1,30 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.util.Date; + +@Data +public class MaterialCategory { + private Long id; + + private String name; + + private Short categoryLevel; + + private Long parentId; + + private String sort; + + private String serialNo; + + private String remark; + + private Date createTime; + + private Date updateTime; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialCategoryExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialCategoryExample.java new file mode 100644 index 00000000..fc1f51eb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialCategoryExample.java @@ -0,0 +1,910 @@ +package com.wansensoft.entities.material; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MaterialCategoryExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialCategoryExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIsNull() { + addCriterion("category_level is null"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIsNotNull() { + addCriterion("category_level is not null"); + return (Criteria) this; + } + + public Criteria andCategoryLevelEqualTo(Short value) { + addCriterion("category_level =", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotEqualTo(Short value) { + addCriterion("category_level <>", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelGreaterThan(Short value) { + addCriterion("category_level >", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelGreaterThanOrEqualTo(Short value) { + addCriterion("category_level >=", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelLessThan(Short value) { + addCriterion("category_level <", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelLessThanOrEqualTo(Short value) { + addCriterion("category_level <=", value, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelIn(List values) { + addCriterion("category_level in", values, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotIn(List values) { + addCriterion("category_level not in", values, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelBetween(Short value1, Short value2) { + addCriterion("category_level between", value1, value2, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andCategoryLevelNotBetween(Short value1, Short value2) { + addCriterion("category_level not between", value1, value2, "categoryLevel"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNull() { + addCriterion("serial_no is null"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNotNull() { + addCriterion("serial_no is not null"); + return (Criteria) this; + } + + public Criteria andSerialNoEqualTo(String value) { + addCriterion("serial_no =", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotEqualTo(String value) { + addCriterion("serial_no <>", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThan(String value) { + addCriterion("serial_no >", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThanOrEqualTo(String value) { + addCriterion("serial_no >=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThan(String value) { + addCriterion("serial_no <", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThanOrEqualTo(String value) { + addCriterion("serial_no <=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLike(String value) { + addCriterion("serial_no like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotLike(String value) { + addCriterion("serial_no not like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoIn(List values) { + addCriterion("serial_no in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotIn(List values) { + addCriterion("serial_no not in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoBetween(String value1, String value2) { + addCriterion("serial_no between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotBetween(String value1, String value2) { + addCriterion("serial_no not between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStock.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStock.java new file mode 100644 index 00000000..0ddde6e6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStock.java @@ -0,0 +1,20 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class MaterialCurrentStock { + private Long id; + + private Long materialId; + + private Long depotId; + + private BigDecimal currentNumber; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStockExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStockExample.java new file mode 100644 index 00000000..9a822045 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialCurrentStockExample.java @@ -0,0 +1,570 @@ +package com.wansensoft.entities.material; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialCurrentStockExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialCurrentStockExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIsNull() { + addCriterion("current_number is null"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIsNotNull() { + addCriterion("current_number is not null"); + return (Criteria) this; + } + + public Criteria andCurrentNumberEqualTo(BigDecimal value) { + addCriterion("current_number =", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotEqualTo(BigDecimal value) { + addCriterion("current_number <>", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberGreaterThan(BigDecimal value) { + addCriterion("current_number >", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("current_number >=", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberLessThan(BigDecimal value) { + addCriterion("current_number <", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("current_number <=", value, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberIn(List values) { + addCriterion("current_number in", values, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotIn(List values) { + addCriterion("current_number not in", values, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_number between", value1, value2, "currentNumber"); + return (Criteria) this; + } + + public Criteria andCurrentNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("current_number not between", value1, value2, "currentNumber"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialExample.java new file mode 100644 index 00000000..a12d0125 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialExample.java @@ -0,0 +1,1670 @@ +package com.wansensoft.entities.material; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCategoryIdIsNull() { + addCriterion("category_id is null"); + return (Criteria) this; + } + + public Criteria andCategoryIdIsNotNull() { + addCriterion("category_id is not null"); + return (Criteria) this; + } + + public Criteria andCategoryIdEqualTo(Long value) { + addCriterion("category_id =", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotEqualTo(Long value) { + addCriterion("category_id <>", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdGreaterThan(Long value) { + addCriterion("category_id >", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) { + addCriterion("category_id >=", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdLessThan(Long value) { + addCriterion("category_id <", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdLessThanOrEqualTo(Long value) { + addCriterion("category_id <=", value, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdIn(List values) { + addCriterion("category_id in", values, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotIn(List values) { + addCriterion("category_id not in", values, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdBetween(Long value1, Long value2) { + addCriterion("category_id between", value1, value2, "categoryId"); + return (Criteria) this; + } + + public Criteria andCategoryIdNotBetween(Long value1, Long value2) { + addCriterion("category_id not between", value1, value2, "categoryId"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andMfrsIsNull() { + addCriterion("mfrs is null"); + return (Criteria) this; + } + + public Criteria andMfrsIsNotNull() { + addCriterion("mfrs is not null"); + return (Criteria) this; + } + + public Criteria andMfrsEqualTo(String value) { + addCriterion("mfrs =", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotEqualTo(String value) { + addCriterion("mfrs <>", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsGreaterThan(String value) { + addCriterion("mfrs >", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsGreaterThanOrEqualTo(String value) { + addCriterion("mfrs >=", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLessThan(String value) { + addCriterion("mfrs <", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLessThanOrEqualTo(String value) { + addCriterion("mfrs <=", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsLike(String value) { + addCriterion("mfrs like", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotLike(String value) { + addCriterion("mfrs not like", value, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsIn(List values) { + addCriterion("mfrs in", values, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotIn(List values) { + addCriterion("mfrs not in", values, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsBetween(String value1, String value2) { + addCriterion("mfrs between", value1, value2, "mfrs"); + return (Criteria) this; + } + + public Criteria andMfrsNotBetween(String value1, String value2) { + addCriterion("mfrs not between", value1, value2, "mfrs"); + return (Criteria) this; + } + + public Criteria andModelIsNull() { + addCriterion("model is null"); + return (Criteria) this; + } + + public Criteria andModelIsNotNull() { + addCriterion("model is not null"); + return (Criteria) this; + } + + public Criteria andModelEqualTo(String value) { + addCriterion("model =", value, "model"); + return (Criteria) this; + } + + public Criteria andModelNotEqualTo(String value) { + addCriterion("model <>", value, "model"); + return (Criteria) this; + } + + public Criteria andModelGreaterThan(String value) { + addCriterion("model >", value, "model"); + return (Criteria) this; + } + + public Criteria andModelGreaterThanOrEqualTo(String value) { + addCriterion("model >=", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLessThan(String value) { + addCriterion("model <", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLessThanOrEqualTo(String value) { + addCriterion("model <=", value, "model"); + return (Criteria) this; + } + + public Criteria andModelLike(String value) { + addCriterion("model like", value, "model"); + return (Criteria) this; + } + + public Criteria andModelNotLike(String value) { + addCriterion("model not like", value, "model"); + return (Criteria) this; + } + + public Criteria andModelIn(List values) { + addCriterion("model in", values, "model"); + return (Criteria) this; + } + + public Criteria andModelNotIn(List values) { + addCriterion("model not in", values, "model"); + return (Criteria) this; + } + + public Criteria andModelBetween(String value1, String value2) { + addCriterion("model between", value1, value2, "model"); + return (Criteria) this; + } + + public Criteria andModelNotBetween(String value1, String value2) { + addCriterion("model not between", value1, value2, "model"); + return (Criteria) this; + } + + public Criteria andStandardIsNull() { + addCriterion("standard is null"); + return (Criteria) this; + } + + public Criteria andStandardIsNotNull() { + addCriterion("standard is not null"); + return (Criteria) this; + } + + public Criteria andStandardEqualTo(String value) { + addCriterion("standard =", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotEqualTo(String value) { + addCriterion("standard <>", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardGreaterThan(String value) { + addCriterion("standard >", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardGreaterThanOrEqualTo(String value) { + addCriterion("standard >=", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLessThan(String value) { + addCriterion("standard <", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLessThanOrEqualTo(String value) { + addCriterion("standard <=", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardLike(String value) { + addCriterion("standard like", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotLike(String value) { + addCriterion("standard not like", value, "standard"); + return (Criteria) this; + } + + public Criteria andStandardIn(List values) { + addCriterion("standard in", values, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotIn(List values) { + addCriterion("standard not in", values, "standard"); + return (Criteria) this; + } + + public Criteria andStandardBetween(String value1, String value2) { + addCriterion("standard between", value1, value2, "standard"); + return (Criteria) this; + } + + public Criteria andStandardNotBetween(String value1, String value2) { + addCriterion("standard not between", value1, value2, "standard"); + return (Criteria) this; + } + + public Criteria andColorIsNull() { + addCriterion("color is null"); + return (Criteria) this; + } + + public Criteria andColorIsNotNull() { + addCriterion("color is not null"); + return (Criteria) this; + } + + public Criteria andColorEqualTo(String value) { + addCriterion("color =", value, "color"); + return (Criteria) this; + } + + public Criteria andColorNotEqualTo(String value) { + addCriterion("color <>", value, "color"); + return (Criteria) this; + } + + public Criteria andColorGreaterThan(String value) { + addCriterion("color >", value, "color"); + return (Criteria) this; + } + + public Criteria andColorGreaterThanOrEqualTo(String value) { + addCriterion("color >=", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLessThan(String value) { + addCriterion("color <", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLessThanOrEqualTo(String value) { + addCriterion("color <=", value, "color"); + return (Criteria) this; + } + + public Criteria andColorLike(String value) { + addCriterion("color like", value, "color"); + return (Criteria) this; + } + + public Criteria andColorNotLike(String value) { + addCriterion("color not like", value, "color"); + return (Criteria) this; + } + + public Criteria andColorIn(List values) { + addCriterion("color in", values, "color"); + return (Criteria) this; + } + + public Criteria andColorNotIn(List values) { + addCriterion("color not in", values, "color"); + return (Criteria) this; + } + + public Criteria andColorBetween(String value1, String value2) { + addCriterion("color between", value1, value2, "color"); + return (Criteria) this; + } + + public Criteria andColorNotBetween(String value1, String value2) { + addCriterion("color not between", value1, value2, "color"); + return (Criteria) this; + } + + public Criteria andUnitIsNull() { + addCriterion("unit is null"); + return (Criteria) this; + } + + public Criteria andUnitIsNotNull() { + addCriterion("unit is not null"); + return (Criteria) this; + } + + public Criteria andUnitEqualTo(String value) { + addCriterion("unit =", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotEqualTo(String value) { + addCriterion("unit <>", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitGreaterThan(String value) { + addCriterion("unit >", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitGreaterThanOrEqualTo(String value) { + addCriterion("unit >=", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLessThan(String value) { + addCriterion("unit <", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLessThanOrEqualTo(String value) { + addCriterion("unit <=", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitLike(String value) { + addCriterion("unit like", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotLike(String value) { + addCriterion("unit not like", value, "unit"); + return (Criteria) this; + } + + public Criteria andUnitIn(List values) { + addCriterion("unit in", values, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotIn(List values) { + addCriterion("unit not in", values, "unit"); + return (Criteria) this; + } + + public Criteria andUnitBetween(String value1, String value2) { + addCriterion("unit between", value1, value2, "unit"); + return (Criteria) this; + } + + public Criteria andUnitNotBetween(String value1, String value2) { + addCriterion("unit not between", value1, value2, "unit"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andImgNameIsNull() { + addCriterion("img_name is null"); + return (Criteria) this; + } + + public Criteria andImgNameIsNotNull() { + addCriterion("img_name is not null"); + return (Criteria) this; + } + + public Criteria andImgNameEqualTo(String value) { + addCriterion("img_name =", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotEqualTo(String value) { + addCriterion("img_name <>", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameGreaterThan(String value) { + addCriterion("img_name >", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameGreaterThanOrEqualTo(String value) { + addCriterion("img_name >=", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLessThan(String value) { + addCriterion("img_name <", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLessThanOrEqualTo(String value) { + addCriterion("img_name <=", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameLike(String value) { + addCriterion("img_name like", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotLike(String value) { + addCriterion("img_name not like", value, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameIn(List values) { + addCriterion("img_name in", values, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotIn(List values) { + addCriterion("img_name not in", values, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameBetween(String value1, String value2) { + addCriterion("img_name between", value1, value2, "imgName"); + return (Criteria) this; + } + + public Criteria andImgNameNotBetween(String value1, String value2) { + addCriterion("img_name not between", value1, value2, "imgName"); + return (Criteria) this; + } + + public Criteria andUnitIdIsNull() { + addCriterion("unit_id is null"); + return (Criteria) this; + } + + public Criteria andUnitIdIsNotNull() { + addCriterion("unit_id is not null"); + return (Criteria) this; + } + + public Criteria andUnitIdEqualTo(Long value) { + addCriterion("unit_id =", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotEqualTo(Long value) { + addCriterion("unit_id <>", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdGreaterThan(Long value) { + addCriterion("unit_id >", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdGreaterThanOrEqualTo(Long value) { + addCriterion("unit_id >=", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdLessThan(Long value) { + addCriterion("unit_id <", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdLessThanOrEqualTo(Long value) { + addCriterion("unit_id <=", value, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdIn(List values) { + addCriterion("unit_id in", values, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotIn(List values) { + addCriterion("unit_id not in", values, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdBetween(Long value1, Long value2) { + addCriterion("unit_id between", value1, value2, "unitId"); + return (Criteria) this; + } + + public Criteria andUnitIdNotBetween(Long value1, Long value2) { + addCriterion("unit_id not between", value1, value2, "unitId"); + return (Criteria) this; + } + + public Criteria andExpiryNumIsNull() { + addCriterion("expiry_num is null"); + return (Criteria) this; + } + + public Criteria andExpiryNumIsNotNull() { + addCriterion("expiry_num is not null"); + return (Criteria) this; + } + + public Criteria andExpiryNumEqualTo(Integer value) { + addCriterion("expiry_num =", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotEqualTo(Integer value) { + addCriterion("expiry_num <>", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumGreaterThan(Integer value) { + addCriterion("expiry_num >", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumGreaterThanOrEqualTo(Integer value) { + addCriterion("expiry_num >=", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumLessThan(Integer value) { + addCriterion("expiry_num <", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumLessThanOrEqualTo(Integer value) { + addCriterion("expiry_num <=", value, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumIn(List values) { + addCriterion("expiry_num in", values, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotIn(List values) { + addCriterion("expiry_num not in", values, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumBetween(Integer value1, Integer value2) { + addCriterion("expiry_num between", value1, value2, "expiryNum"); + return (Criteria) this; + } + + public Criteria andExpiryNumNotBetween(Integer value1, Integer value2) { + addCriterion("expiry_num not between", value1, value2, "expiryNum"); + return (Criteria) this; + } + + public Criteria andWeightIsNull() { + addCriterion("weight is null"); + return (Criteria) this; + } + + public Criteria andWeightIsNotNull() { + addCriterion("weight is not null"); + return (Criteria) this; + } + + public Criteria andWeightEqualTo(BigDecimal value) { + addCriterion("weight =", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotEqualTo(BigDecimal value) { + addCriterion("weight <>", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightGreaterThan(BigDecimal value) { + addCriterion("weight >", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("weight >=", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightLessThan(BigDecimal value) { + addCriterion("weight <", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightLessThanOrEqualTo(BigDecimal value) { + addCriterion("weight <=", value, "weight"); + return (Criteria) this; + } + + public Criteria andWeightIn(List values) { + addCriterion("weight in", values, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotIn(List values) { + addCriterion("weight not in", values, "weight"); + return (Criteria) this; + } + + public Criteria andWeightBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("weight between", value1, value2, "weight"); + return (Criteria) this; + } + + public Criteria andWeightNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("weight not between", value1, value2, "weight"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andOtherField1IsNull() { + addCriterion("other_field1 is null"); + return (Criteria) this; + } + + public Criteria andOtherField1IsNotNull() { + addCriterion("other_field1 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField1EqualTo(String value) { + addCriterion("other_field1 =", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotEqualTo(String value) { + addCriterion("other_field1 <>", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1GreaterThan(String value) { + addCriterion("other_field1 >", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1GreaterThanOrEqualTo(String value) { + addCriterion("other_field1 >=", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1LessThan(String value) { + addCriterion("other_field1 <", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1LessThanOrEqualTo(String value) { + addCriterion("other_field1 <=", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1Like(String value) { + addCriterion("other_field1 like", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotLike(String value) { + addCriterion("other_field1 not like", value, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1In(List values) { + addCriterion("other_field1 in", values, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotIn(List values) { + addCriterion("other_field1 not in", values, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1Between(String value1, String value2) { + addCriterion("other_field1 between", value1, value2, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField1NotBetween(String value1, String value2) { + addCriterion("other_field1 not between", value1, value2, "otherField1"); + return (Criteria) this; + } + + public Criteria andOtherField2IsNull() { + addCriterion("other_field2 is null"); + return (Criteria) this; + } + + public Criteria andOtherField2IsNotNull() { + addCriterion("other_field2 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField2EqualTo(String value) { + addCriterion("other_field2 =", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotEqualTo(String value) { + addCriterion("other_field2 <>", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2GreaterThan(String value) { + addCriterion("other_field2 >", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2GreaterThanOrEqualTo(String value) { + addCriterion("other_field2 >=", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2LessThan(String value) { + addCriterion("other_field2 <", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2LessThanOrEqualTo(String value) { + addCriterion("other_field2 <=", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2Like(String value) { + addCriterion("other_field2 like", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotLike(String value) { + addCriterion("other_field2 not like", value, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2In(List values) { + addCriterion("other_field2 in", values, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotIn(List values) { + addCriterion("other_field2 not in", values, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2Between(String value1, String value2) { + addCriterion("other_field2 between", value1, value2, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField2NotBetween(String value1, String value2) { + addCriterion("other_field2 not between", value1, value2, "otherField2"); + return (Criteria) this; + } + + public Criteria andOtherField3IsNull() { + addCriterion("other_field3 is null"); + return (Criteria) this; + } + + public Criteria andOtherField3IsNotNull() { + addCriterion("other_field3 is not null"); + return (Criteria) this; + } + + public Criteria andOtherField3EqualTo(String value) { + addCriterion("other_field3 =", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotEqualTo(String value) { + addCriterion("other_field3 <>", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3GreaterThan(String value) { + addCriterion("other_field3 >", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3GreaterThanOrEqualTo(String value) { + addCriterion("other_field3 >=", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3LessThan(String value) { + addCriterion("other_field3 <", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3LessThanOrEqualTo(String value) { + addCriterion("other_field3 <=", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3Like(String value) { + addCriterion("other_field3 like", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotLike(String value) { + addCriterion("other_field3 not like", value, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3In(List values) { + addCriterion("other_field3 in", values, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotIn(List values) { + addCriterion("other_field3 not in", values, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3Between(String value1, String value2) { + addCriterion("other_field3 between", value1, value2, "otherField3"); + return (Criteria) this; + } + + public Criteria andOtherField3NotBetween(String value1, String value2) { + addCriterion("other_field3 not between", value1, value2, "otherField3"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIsNull() { + addCriterion("enable_serial_number is null"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIsNotNull() { + addCriterion("enable_serial_number is not null"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberEqualTo(String value) { + addCriterion("enable_serial_number =", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotEqualTo(String value) { + addCriterion("enable_serial_number <>", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberGreaterThan(String value) { + addCriterion("enable_serial_number >", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("enable_serial_number >=", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLessThan(String value) { + addCriterion("enable_serial_number <", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLessThanOrEqualTo(String value) { + addCriterion("enable_serial_number <=", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberLike(String value) { + addCriterion("enable_serial_number like", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotLike(String value) { + addCriterion("enable_serial_number not like", value, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberIn(List values) { + addCriterion("enable_serial_number in", values, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotIn(List values) { + addCriterion("enable_serial_number not in", values, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberBetween(String value1, String value2) { + addCriterion("enable_serial_number between", value1, value2, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableSerialNumberNotBetween(String value1, String value2) { + addCriterion("enable_serial_number not between", value1, value2, "enableSerialNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIsNull() { + addCriterion("enable_batch_number is null"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIsNotNull() { + addCriterion("enable_batch_number is not null"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberEqualTo(String value) { + addCriterion("enable_batch_number =", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotEqualTo(String value) { + addCriterion("enable_batch_number <>", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberGreaterThan(String value) { + addCriterion("enable_batch_number >", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberGreaterThanOrEqualTo(String value) { + addCriterion("enable_batch_number >=", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLessThan(String value) { + addCriterion("enable_batch_number <", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLessThanOrEqualTo(String value) { + addCriterion("enable_batch_number <=", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberLike(String value) { + addCriterion("enable_batch_number like", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotLike(String value) { + addCriterion("enable_batch_number not like", value, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberIn(List values) { + addCriterion("enable_batch_number in", values, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotIn(List values) { + addCriterion("enable_batch_number not in", values, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberBetween(String value1, String value2) { + addCriterion("enable_batch_number between", value1, value2, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andEnableBatchNumberNotBetween(String value1, String value2) { + addCriterion("enable_batch_number not between", value1, value2, "enableBatchNumber"); + return (Criteria) this; + } + + public Criteria andPositionIsNull() { + addCriterion("position is null"); + return (Criteria) this; + } + + public Criteria andPositionIsNotNull() { + addCriterion("position is not null"); + return (Criteria) this; + } + + public Criteria andPositionEqualTo(String value) { + addCriterion("position =", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotEqualTo(String value) { + addCriterion("position <>", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThan(String value) { + addCriterion("position >", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThanOrEqualTo(String value) { + addCriterion("position >=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThan(String value) { + addCriterion("position <", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThanOrEqualTo(String value) { + addCriterion("position <=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLike(String value) { + addCriterion("position like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotLike(String value) { + addCriterion("position not like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionIn(List values) { + addCriterion("position in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotIn(List values) { + addCriterion("position not in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionBetween(String value1, String value2) { + addCriterion("position between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotBetween(String value1, String value2) { + addCriterion("position not between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialExtend.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialExtend.java new file mode 100644 index 00000000..8be60a58 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialExtend.java @@ -0,0 +1,41 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class MaterialExtend { + private Long id; + + private Long materialId; + + private String barCode; + + private String commodityUnit; + + private String sku; + + private BigDecimal purchaseDecimal; + + private BigDecimal commodityDecimal; + + private BigDecimal wholesaleDecimal; + + private BigDecimal lowDecimal; + + private String defaultFlag; + + private Date createTime; + + private String createSerial; + + private String updateSerial; + + private Long updateTime; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialExtendExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialExtendExample.java new file mode 100644 index 00000000..a45b3b6c --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialExtendExample.java @@ -0,0 +1,1231 @@ +package com.wansensoft.entities.material; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MaterialExtendExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialExtendExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andBarCodeIsNull() { + addCriterion("bar_code is null"); + return (Criteria) this; + } + + public Criteria andBarCodeIsNotNull() { + addCriterion("bar_code is not null"); + return (Criteria) this; + } + + public Criteria andBarCodeEqualTo(String value) { + addCriterion("bar_code =", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotEqualTo(String value) { + addCriterion("bar_code <>", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeGreaterThan(String value) { + addCriterion("bar_code >", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeGreaterThanOrEqualTo(String value) { + addCriterion("bar_code >=", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLessThan(String value) { + addCriterion("bar_code <", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLessThanOrEqualTo(String value) { + addCriterion("bar_code <=", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeLike(String value) { + addCriterion("bar_code like", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotLike(String value) { + addCriterion("bar_code not like", value, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeIn(List values) { + addCriterion("bar_code in", values, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotIn(List values) { + addCriterion("bar_code not in", values, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeBetween(String value1, String value2) { + addCriterion("bar_code between", value1, value2, "barCode"); + return (Criteria) this; + } + + public Criteria andBarCodeNotBetween(String value1, String value2) { + addCriterion("bar_code not between", value1, value2, "barCode"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIsNull() { + addCriterion("commodity_unit is null"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIsNotNull() { + addCriterion("commodity_unit is not null"); + return (Criteria) this; + } + + public Criteria andCommodityUnitEqualTo(String value) { + addCriterion("commodity_unit =", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotEqualTo(String value) { + addCriterion("commodity_unit <>", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitGreaterThan(String value) { + addCriterion("commodity_unit >", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitGreaterThanOrEqualTo(String value) { + addCriterion("commodity_unit >=", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLessThan(String value) { + addCriterion("commodity_unit <", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLessThanOrEqualTo(String value) { + addCriterion("commodity_unit <=", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitLike(String value) { + addCriterion("commodity_unit like", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotLike(String value) { + addCriterion("commodity_unit not like", value, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitIn(List values) { + addCriterion("commodity_unit in", values, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotIn(List values) { + addCriterion("commodity_unit not in", values, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitBetween(String value1, String value2) { + addCriterion("commodity_unit between", value1, value2, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andCommodityUnitNotBetween(String value1, String value2) { + addCriterion("commodity_unit not between", value1, value2, "commodityUnit"); + return (Criteria) this; + } + + public Criteria andSkuIsNull() { + addCriterion("sku is null"); + return (Criteria) this; + } + + public Criteria andSkuIsNotNull() { + addCriterion("sku is not null"); + return (Criteria) this; + } + + public Criteria andSkuEqualTo(String value) { + addCriterion("sku =", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotEqualTo(String value) { + addCriterion("sku <>", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThan(String value) { + addCriterion("sku >", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuGreaterThanOrEqualTo(String value) { + addCriterion("sku >=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThan(String value) { + addCriterion("sku <", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLessThanOrEqualTo(String value) { + addCriterion("sku <=", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuLike(String value) { + addCriterion("sku like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotLike(String value) { + addCriterion("sku not like", value, "sku"); + return (Criteria) this; + } + + public Criteria andSkuIn(List values) { + addCriterion("sku in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotIn(List values) { + addCriterion("sku not in", values, "sku"); + return (Criteria) this; + } + + public Criteria andSkuBetween(String value1, String value2) { + addCriterion("sku between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andSkuNotBetween(String value1, String value2) { + addCriterion("sku not between", value1, value2, "sku"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIsNull() { + addCriterion("purchase_decimal is null"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIsNotNull() { + addCriterion("purchase_decimal is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalEqualTo(BigDecimal value) { + addCriterion("purchase_decimal =", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotEqualTo(BigDecimal value) { + addCriterion("purchase_decimal <>", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalGreaterThan(BigDecimal value) { + addCriterion("purchase_decimal >", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_decimal >=", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalLessThan(BigDecimal value) { + addCriterion("purchase_decimal <", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("purchase_decimal <=", value, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalIn(List values) { + addCriterion("purchase_decimal in", values, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotIn(List values) { + addCriterion("purchase_decimal not in", values, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_decimal between", value1, value2, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andPurchaseDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("purchase_decimal not between", value1, value2, "purchaseDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIsNull() { + addCriterion("commodity_decimal is null"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIsNotNull() { + addCriterion("commodity_decimal is not null"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalEqualTo(BigDecimal value) { + addCriterion("commodity_decimal =", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotEqualTo(BigDecimal value) { + addCriterion("commodity_decimal <>", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalGreaterThan(BigDecimal value) { + addCriterion("commodity_decimal >", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("commodity_decimal >=", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalLessThan(BigDecimal value) { + addCriterion("commodity_decimal <", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("commodity_decimal <=", value, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalIn(List values) { + addCriterion("commodity_decimal in", values, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotIn(List values) { + addCriterion("commodity_decimal not in", values, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("commodity_decimal between", value1, value2, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andCommodityDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("commodity_decimal not between", value1, value2, "commodityDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIsNull() { + addCriterion("wholesale_decimal is null"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIsNotNull() { + addCriterion("wholesale_decimal is not null"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal =", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal <>", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalGreaterThan(BigDecimal value) { + addCriterion("wholesale_decimal >", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal >=", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalLessThan(BigDecimal value) { + addCriterion("wholesale_decimal <", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("wholesale_decimal <=", value, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalIn(List values) { + addCriterion("wholesale_decimal in", values, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotIn(List values) { + addCriterion("wholesale_decimal not in", values, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("wholesale_decimal between", value1, value2, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andWholesaleDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("wholesale_decimal not between", value1, value2, "wholesaleDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalIsNull() { + addCriterion("low_decimal is null"); + return (Criteria) this; + } + + public Criteria andLowDecimalIsNotNull() { + addCriterion("low_decimal is not null"); + return (Criteria) this; + } + + public Criteria andLowDecimalEqualTo(BigDecimal value) { + addCriterion("low_decimal =", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotEqualTo(BigDecimal value) { + addCriterion("low_decimal <>", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalGreaterThan(BigDecimal value) { + addCriterion("low_decimal >", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("low_decimal >=", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalLessThan(BigDecimal value) { + addCriterion("low_decimal <", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalLessThanOrEqualTo(BigDecimal value) { + addCriterion("low_decimal <=", value, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalIn(List values) { + addCriterion("low_decimal in", values, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotIn(List values) { + addCriterion("low_decimal not in", values, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_decimal between", value1, value2, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andLowDecimalNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_decimal not between", value1, value2, "lowDecimal"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIsNull() { + addCriterion("default_flag is null"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIsNotNull() { + addCriterion("default_flag is not null"); + return (Criteria) this; + } + + public Criteria andDefaultFlagEqualTo(String value) { + addCriterion("default_flag =", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotEqualTo(String value) { + addCriterion("default_flag <>", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagGreaterThan(String value) { + addCriterion("default_flag >", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagGreaterThanOrEqualTo(String value) { + addCriterion("default_flag >=", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLessThan(String value) { + addCriterion("default_flag <", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLessThanOrEqualTo(String value) { + addCriterion("default_flag <=", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagLike(String value) { + addCriterion("default_flag like", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotLike(String value) { + addCriterion("default_flag not like", value, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagIn(List values) { + addCriterion("default_flag in", values, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotIn(List values) { + addCriterion("default_flag not in", values, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagBetween(String value1, String value2) { + addCriterion("default_flag between", value1, value2, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andDefaultFlagNotBetween(String value1, String value2) { + addCriterion("default_flag not between", value1, value2, "defaultFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateSerialIsNull() { + addCriterion("create_serial is null"); + return (Criteria) this; + } + + public Criteria andCreateSerialIsNotNull() { + addCriterion("create_serial is not null"); + return (Criteria) this; + } + + public Criteria andCreateSerialEqualTo(String value) { + addCriterion("create_serial =", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotEqualTo(String value) { + addCriterion("create_serial <>", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialGreaterThan(String value) { + addCriterion("create_serial >", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialGreaterThanOrEqualTo(String value) { + addCriterion("create_serial >=", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLessThan(String value) { + addCriterion("create_serial <", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLessThanOrEqualTo(String value) { + addCriterion("create_serial <=", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialLike(String value) { + addCriterion("create_serial like", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotLike(String value) { + addCriterion("create_serial not like", value, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialIn(List values) { + addCriterion("create_serial in", values, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotIn(List values) { + addCriterion("create_serial not in", values, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialBetween(String value1, String value2) { + addCriterion("create_serial between", value1, value2, "createSerial"); + return (Criteria) this; + } + + public Criteria andCreateSerialNotBetween(String value1, String value2) { + addCriterion("create_serial not between", value1, value2, "createSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIsNull() { + addCriterion("update_serial is null"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIsNotNull() { + addCriterion("update_serial is not null"); + return (Criteria) this; + } + + public Criteria andUpdateSerialEqualTo(String value) { + addCriterion("update_serial =", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotEqualTo(String value) { + addCriterion("update_serial <>", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialGreaterThan(String value) { + addCriterion("update_serial >", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialGreaterThanOrEqualTo(String value) { + addCriterion("update_serial >=", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLessThan(String value) { + addCriterion("update_serial <", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLessThanOrEqualTo(String value) { + addCriterion("update_serial <=", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialLike(String value) { + addCriterion("update_serial like", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotLike(String value) { + addCriterion("update_serial not like", value, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialIn(List values) { + addCriterion("update_serial in", values, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotIn(List values) { + addCriterion("update_serial not in", values, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialBetween(String value1, String value2) { + addCriterion("update_serial between", value1, value2, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateSerialNotBetween(String value1, String value2) { + addCriterion("update_serial not between", value1, value2, "updateSerial"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStock.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStock.java new file mode 100644 index 00000000..6190a70c --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStock.java @@ -0,0 +1,24 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class MaterialInitialStock { + private Long id; + + private Long materialId; + + private Long depotId; + + private BigDecimal number; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockExample.java new file mode 100644 index 00000000..87c43555 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockExample.java @@ -0,0 +1,690 @@ +package com.wansensoft.entities.material; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class MaterialInitialStockExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialInitialStockExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andNumberIsNull() { + addCriterion("number is null"); + return (Criteria) this; + } + + public Criteria andNumberIsNotNull() { + addCriterion("number is not null"); + return (Criteria) this; + } + + public Criteria andNumberEqualTo(BigDecimal value) { + addCriterion("number =", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotEqualTo(BigDecimal value) { + addCriterion("number <>", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThan(BigDecimal value) { + addCriterion("number >", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("number >=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThan(BigDecimal value) { + addCriterion("number <", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberLessThanOrEqualTo(BigDecimal value) { + addCriterion("number <=", value, "number"); + return (Criteria) this; + } + + public Criteria andNumberIn(List values) { + addCriterion("number in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotIn(List values) { + addCriterion("number not in", values, "number"); + return (Criteria) this; + } + + public Criteria andNumberBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("number between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andNumberNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("number not between", value1, value2, "number"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIsNull() { + addCriterion("low_safe_stock is null"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIsNotNull() { + addCriterion("low_safe_stock is not null"); + return (Criteria) this; + } + + public Criteria andLowSafeStockEqualTo(BigDecimal value) { + addCriterion("low_safe_stock =", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotEqualTo(BigDecimal value) { + addCriterion("low_safe_stock <>", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockGreaterThan(BigDecimal value) { + addCriterion("low_safe_stock >", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("low_safe_stock >=", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockLessThan(BigDecimal value) { + addCriterion("low_safe_stock <", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockLessThanOrEqualTo(BigDecimal value) { + addCriterion("low_safe_stock <=", value, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockIn(List values) { + addCriterion("low_safe_stock in", values, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotIn(List values) { + addCriterion("low_safe_stock not in", values, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_safe_stock between", value1, value2, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andLowSafeStockNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("low_safe_stock not between", value1, value2, "lowSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIsNull() { + addCriterion("high_safe_stock is null"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIsNotNull() { + addCriterion("high_safe_stock is not null"); + return (Criteria) this; + } + + public Criteria andHighSafeStockEqualTo(BigDecimal value) { + addCriterion("high_safe_stock =", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotEqualTo(BigDecimal value) { + addCriterion("high_safe_stock <>", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockGreaterThan(BigDecimal value) { + addCriterion("high_safe_stock >", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("high_safe_stock >=", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockLessThan(BigDecimal value) { + addCriterion("high_safe_stock <", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockLessThanOrEqualTo(BigDecimal value) { + addCriterion("high_safe_stock <=", value, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockIn(List values) { + addCriterion("high_safe_stock in", values, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotIn(List values) { + addCriterion("high_safe_stock not in", values, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("high_safe_stock between", value1, value2, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andHighSafeStockNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("high_safe_stock not between", value1, value2, "highSafeStock"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockWithMaterial.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockWithMaterial.java new file mode 100644 index 00000000..c2283dc0 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialInitialStockWithMaterial.java @@ -0,0 +1,13 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class MaterialInitialStockWithMaterial { + + private Long materialId; + + private BigDecimal number; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialProperty.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialProperty.java new file mode 100644 index 00000000..b8b7d53b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialProperty.java @@ -0,0 +1,18 @@ +package com.wansensoft.entities.material; + +import lombok.Data; + +@Data +public class MaterialProperty { + private Long id; + + private String nativeName; + + private Boolean enabled; + + private String sort; + + private String anotherName; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialPropertyExample.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialPropertyExample.java new file mode 100644 index 00000000..90479c2f --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialPropertyExample.java @@ -0,0 +1,599 @@ +package com.wansensoft.entities.material; + +import java.util.ArrayList; +import java.util.List; + +public class MaterialPropertyExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MaterialPropertyExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNativeNameIsNull() { + addCriterion("native_name is null"); + return (Criteria) this; + } + + public Criteria andNativeNameIsNotNull() { + addCriterion("native_name is not null"); + return (Criteria) this; + } + + public Criteria andNativeNameEqualTo(String value) { + addCriterion("native_name =", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotEqualTo(String value) { + addCriterion("native_name <>", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameGreaterThan(String value) { + addCriterion("native_name >", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameGreaterThanOrEqualTo(String value) { + addCriterion("native_name >=", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLessThan(String value) { + addCriterion("native_name <", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLessThanOrEqualTo(String value) { + addCriterion("native_name <=", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameLike(String value) { + addCriterion("native_name like", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotLike(String value) { + addCriterion("native_name not like", value, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameIn(List values) { + addCriterion("native_name in", values, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotIn(List values) { + addCriterion("native_name not in", values, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameBetween(String value1, String value2) { + addCriterion("native_name between", value1, value2, "nativeName"); + return (Criteria) this; + } + + public Criteria andNativeNameNotBetween(String value1, String value2) { + addCriterion("native_name not between", value1, value2, "nativeName"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andAnotherNameIsNull() { + addCriterion("another_name is null"); + return (Criteria) this; + } + + public Criteria andAnotherNameIsNotNull() { + addCriterion("another_name is not null"); + return (Criteria) this; + } + + public Criteria andAnotherNameEqualTo(String value) { + addCriterion("another_name =", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotEqualTo(String value) { + addCriterion("another_name <>", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameGreaterThan(String value) { + addCriterion("another_name >", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameGreaterThanOrEqualTo(String value) { + addCriterion("another_name >=", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLessThan(String value) { + addCriterion("another_name <", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLessThanOrEqualTo(String value) { + addCriterion("another_name <=", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameLike(String value) { + addCriterion("another_name like", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotLike(String value) { + addCriterion("another_name not like", value, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameIn(List values) { + addCriterion("another_name in", values, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotIn(List values) { + addCriterion("another_name not in", values, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameBetween(String value1, String value2) { + addCriterion("another_name between", value1, value2, "anotherName"); + return (Criteria) this; + } + + public Criteria andAnotherNameNotBetween(String value1, String value2) { + addCriterion("another_name not between", value1, value2, "anotherName"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialVo4Unit.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialVo4Unit.java new file mode 100644 index 00000000..40344a86 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialVo4Unit.java @@ -0,0 +1,58 @@ +package com.wansensoft.entities.material; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +@EqualsAndHashCode(callSuper = true) +@Data +public class MaterialVo4Unit extends Material{ + + private String unitName; + + private BigDecimal ratio; + + private String categoryName; + + private String materialOther; + + private BigDecimal stock; + + private BigDecimal purchaseDecimal; + + private BigDecimal commodityDecimal; + + private BigDecimal wholesaleDecimal; + + private BigDecimal lowDecimal; + + private BigDecimal billPrice; + + private String mBarCode; + + private String commodityUnit; + + private Long meId; + + private BigDecimal initialStock; + + private BigDecimal currentStock; + + private BigDecimal currentStockPrice; + + private BigDecimal currentWeight; + + private String sku; + + private Long depotId; + + /** + * 换算为大单位的库存 + */ + private String bigUnitStock; + + private String imgSmall; + + private String imgLarge; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/material/MaterialWithInitStock.java b/domain/src/main/java/com/wansensoft/entities/material/MaterialWithInitStock.java new file mode 100644 index 00000000..a57e3f41 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/material/MaterialWithInitStock.java @@ -0,0 +1,15 @@ +package com.wansensoft.entities.material; + +import com.alibaba.fastjson.JSONObject; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Map; + +@Data +public class MaterialWithInitStock extends Material { + + private Map stockMap; + + private JSONObject materialExObj; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/msg/Msg.java b/domain/src/main/java/com/wansensoft/entities/msg/Msg.java new file mode 100644 index 00000000..70c05d8c --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/msg/Msg.java @@ -0,0 +1,26 @@ +package com.wansensoft.entities.msg; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Msg { + private Long id; + + private String msgTitle; + + private String msgContent; + + private Date createTime; + + private String type; + + private Long userId; + + private String status; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/msg/MsgEx.java b/domain/src/main/java/com/wansensoft/entities/msg/MsgEx.java new file mode 100644 index 00000000..1bfd97e3 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/msg/MsgEx.java @@ -0,0 +1,9 @@ +package com.wansensoft.entities.msg; + +import lombok.Data; + +@Data +public class MsgEx extends Msg{ + + private String createTimeStr; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/msg/MsgExample.java b/domain/src/main/java/com/wansensoft/entities/msg/MsgExample.java new file mode 100644 index 00000000..9d32b3e5 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/msg/MsgExample.java @@ -0,0 +1,790 @@ +package com.wansensoft.entities.msg; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MsgExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public MsgExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMsgTitleIsNull() { + addCriterion("msg_title is null"); + return (Criteria) this; + } + + public Criteria andMsgTitleIsNotNull() { + addCriterion("msg_title is not null"); + return (Criteria) this; + } + + public Criteria andMsgTitleEqualTo(String value) { + addCriterion("msg_title =", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotEqualTo(String value) { + addCriterion("msg_title <>", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleGreaterThan(String value) { + addCriterion("msg_title >", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleGreaterThanOrEqualTo(String value) { + addCriterion("msg_title >=", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLessThan(String value) { + addCriterion("msg_title <", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLessThanOrEqualTo(String value) { + addCriterion("msg_title <=", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleLike(String value) { + addCriterion("msg_title like", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotLike(String value) { + addCriterion("msg_title not like", value, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleIn(List values) { + addCriterion("msg_title in", values, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotIn(List values) { + addCriterion("msg_title not in", values, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleBetween(String value1, String value2) { + addCriterion("msg_title between", value1, value2, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgTitleNotBetween(String value1, String value2) { + addCriterion("msg_title not between", value1, value2, "msgTitle"); + return (Criteria) this; + } + + public Criteria andMsgContentIsNull() { + addCriterion("msg_content is null"); + return (Criteria) this; + } + + public Criteria andMsgContentIsNotNull() { + addCriterion("msg_content is not null"); + return (Criteria) this; + } + + public Criteria andMsgContentEqualTo(String value) { + addCriterion("msg_content =", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotEqualTo(String value) { + addCriterion("msg_content <>", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentGreaterThan(String value) { + addCriterion("msg_content >", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentGreaterThanOrEqualTo(String value) { + addCriterion("msg_content >=", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLessThan(String value) { + addCriterion("msg_content <", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLessThanOrEqualTo(String value) { + addCriterion("msg_content <=", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentLike(String value) { + addCriterion("msg_content like", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotLike(String value) { + addCriterion("msg_content not like", value, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentIn(List values) { + addCriterion("msg_content in", values, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotIn(List values) { + addCriterion("msg_content not in", values, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentBetween(String value1, String value2) { + addCriterion("msg_content between", value1, value2, "msgContent"); + return (Criteria) this; + } + + public Criteria andMsgContentNotBetween(String value1, String value2) { + addCriterion("msg_content not between", value1, value2, "msgContent"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_Flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_Flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_Flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_Flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_Flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_Flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_Flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_Flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_Flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_Flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_Flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_Flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_Flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_Flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRel.java b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRel.java new file mode 100644 index 00000000..d23bd241 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRel.java @@ -0,0 +1,88 @@ +package com.wansensoft.entities.organization; + +import lombok.Data; + +import java.util.Date; + +@Data +public class OrgaUserRel { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.id + * + * @mbggenerated + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.orga_id + * + * @mbggenerated + */ + private Long orgaId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.user_id + * + * @mbggenerated + */ + private Long userId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.user_blng_orga_dspl_seq + * + * @mbggenerated + */ + private String userBlngOrgaDsplSeq; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.delete_flag + * + * @mbggenerated + */ + private String deleteFlag; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.create_time + * + * @mbggenerated + */ + private Date createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.creator + * + * @mbggenerated + */ + private Long creator; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.update_time + * + * @mbggenerated + */ + private Date updateTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.updater + * + * @mbggenerated + */ + private Long updater; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_orga_user_rel.tenant_id + * + * @mbggenerated + */ + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelEx.java b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelEx.java new file mode 100644 index 00000000..30b12975 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelEx.java @@ -0,0 +1,10 @@ +package com.wansensoft.entities.organization; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/3/12 10:09 + */ +public class OrgaUserRelEx extends OrgaUserRel { +} diff --git a/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelExample.java b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelExample.java new file mode 100644 index 00000000..ae02d079 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/organization/OrgaUserRelExample.java @@ -0,0 +1,923 @@ +package com.wansensoft.entities.organization; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class OrgaUserRelExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public OrgaUserRelExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrgaIdIsNull() { + addCriterion("orga_id is null"); + return (Criteria) this; + } + + public Criteria andOrgaIdIsNotNull() { + addCriterion("orga_id is not null"); + return (Criteria) this; + } + + public Criteria andOrgaIdEqualTo(Long value) { + addCriterion("orga_id =", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotEqualTo(Long value) { + addCriterion("orga_id <>", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdGreaterThan(Long value) { + addCriterion("orga_id >", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdGreaterThanOrEqualTo(Long value) { + addCriterion("orga_id >=", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdLessThan(Long value) { + addCriterion("orga_id <", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdLessThanOrEqualTo(Long value) { + addCriterion("orga_id <=", value, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdIn(List values) { + addCriterion("orga_id in", values, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotIn(List values) { + addCriterion("orga_id not in", values, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdBetween(Long value1, Long value2) { + addCriterion("orga_id between", value1, value2, "orgaId"); + return (Criteria) this; + } + + public Criteria andOrgaIdNotBetween(Long value1, Long value2) { + addCriterion("orga_id not between", value1, value2, "orgaId"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIsNull() { + addCriterion("user_blng_orga_dspl_seq is null"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIsNotNull() { + addCriterion("user_blng_orga_dspl_seq is not null"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq =", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq <>", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqGreaterThan(String value) { + addCriterion("user_blng_orga_dspl_seq >", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqGreaterThanOrEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq >=", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLessThan(String value) { + addCriterion("user_blng_orga_dspl_seq <", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLessThanOrEqualTo(String value) { + addCriterion("user_blng_orga_dspl_seq <=", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqLike(String value) { + addCriterion("user_blng_orga_dspl_seq like", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotLike(String value) { + addCriterion("user_blng_orga_dspl_seq not like", value, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqIn(List values) { + addCriterion("user_blng_orga_dspl_seq in", values, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotIn(List values) { + addCriterion("user_blng_orga_dspl_seq not in", values, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqBetween(String value1, String value2) { + addCriterion("user_blng_orga_dspl_seq between", value1, value2, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andUserBlngOrgaDsplSeqNotBetween(String value1, String value2) { + addCriterion("user_blng_orga_dspl_seq not between", value1, value2, "userBlngOrgaDsplSeq"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(Long value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(Long value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(Long value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(Long value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(Long value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(Long value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(Long value1, Long value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(Long value1, Long value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_orga_user_rel + * + * @mbggenerated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/organization/Organization.java b/domain/src/main/java/com/wansensoft/entities/organization/Organization.java new file mode 100644 index 00000000..77808546 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/organization/Organization.java @@ -0,0 +1,28 @@ +package com.wansensoft.entities.organization; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Organization { + private Long id; + + private String orgNo; + + private String orgAbr; + + private Long parentId; + + private String sort; + + private String remark; + + private Date createTime; + + private Date updateTime; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/organization/OrganizationExample.java b/domain/src/main/java/com/wansensoft/entities/organization/OrganizationExample.java new file mode 100644 index 00000000..7df17eac --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/organization/OrganizationExample.java @@ -0,0 +1,850 @@ +package com.wansensoft.entities.organization; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class OrganizationExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public OrganizationExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andOrgNoIsNull() { + addCriterion("org_no is null"); + return (Criteria) this; + } + + public Criteria andOrgNoIsNotNull() { + addCriterion("org_no is not null"); + return (Criteria) this; + } + + public Criteria andOrgNoEqualTo(String value) { + addCriterion("org_no =", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotEqualTo(String value) { + addCriterion("org_no <>", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoGreaterThan(String value) { + addCriterion("org_no >", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoGreaterThanOrEqualTo(String value) { + addCriterion("org_no >=", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLessThan(String value) { + addCriterion("org_no <", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLessThanOrEqualTo(String value) { + addCriterion("org_no <=", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoLike(String value) { + addCriterion("org_no like", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotLike(String value) { + addCriterion("org_no not like", value, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoIn(List values) { + addCriterion("org_no in", values, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotIn(List values) { + addCriterion("org_no not in", values, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoBetween(String value1, String value2) { + addCriterion("org_no between", value1, value2, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgNoNotBetween(String value1, String value2) { + addCriterion("org_no not between", value1, value2, "orgNo"); + return (Criteria) this; + } + + public Criteria andOrgAbrIsNull() { + addCriterion("org_abr is null"); + return (Criteria) this; + } + + public Criteria andOrgAbrIsNotNull() { + addCriterion("org_abr is not null"); + return (Criteria) this; + } + + public Criteria andOrgAbrEqualTo(String value) { + addCriterion("org_abr =", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotEqualTo(String value) { + addCriterion("org_abr <>", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrGreaterThan(String value) { + addCriterion("org_abr >", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrGreaterThanOrEqualTo(String value) { + addCriterion("org_abr >=", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLessThan(String value) { + addCriterion("org_abr <", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLessThanOrEqualTo(String value) { + addCriterion("org_abr <=", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrLike(String value) { + addCriterion("org_abr like", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotLike(String value) { + addCriterion("org_abr not like", value, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrIn(List values) { + addCriterion("org_abr in", values, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotIn(List values) { + addCriterion("org_abr not in", values, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrBetween(String value1, String value2) { + addCriterion("org_abr between", value1, value2, "orgAbr"); + return (Criteria) this; + } + + public Criteria andOrgAbrNotBetween(String value1, String value2) { + addCriterion("org_abr not between", value1, value2, "orgAbr"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/person/Person.java b/domain/src/main/java/com/wansensoft/entities/person/Person.java new file mode 100644 index 00000000..6cd02471 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/person/Person.java @@ -0,0 +1,20 @@ +package com.wansensoft.entities.person; + +import lombok.Data; + +@Data +public class Person { + private Long id; + + private String type; + + private String name; + + private Boolean enabled; + + private String sort; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/person/PersonExample.java b/domain/src/main/java/com/wansensoft/entities/person/PersonExample.java new file mode 100644 index 00000000..fd430069 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/person/PersonExample.java @@ -0,0 +1,659 @@ +package com.wansensoft.entities.person; + +import java.util.ArrayList; +import java.util.List; + +public class PersonExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PersonExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfig.java b/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfig.java new file mode 100644 index 00000000..a054bd42 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfig.java @@ -0,0 +1,14 @@ +package com.wansensoft.entities.platformConfig; + +import lombok.Data; + +@Data +public class PlatformConfig { + private Long id; + + private String platformKey; + + private String platformKeyInfo; + + private String platformValue; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfigExample.java b/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfigExample.java new file mode 100644 index 00000000..1e5e54e8 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/platformConfig/PlatformConfigExample.java @@ -0,0 +1,469 @@ +package com.wansensoft.entities.platformConfig; + +import java.util.ArrayList; +import java.util.List; + +public class PlatformConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public PlatformConfigExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIsNull() { + addCriterion("platform_key is null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIsNotNull() { + addCriterion("platform_key is not null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyEqualTo(String value) { + addCriterion("platform_key =", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotEqualTo(String value) { + addCriterion("platform_key <>", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyGreaterThan(String value) { + addCriterion("platform_key >", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyGreaterThanOrEqualTo(String value) { + addCriterion("platform_key >=", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLessThan(String value) { + addCriterion("platform_key <", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLessThanOrEqualTo(String value) { + addCriterion("platform_key <=", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyLike(String value) { + addCriterion("platform_key like", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotLike(String value) { + addCriterion("platform_key not like", value, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyIn(List values) { + addCriterion("platform_key in", values, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotIn(List values) { + addCriterion("platform_key not in", values, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyBetween(String value1, String value2) { + addCriterion("platform_key between", value1, value2, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyNotBetween(String value1, String value2) { + addCriterion("platform_key not between", value1, value2, "platformKey"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIsNull() { + addCriterion("platform_key_info is null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIsNotNull() { + addCriterion("platform_key_info is not null"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoEqualTo(String value) { + addCriterion("platform_key_info =", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotEqualTo(String value) { + addCriterion("platform_key_info <>", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoGreaterThan(String value) { + addCriterion("platform_key_info >", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoGreaterThanOrEqualTo(String value) { + addCriterion("platform_key_info >=", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLessThan(String value) { + addCriterion("platform_key_info <", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLessThanOrEqualTo(String value) { + addCriterion("platform_key_info <=", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoLike(String value) { + addCriterion("platform_key_info like", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotLike(String value) { + addCriterion("platform_key_info not like", value, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoIn(List values) { + addCriterion("platform_key_info in", values, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotIn(List values) { + addCriterion("platform_key_info not in", values, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoBetween(String value1, String value2) { + addCriterion("platform_key_info between", value1, value2, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformKeyInfoNotBetween(String value1, String value2) { + addCriterion("platform_key_info not between", value1, value2, "platformKeyInfo"); + return (Criteria) this; + } + + public Criteria andPlatformValueIsNull() { + addCriterion("platform_value is null"); + return (Criteria) this; + } + + public Criteria andPlatformValueIsNotNull() { + addCriterion("platform_value is not null"); + return (Criteria) this; + } + + public Criteria andPlatformValueEqualTo(String value) { + addCriterion("platform_value =", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotEqualTo(String value) { + addCriterion("platform_value <>", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueGreaterThan(String value) { + addCriterion("platform_value >", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueGreaterThanOrEqualTo(String value) { + addCriterion("platform_value >=", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLessThan(String value) { + addCriterion("platform_value <", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLessThanOrEqualTo(String value) { + addCriterion("platform_value <=", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueLike(String value) { + addCriterion("platform_value like", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotLike(String value) { + addCriterion("platform_value not like", value, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueIn(List values) { + addCriterion("platform_value in", values, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotIn(List values) { + addCriterion("platform_value not in", values, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueBetween(String value1, String value2) { + addCriterion("platform_value between", value1, value2, "platformValue"); + return (Criteria) this; + } + + public Criteria andPlatformValueNotBetween(String value1, String value2) { + addCriterion("platform_value not between", value1, value2, "platformValue"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/role/Role.java b/domain/src/main/java/com/wansensoft/entities/role/Role.java new file mode 100644 index 00000000..979d4099 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/role/Role.java @@ -0,0 +1,26 @@ +package com.wansensoft.entities.role; + +import lombok.Data; + +@Data +public class Role { + private Long id; + + private String name; + + private String type; + + private String priceLimit; + + private String value; + + private String description; + + private Boolean enabled; + + private String sort; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/role/RoleEx.java b/domain/src/main/java/com/wansensoft/entities/role/RoleEx.java new file mode 100644 index 00000000..4791bd30 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/role/RoleEx.java @@ -0,0 +1,9 @@ +package com.wansensoft.entities.role; + +import lombok.Data; + +@Data +public class RoleEx extends Role{ + + private String priceLimitStr; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/role/RoleExample.java b/domain/src/main/java/com/wansensoft/entities/role/RoleExample.java new file mode 100644 index 00000000..71fab235 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/role/RoleExample.java @@ -0,0 +1,869 @@ +package com.wansensoft.entities.role; + +import java.util.ArrayList; +import java.util.List; + +public class RoleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public RoleExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andPriceLimitIsNull() { + addCriterion("price_limit is null"); + return (Criteria) this; + } + + public Criteria andPriceLimitIsNotNull() { + addCriterion("price_limit is not null"); + return (Criteria) this; + } + + public Criteria andPriceLimitEqualTo(String value) { + addCriterion("price_limit =", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitNotEqualTo(String value) { + addCriterion("price_limit <>", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitGreaterThan(String value) { + addCriterion("price_limit >", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitGreaterThanOrEqualTo(String value) { + addCriterion("price_limit >=", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitLessThan(String value) { + addCriterion("price_limit <", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitLessThanOrEqualTo(String value) { + addCriterion("price_limit <=", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitLike(String value) { + addCriterion("price_limit like", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitNotLike(String value) { + addCriterion("price_limit not like", value, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitIn(List values) { + addCriterion("price_limit in", values, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitNotIn(List values) { + addCriterion("price_limit not in", values, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitBetween(String value1, String value2) { + addCriterion("price_limit between", value1, value2, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitNotBetween(String value1, String value2) { + addCriterion("price_limit not between", value1, value2, "priceLimit"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("value is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("value is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("value =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("value <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("value >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("value >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("value <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("value <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("value like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("value not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("value in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("value not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("value between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("value not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumber.java b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumber.java new file mode 100644 index 00000000..fe7947db --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumber.java @@ -0,0 +1,36 @@ +package com.wansensoft.entities.serialNumber; + +import lombok.Data; + +import java.util.Date; + +@Data +public class SerialNumber { + private Long id; + + private Long materialId; + + private Long depotId; + + private String serialNumber; + + private String isSell; + + private String remark; + + private String deleteFlag; + + private Date createTime; + + private Long creator; + + private Date updateTime; + + private Long updater; + + private String inBillNo; + + private String outBillNo; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberEx.java b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberEx.java new file mode 100644 index 00000000..f99fa389 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberEx.java @@ -0,0 +1,33 @@ +package com.wansensoft.entities.serialNumber; + +import lombok.Data; + +@Data +public class SerialNumberEx extends SerialNumber{ + /** + * 商品条码 + * */ + private String materialCode; + /** + * 商品名称 + * */ + private String materialName; + /** + * 创建者名称 + * */ + private String creatorName; + /** + * 更新者名称 + * */ + private String updaterName; + /**单据编号*/ + private String depotHeadNumber; + /**单据类型(出库入库)*/ + private String depotHeadType; + + private String depotName; + + private String createTimeStr; + + private String updateTimeStr; +} diff --git a/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberExample.java b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberExample.java new file mode 100644 index 00000000..003bbb48 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/serialNumber/SerialNumberExample.java @@ -0,0 +1,1100 @@ +package com.wansensoft.entities.serialNumber; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SerialNumberExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SerialNumberExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNull() { + addCriterion("material_id is null"); + return (Criteria) this; + } + + public Criteria andMaterialIdIsNotNull() { + addCriterion("material_id is not null"); + return (Criteria) this; + } + + public Criteria andMaterialIdEqualTo(Long value) { + addCriterion("material_id =", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotEqualTo(Long value) { + addCriterion("material_id <>", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThan(Long value) { + addCriterion("material_id >", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdGreaterThanOrEqualTo(Long value) { + addCriterion("material_id >=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThan(Long value) { + addCriterion("material_id <", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdLessThanOrEqualTo(Long value) { + addCriterion("material_id <=", value, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdIn(List values) { + addCriterion("material_id in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotIn(List values) { + addCriterion("material_id not in", values, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdBetween(Long value1, Long value2) { + addCriterion("material_id between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andMaterialIdNotBetween(Long value1, Long value2) { + addCriterion("material_id not between", value1, value2, "materialId"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNull() { + addCriterion("depot_id is null"); + return (Criteria) this; + } + + public Criteria andDepotIdIsNotNull() { + addCriterion("depot_id is not null"); + return (Criteria) this; + } + + public Criteria andDepotIdEqualTo(Long value) { + addCriterion("depot_id =", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotEqualTo(Long value) { + addCriterion("depot_id <>", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThan(Long value) { + addCriterion("depot_id >", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdGreaterThanOrEqualTo(Long value) { + addCriterion("depot_id >=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThan(Long value) { + addCriterion("depot_id <", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdLessThanOrEqualTo(Long value) { + addCriterion("depot_id <=", value, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdIn(List values) { + addCriterion("depot_id in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotIn(List values) { + addCriterion("depot_id not in", values, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdBetween(Long value1, Long value2) { + addCriterion("depot_id between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andDepotIdNotBetween(Long value1, Long value2) { + addCriterion("depot_id not between", value1, value2, "depotId"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNull() { + addCriterion("serial_number is null"); + return (Criteria) this; + } + + public Criteria andSerialNumberIsNotNull() { + addCriterion("serial_number is not null"); + return (Criteria) this; + } + + public Criteria andSerialNumberEqualTo(String value) { + addCriterion("serial_number =", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotEqualTo(String value) { + addCriterion("serial_number <>", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThan(String value) { + addCriterion("serial_number >", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberGreaterThanOrEqualTo(String value) { + addCriterion("serial_number >=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThan(String value) { + addCriterion("serial_number <", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLessThanOrEqualTo(String value) { + addCriterion("serial_number <=", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberLike(String value) { + addCriterion("serial_number like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotLike(String value) { + addCriterion("serial_number not like", value, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberIn(List values) { + addCriterion("serial_number in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotIn(List values) { + addCriterion("serial_number not in", values, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberBetween(String value1, String value2) { + addCriterion("serial_number between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andSerialNumberNotBetween(String value1, String value2) { + addCriterion("serial_number not between", value1, value2, "serialNumber"); + return (Criteria) this; + } + + public Criteria andIsSellIsNull() { + addCriterion("is_sell is null"); + return (Criteria) this; + } + + public Criteria andIsSellIsNotNull() { + addCriterion("is_sell is not null"); + return (Criteria) this; + } + + public Criteria andIsSellEqualTo(String value) { + addCriterion("is_sell =", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotEqualTo(String value) { + addCriterion("is_sell <>", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellGreaterThan(String value) { + addCriterion("is_sell >", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellGreaterThanOrEqualTo(String value) { + addCriterion("is_sell >=", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLessThan(String value) { + addCriterion("is_sell <", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLessThanOrEqualTo(String value) { + addCriterion("is_sell <=", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellLike(String value) { + addCriterion("is_sell like", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotLike(String value) { + addCriterion("is_sell not like", value, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellIn(List values) { + addCriterion("is_sell in", values, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotIn(List values) { + addCriterion("is_sell not in", values, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellBetween(String value1, String value2) { + addCriterion("is_sell between", value1, value2, "isSell"); + return (Criteria) this; + } + + public Criteria andIsSellNotBetween(String value1, String value2) { + addCriterion("is_sell not between", value1, value2, "isSell"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(Long value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(Long value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(Long value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(Long value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(Long value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(Long value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(Long value1, Long value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(Long value1, Long value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andInBillNoIsNull() { + addCriterion("in_bill_no is null"); + return (Criteria) this; + } + + public Criteria andInBillNoIsNotNull() { + addCriterion("in_bill_no is not null"); + return (Criteria) this; + } + + public Criteria andInBillNoEqualTo(String value) { + addCriterion("in_bill_no =", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotEqualTo(String value) { + addCriterion("in_bill_no <>", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoGreaterThan(String value) { + addCriterion("in_bill_no >", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoGreaterThanOrEqualTo(String value) { + addCriterion("in_bill_no >=", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLessThan(String value) { + addCriterion("in_bill_no <", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLessThanOrEqualTo(String value) { + addCriterion("in_bill_no <=", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoLike(String value) { + addCriterion("in_bill_no like", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotLike(String value) { + addCriterion("in_bill_no not like", value, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoIn(List values) { + addCriterion("in_bill_no in", values, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotIn(List values) { + addCriterion("in_bill_no not in", values, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoBetween(String value1, String value2) { + addCriterion("in_bill_no between", value1, value2, "inBillNo"); + return (Criteria) this; + } + + public Criteria andInBillNoNotBetween(String value1, String value2) { + addCriterion("in_bill_no not between", value1, value2, "inBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoIsNull() { + addCriterion("out_bill_no is null"); + return (Criteria) this; + } + + public Criteria andOutBillNoIsNotNull() { + addCriterion("out_bill_no is not null"); + return (Criteria) this; + } + + public Criteria andOutBillNoEqualTo(String value) { + addCriterion("out_bill_no =", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotEqualTo(String value) { + addCriterion("out_bill_no <>", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoGreaterThan(String value) { + addCriterion("out_bill_no >", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoGreaterThanOrEqualTo(String value) { + addCriterion("out_bill_no >=", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLessThan(String value) { + addCriterion("out_bill_no <", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLessThanOrEqualTo(String value) { + addCriterion("out_bill_no <=", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoLike(String value) { + addCriterion("out_bill_no like", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotLike(String value) { + addCriterion("out_bill_no not like", value, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoIn(List values) { + addCriterion("out_bill_no in", values, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotIn(List values) { + addCriterion("out_bill_no not in", values, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoBetween(String value1, String value2) { + addCriterion("out_bill_no between", value1, value2, "outBillNo"); + return (Criteria) this; + } + + public Criteria andOutBillNoNotBetween(String value1, String value2) { + addCriterion("out_bill_no not between", value1, value2, "outBillNo"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/supplier/Supplier.java b/domain/src/main/java/com/wansensoft/entities/supplier/Supplier.java new file mode 100644 index 00000000..f276b754 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/supplier/Supplier.java @@ -0,0 +1,58 @@ +package com.wansensoft.entities.supplier; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Supplier { + private Long id; + + private String supplier; + + private String contacts; + + private String phoneNum; + + private String email; + + private String description; + + private Byte isystem; + + private String type; + + private Boolean enabled; + + private BigDecimal advanceIn; + + private BigDecimal beginNeedGet; + + private BigDecimal beginNeedPay; + + private BigDecimal allNeedGet; + + private BigDecimal allNeedPay; + + private String fax; + + private String telephone; + + private String address; + + private String taxNum; + + private String bankName; + + private String accountNumber; + + private BigDecimal taxRate; + + private String sort; + + private Long creator; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/supplier/SupplierExample.java b/domain/src/main/java/com/wansensoft/entities/supplier/SupplierExample.java new file mode 100644 index 00000000..69bcad79 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/supplier/SupplierExample.java @@ -0,0 +1,1840 @@ +package com.wansensoft.entities.supplier; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class SupplierExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SupplierExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andSupplierIsNull() { + addCriterion("supplier is null"); + return (Criteria) this; + } + + public Criteria andSupplierIsNotNull() { + addCriterion("supplier is not null"); + return (Criteria) this; + } + + public Criteria andSupplierEqualTo(String value) { + addCriterion("supplier =", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotEqualTo(String value) { + addCriterion("supplier <>", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierGreaterThan(String value) { + addCriterion("supplier >", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierGreaterThanOrEqualTo(String value) { + addCriterion("supplier >=", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLessThan(String value) { + addCriterion("supplier <", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLessThanOrEqualTo(String value) { + addCriterion("supplier <=", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierLike(String value) { + addCriterion("supplier like", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotLike(String value) { + addCriterion("supplier not like", value, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierIn(List values) { + addCriterion("supplier in", values, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotIn(List values) { + addCriterion("supplier not in", values, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierBetween(String value1, String value2) { + addCriterion("supplier between", value1, value2, "supplier"); + return (Criteria) this; + } + + public Criteria andSupplierNotBetween(String value1, String value2) { + addCriterion("supplier not between", value1, value2, "supplier"); + return (Criteria) this; + } + + public Criteria andContactsIsNull() { + addCriterion("contacts is null"); + return (Criteria) this; + } + + public Criteria andContactsIsNotNull() { + addCriterion("contacts is not null"); + return (Criteria) this; + } + + public Criteria andContactsEqualTo(String value) { + addCriterion("contacts =", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotEqualTo(String value) { + addCriterion("contacts <>", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsGreaterThan(String value) { + addCriterion("contacts >", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsGreaterThanOrEqualTo(String value) { + addCriterion("contacts >=", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLessThan(String value) { + addCriterion("contacts <", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLessThanOrEqualTo(String value) { + addCriterion("contacts <=", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsLike(String value) { + addCriterion("contacts like", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotLike(String value) { + addCriterion("contacts not like", value, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsIn(List values) { + addCriterion("contacts in", values, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotIn(List values) { + addCriterion("contacts not in", values, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsBetween(String value1, String value2) { + addCriterion("contacts between", value1, value2, "contacts"); + return (Criteria) this; + } + + public Criteria andContactsNotBetween(String value1, String value2) { + addCriterion("contacts not between", value1, value2, "contacts"); + return (Criteria) this; + } + + public Criteria andPhoneNumIsNull() { + addCriterion("phone_num is null"); + return (Criteria) this; + } + + public Criteria andPhoneNumIsNotNull() { + addCriterion("phone_num is not null"); + return (Criteria) this; + } + + public Criteria andPhoneNumEqualTo(String value) { + addCriterion("phone_num =", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotEqualTo(String value) { + addCriterion("phone_num <>", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumGreaterThan(String value) { + addCriterion("phone_num >", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumGreaterThanOrEqualTo(String value) { + addCriterion("phone_num >=", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLessThan(String value) { + addCriterion("phone_num <", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLessThanOrEqualTo(String value) { + addCriterion("phone_num <=", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumLike(String value) { + addCriterion("phone_num like", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotLike(String value) { + addCriterion("phone_num not like", value, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumIn(List values) { + addCriterion("phone_num in", values, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotIn(List values) { + addCriterion("phone_num not in", values, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumBetween(String value1, String value2) { + addCriterion("phone_num between", value1, value2, "phoneNum"); + return (Criteria) this; + } + + public Criteria andPhoneNumNotBetween(String value1, String value2) { + addCriterion("phone_num not between", value1, value2, "phoneNum"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andIsystemIsNull() { + addCriterion("isystem is null"); + return (Criteria) this; + } + + public Criteria andIsystemIsNotNull() { + addCriterion("isystem is not null"); + return (Criteria) this; + } + + public Criteria andIsystemEqualTo(Byte value) { + addCriterion("isystem =", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotEqualTo(Byte value) { + addCriterion("isystem <>", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThan(Byte value) { + addCriterion("isystem >", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThanOrEqualTo(Byte value) { + addCriterion("isystem >=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThan(Byte value) { + addCriterion("isystem <", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThanOrEqualTo(Byte value) { + addCriterion("isystem <=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemIn(List values) { + addCriterion("isystem in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotIn(List values) { + addCriterion("isystem not in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemBetween(Byte value1, Byte value2) { + addCriterion("isystem between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotBetween(Byte value1, Byte value2) { + addCriterion("isystem not between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andAdvanceInIsNull() { + addCriterion("advance_in is null"); + return (Criteria) this; + } + + public Criteria andAdvanceInIsNotNull() { + addCriterion("advance_in is not null"); + return (Criteria) this; + } + + public Criteria andAdvanceInEqualTo(BigDecimal value) { + addCriterion("advance_in =", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotEqualTo(BigDecimal value) { + addCriterion("advance_in <>", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInGreaterThan(BigDecimal value) { + addCriterion("advance_in >", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("advance_in >=", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInLessThan(BigDecimal value) { + addCriterion("advance_in <", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInLessThanOrEqualTo(BigDecimal value) { + addCriterion("advance_in <=", value, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInIn(List values) { + addCriterion("advance_in in", values, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotIn(List values) { + addCriterion("advance_in not in", values, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("advance_in between", value1, value2, "advanceIn"); + return (Criteria) this; + } + + public Criteria andAdvanceInNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("advance_in not between", value1, value2, "advanceIn"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIsNull() { + addCriterion("begin_need_get is null"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIsNotNull() { + addCriterion("begin_need_get is not null"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetEqualTo(BigDecimal value) { + addCriterion("begin_need_get =", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotEqualTo(BigDecimal value) { + addCriterion("begin_need_get <>", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetGreaterThan(BigDecimal value) { + addCriterion("begin_need_get >", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_get >=", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetLessThan(BigDecimal value) { + addCriterion("begin_need_get <", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetLessThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_get <=", value, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetIn(List values) { + addCriterion("begin_need_get in", values, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotIn(List values) { + addCriterion("begin_need_get not in", values, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_get between", value1, value2, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedGetNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_get not between", value1, value2, "beginNeedGet"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIsNull() { + addCriterion("begin_need_pay is null"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIsNotNull() { + addCriterion("begin_need_pay is not null"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayEqualTo(BigDecimal value) { + addCriterion("begin_need_pay =", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotEqualTo(BigDecimal value) { + addCriterion("begin_need_pay <>", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayGreaterThan(BigDecimal value) { + addCriterion("begin_need_pay >", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_pay >=", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayLessThan(BigDecimal value) { + addCriterion("begin_need_pay <", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayLessThanOrEqualTo(BigDecimal value) { + addCriterion("begin_need_pay <=", value, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayIn(List values) { + addCriterion("begin_need_pay in", values, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotIn(List values) { + addCriterion("begin_need_pay not in", values, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_pay between", value1, value2, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andBeginNeedPayNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("begin_need_pay not between", value1, value2, "beginNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIsNull() { + addCriterion("all_need_get is null"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIsNotNull() { + addCriterion("all_need_get is not null"); + return (Criteria) this; + } + + public Criteria andAllNeedGetEqualTo(BigDecimal value) { + addCriterion("all_need_get =", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotEqualTo(BigDecimal value) { + addCriterion("all_need_get <>", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetGreaterThan(BigDecimal value) { + addCriterion("all_need_get >", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_get >=", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetLessThan(BigDecimal value) { + addCriterion("all_need_get <", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_get <=", value, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetIn(List values) { + addCriterion("all_need_get in", values, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotIn(List values) { + addCriterion("all_need_get not in", values, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_get between", value1, value2, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedGetNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_get not between", value1, value2, "allNeedGet"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIsNull() { + addCriterion("all_need_pay is null"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIsNotNull() { + addCriterion("all_need_pay is not null"); + return (Criteria) this; + } + + public Criteria andAllNeedPayEqualTo(BigDecimal value) { + addCriterion("all_need_pay =", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotEqualTo(BigDecimal value) { + addCriterion("all_need_pay <>", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayGreaterThan(BigDecimal value) { + addCriterion("all_need_pay >", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_pay >=", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayLessThan(BigDecimal value) { + addCriterion("all_need_pay <", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayLessThanOrEqualTo(BigDecimal value) { + addCriterion("all_need_pay <=", value, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayIn(List values) { + addCriterion("all_need_pay in", values, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotIn(List values) { + addCriterion("all_need_pay not in", values, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_pay between", value1, value2, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andAllNeedPayNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("all_need_pay not between", value1, value2, "allNeedPay"); + return (Criteria) this; + } + + public Criteria andFaxIsNull() { + addCriterion("fax is null"); + return (Criteria) this; + } + + public Criteria andFaxIsNotNull() { + addCriterion("fax is not null"); + return (Criteria) this; + } + + public Criteria andFaxEqualTo(String value) { + addCriterion("fax =", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotEqualTo(String value) { + addCriterion("fax <>", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxGreaterThan(String value) { + addCriterion("fax >", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxGreaterThanOrEqualTo(String value) { + addCriterion("fax >=", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLessThan(String value) { + addCriterion("fax <", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLessThanOrEqualTo(String value) { + addCriterion("fax <=", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxLike(String value) { + addCriterion("fax like", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotLike(String value) { + addCriterion("fax not like", value, "fax"); + return (Criteria) this; + } + + public Criteria andFaxIn(List values) { + addCriterion("fax in", values, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotIn(List values) { + addCriterion("fax not in", values, "fax"); + return (Criteria) this; + } + + public Criteria andFaxBetween(String value1, String value2) { + addCriterion("fax between", value1, value2, "fax"); + return (Criteria) this; + } + + public Criteria andFaxNotBetween(String value1, String value2) { + addCriterion("fax not between", value1, value2, "fax"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNull() { + addCriterion("telephone is null"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNotNull() { + addCriterion("telephone is not null"); + return (Criteria) this; + } + + public Criteria andTelephoneEqualTo(String value) { + addCriterion("telephone =", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotEqualTo(String value) { + addCriterion("telephone <>", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThan(String value) { + addCriterion("telephone >", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThanOrEqualTo(String value) { + addCriterion("telephone >=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThan(String value) { + addCriterion("telephone <", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThanOrEqualTo(String value) { + addCriterion("telephone <=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLike(String value) { + addCriterion("telephone like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotLike(String value) { + addCriterion("telephone not like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneIn(List values) { + addCriterion("telephone in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotIn(List values) { + addCriterion("telephone not in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneBetween(String value1, String value2) { + addCriterion("telephone between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotBetween(String value1, String value2) { + addCriterion("telephone not between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andTaxNumIsNull() { + addCriterion("tax_num is null"); + return (Criteria) this; + } + + public Criteria andTaxNumIsNotNull() { + addCriterion("tax_num is not null"); + return (Criteria) this; + } + + public Criteria andTaxNumEqualTo(String value) { + addCriterion("tax_num =", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotEqualTo(String value) { + addCriterion("tax_num <>", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumGreaterThan(String value) { + addCriterion("tax_num >", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumGreaterThanOrEqualTo(String value) { + addCriterion("tax_num >=", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLessThan(String value) { + addCriterion("tax_num <", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLessThanOrEqualTo(String value) { + addCriterion("tax_num <=", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumLike(String value) { + addCriterion("tax_num like", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotLike(String value) { + addCriterion("tax_num not like", value, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumIn(List values) { + addCriterion("tax_num in", values, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotIn(List values) { + addCriterion("tax_num not in", values, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumBetween(String value1, String value2) { + addCriterion("tax_num between", value1, value2, "taxNum"); + return (Criteria) this; + } + + public Criteria andTaxNumNotBetween(String value1, String value2) { + addCriterion("tax_num not between", value1, value2, "taxNum"); + return (Criteria) this; + } + + public Criteria andBankNameIsNull() { + addCriterion("bank_name is null"); + return (Criteria) this; + } + + public Criteria andBankNameIsNotNull() { + addCriterion("bank_name is not null"); + return (Criteria) this; + } + + public Criteria andBankNameEqualTo(String value) { + addCriterion("bank_name =", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotEqualTo(String value) { + addCriterion("bank_name <>", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameGreaterThan(String value) { + addCriterion("bank_name >", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameGreaterThanOrEqualTo(String value) { + addCriterion("bank_name >=", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLessThan(String value) { + addCriterion("bank_name <", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLessThanOrEqualTo(String value) { + addCriterion("bank_name <=", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameLike(String value) { + addCriterion("bank_name like", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotLike(String value) { + addCriterion("bank_name not like", value, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameIn(List values) { + addCriterion("bank_name in", values, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotIn(List values) { + addCriterion("bank_name not in", values, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameBetween(String value1, String value2) { + addCriterion("bank_name between", value1, value2, "bankName"); + return (Criteria) this; + } + + public Criteria andBankNameNotBetween(String value1, String value2) { + addCriterion("bank_name not between", value1, value2, "bankName"); + return (Criteria) this; + } + + public Criteria andAccountNumberIsNull() { + addCriterion("account_number is null"); + return (Criteria) this; + } + + public Criteria andAccountNumberIsNotNull() { + addCriterion("account_number is not null"); + return (Criteria) this; + } + + public Criteria andAccountNumberEqualTo(String value) { + addCriterion("account_number =", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotEqualTo(String value) { + addCriterion("account_number <>", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberGreaterThan(String value) { + addCriterion("account_number >", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberGreaterThanOrEqualTo(String value) { + addCriterion("account_number >=", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLessThan(String value) { + addCriterion("account_number <", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLessThanOrEqualTo(String value) { + addCriterion("account_number <=", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberLike(String value) { + addCriterion("account_number like", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotLike(String value) { + addCriterion("account_number not like", value, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberIn(List values) { + addCriterion("account_number in", values, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotIn(List values) { + addCriterion("account_number not in", values, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberBetween(String value1, String value2) { + addCriterion("account_number between", value1, value2, "accountNumber"); + return (Criteria) this; + } + + public Criteria andAccountNumberNotBetween(String value1, String value2) { + addCriterion("account_number not between", value1, value2, "accountNumber"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNull() { + addCriterion("tax_rate is null"); + return (Criteria) this; + } + + public Criteria andTaxRateIsNotNull() { + addCriterion("tax_rate is not null"); + return (Criteria) this; + } + + public Criteria andTaxRateEqualTo(BigDecimal value) { + addCriterion("tax_rate =", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotEqualTo(BigDecimal value) { + addCriterion("tax_rate <>", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThan(BigDecimal value) { + addCriterion("tax_rate >", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate >=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThan(BigDecimal value) { + addCriterion("tax_rate <", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateLessThanOrEqualTo(BigDecimal value) { + addCriterion("tax_rate <=", value, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateIn(List values) { + addCriterion("tax_rate in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotIn(List values) { + addCriterion("tax_rate not in", values, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andTaxRateNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("tax_rate not between", value1, value2, "taxRate"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysLoginModel.java b/domain/src/main/java/com/wansensoft/entities/system/SysLoginModel.java new file mode 100644 index 00000000..7af62ad6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/system/SysLoginModel.java @@ -0,0 +1,18 @@ +package com.wansensoft.entities.system; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value="登录对象", description="登录对象") +public class SysLoginModel { + @ApiModelProperty(value = "账号") + private String username; + @ApiModelProperty(value = "密码") + private String password; + @ApiModelProperty(value = "验证码") + private String captcha; + @ApiModelProperty(value = "验证码key") + private String checkKey; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/system/SysMenu.java b/domain/src/main/java/com/wansensoft/entities/system/SysMenu.java deleted file mode 100644 index f4c62c87..00000000 --- a/domain/src/main/java/com/wansensoft/entities/system/SysMenu.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.entities.system; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.Getter; - -import java.io.Serial; -import java.time.LocalDateTime; -import java.io.Serializable; - -/** - *

- * 功能模块表 - *

- */ -@TableName("sys_menu") -@Data -public class SysMenu implements Serializable { - - @Serial - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - /** - * 名称 - */ - @TableField("name") - private String name; - - /** - * 标题(菜单显示) - */ - @TableField("title") - private String title; - - /** - * 父级菜单id - */ - @TableField("parent_id") - private Integer parentId; - - /** - * 类型 - */ - @TableField("menu_type") - private Integer menuType; - - /** - * 链接 - */ - @TableField("path") - private String path; - - /** - * 组件 - */ - @TableField("component") - private String component; - - /** - * 重定向地址 - */ - @TableField("redirect") - private String redirect; - - /** - * 排序 - */ - @TableField("sort") - private Integer sort; - - /** - * 状态(0-启用,1-停用) - */ - @TableField("status") - private Boolean status; - - /** - * 图标 - */ - @TableField("icon") - private String icon; - - /** - * 隐藏路由不在菜单显示 - */ - @TableField("hide_menu") - private Boolean hideMenu; - - /** - * 隐藏该路由在面包屑上面的显示 - */ - @TableField("hide_breadcrumb") - private Boolean hideBreadcrumb; - - /** - * 是否忽略KeepAlive缓存 - */ - @TableField("ignore_keep_alive") - private Boolean ignoreKeepAlive; - - /** - * 隐藏路由不在标签页显示 - */ - @TableField("hide_tab") - private Boolean hideTab; - - /** - * 如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true - */ - @TableField("carry_param") - private Boolean carryParam; - - /** - * 隐藏所有子菜单 - */ - @TableField("hide_children_in_menu") - private Boolean hideChildrenInMenu; - - /** - * 是否固定标签 - */ - @TableField("affix") - private Boolean affix; - - /** - * 内嵌iframe的地址 - */ - @TableField("frameSrc") - private String frameSrc; - - /** - * 动态路由的实际Path, 即去除路由的动态部分; - */ - @TableField("realPath") - private String realPath; - - /** - * 创建时间 - */ - @TableField("create_time") - private LocalDateTime createTime; - - /** - * 修改时间 - */ - @TableField("update_time") - private LocalDateTime updateTime; - - /** - * 创建人 - */ - @TableField("create_by") - private Long createBy; - - /** - * 修改人 - */ - @TableField("update_by") - private Long updateBy; - - /** - * 删除标记,0未删除,1删除 - */ - @TableField("delete_flag") - private Boolean deleteFlag; -} diff --git a/domain/src/main/java/com/wansensoft/entities/system/SystemConfig.java b/domain/src/main/java/com/wansensoft/entities/system/SystemConfig.java new file mode 100644 index 00000000..8769a7dd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/system/SystemConfig.java @@ -0,0 +1,44 @@ +package com.wansensoft.entities.system; + +import lombok.Data; + +@Data +public class SystemConfig { + private Long id; + + private String companyName; + + private String companyContacts; + + private String companyAddress; + + private String companyTel; + + private String companyFax; + + private String companyPostCode; + + private String saleAgreement; + + private String depotFlag; + + private String customerFlag; + + private String minusStockFlag; + + private String purchaseBySaleFlag; + + private String multiLevelApprovalFlag; + + private String multiBillType; + + private String forceApprovalFlag; + + private String updateUnitPriceFlag; + + private String overLinkBillFlag; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/system/SystemConfigExample.java b/domain/src/main/java/com/wansensoft/entities/system/SystemConfigExample.java new file mode 100644 index 00000000..63cd196a --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/system/SystemConfigExample.java @@ -0,0 +1,1509 @@ +package com.wansensoft.entities.system; + +import java.util.ArrayList; +import java.util.List; + +public class SystemConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SystemConfigExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIsNull() { + addCriterion("company_contacts is null"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIsNotNull() { + addCriterion("company_contacts is not null"); + return (Criteria) this; + } + + public Criteria andCompanyContactsEqualTo(String value) { + addCriterion("company_contacts =", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotEqualTo(String value) { + addCriterion("company_contacts <>", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsGreaterThan(String value) { + addCriterion("company_contacts >", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsGreaterThanOrEqualTo(String value) { + addCriterion("company_contacts >=", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLessThan(String value) { + addCriterion("company_contacts <", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLessThanOrEqualTo(String value) { + addCriterion("company_contacts <=", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsLike(String value) { + addCriterion("company_contacts like", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotLike(String value) { + addCriterion("company_contacts not like", value, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsIn(List values) { + addCriterion("company_contacts in", values, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotIn(List values) { + addCriterion("company_contacts not in", values, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsBetween(String value1, String value2) { + addCriterion("company_contacts between", value1, value2, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyContactsNotBetween(String value1, String value2) { + addCriterion("company_contacts not between", value1, value2, "companyContacts"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIsNull() { + addCriterion("company_address is null"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIsNotNull() { + addCriterion("company_address is not null"); + return (Criteria) this; + } + + public Criteria andCompanyAddressEqualTo(String value) { + addCriterion("company_address =", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotEqualTo(String value) { + addCriterion("company_address <>", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressGreaterThan(String value) { + addCriterion("company_address >", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressGreaterThanOrEqualTo(String value) { + addCriterion("company_address >=", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLessThan(String value) { + addCriterion("company_address <", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLessThanOrEqualTo(String value) { + addCriterion("company_address <=", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressLike(String value) { + addCriterion("company_address like", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotLike(String value) { + addCriterion("company_address not like", value, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressIn(List values) { + addCriterion("company_address in", values, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotIn(List values) { + addCriterion("company_address not in", values, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressBetween(String value1, String value2) { + addCriterion("company_address between", value1, value2, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyAddressNotBetween(String value1, String value2) { + addCriterion("company_address not between", value1, value2, "companyAddress"); + return (Criteria) this; + } + + public Criteria andCompanyTelIsNull() { + addCriterion("company_tel is null"); + return (Criteria) this; + } + + public Criteria andCompanyTelIsNotNull() { + addCriterion("company_tel is not null"); + return (Criteria) this; + } + + public Criteria andCompanyTelEqualTo(String value) { + addCriterion("company_tel =", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotEqualTo(String value) { + addCriterion("company_tel <>", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelGreaterThan(String value) { + addCriterion("company_tel >", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelGreaterThanOrEqualTo(String value) { + addCriterion("company_tel >=", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLessThan(String value) { + addCriterion("company_tel <", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLessThanOrEqualTo(String value) { + addCriterion("company_tel <=", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelLike(String value) { + addCriterion("company_tel like", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotLike(String value) { + addCriterion("company_tel not like", value, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelIn(List values) { + addCriterion("company_tel in", values, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotIn(List values) { + addCriterion("company_tel not in", values, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelBetween(String value1, String value2) { + addCriterion("company_tel between", value1, value2, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyTelNotBetween(String value1, String value2) { + addCriterion("company_tel not between", value1, value2, "companyTel"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIsNull() { + addCriterion("company_fax is null"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIsNotNull() { + addCriterion("company_fax is not null"); + return (Criteria) this; + } + + public Criteria andCompanyFaxEqualTo(String value) { + addCriterion("company_fax =", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotEqualTo(String value) { + addCriterion("company_fax <>", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxGreaterThan(String value) { + addCriterion("company_fax >", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxGreaterThanOrEqualTo(String value) { + addCriterion("company_fax >=", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLessThan(String value) { + addCriterion("company_fax <", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLessThanOrEqualTo(String value) { + addCriterion("company_fax <=", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxLike(String value) { + addCriterion("company_fax like", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotLike(String value) { + addCriterion("company_fax not like", value, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxIn(List values) { + addCriterion("company_fax in", values, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotIn(List values) { + addCriterion("company_fax not in", values, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxBetween(String value1, String value2) { + addCriterion("company_fax between", value1, value2, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyFaxNotBetween(String value1, String value2) { + addCriterion("company_fax not between", value1, value2, "companyFax"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIsNull() { + addCriterion("company_post_code is null"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIsNotNull() { + addCriterion("company_post_code is not null"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeEqualTo(String value) { + addCriterion("company_post_code =", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotEqualTo(String value) { + addCriterion("company_post_code <>", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeGreaterThan(String value) { + addCriterion("company_post_code >", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeGreaterThanOrEqualTo(String value) { + addCriterion("company_post_code >=", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLessThan(String value) { + addCriterion("company_post_code <", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLessThanOrEqualTo(String value) { + addCriterion("company_post_code <=", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeLike(String value) { + addCriterion("company_post_code like", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotLike(String value) { + addCriterion("company_post_code not like", value, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeIn(List values) { + addCriterion("company_post_code in", values, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotIn(List values) { + addCriterion("company_post_code not in", values, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeBetween(String value1, String value2) { + addCriterion("company_post_code between", value1, value2, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andCompanyPostCodeNotBetween(String value1, String value2) { + addCriterion("company_post_code not between", value1, value2, "companyPostCode"); + return (Criteria) this; + } + + public Criteria andSaleAgreementIsNull() { + addCriterion("sale_agreement is null"); + return (Criteria) this; + } + + public Criteria andSaleAgreementIsNotNull() { + addCriterion("sale_agreement is not null"); + return (Criteria) this; + } + + public Criteria andSaleAgreementEqualTo(String value) { + addCriterion("sale_agreement =", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementNotEqualTo(String value) { + addCriterion("sale_agreement <>", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementGreaterThan(String value) { + addCriterion("sale_agreement >", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementGreaterThanOrEqualTo(String value) { + addCriterion("sale_agreement >=", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementLessThan(String value) { + addCriterion("sale_agreement <", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementLessThanOrEqualTo(String value) { + addCriterion("sale_agreement <=", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementLike(String value) { + addCriterion("sale_agreement like", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementNotLike(String value) { + addCriterion("sale_agreement not like", value, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementIn(List values) { + addCriterion("sale_agreement in", values, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementNotIn(List values) { + addCriterion("sale_agreement not in", values, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementBetween(String value1, String value2) { + addCriterion("sale_agreement between", value1, value2, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andSaleAgreementNotBetween(String value1, String value2) { + addCriterion("sale_agreement not between", value1, value2, "saleAgreement"); + return (Criteria) this; + } + + public Criteria andDepotFlagIsNull() { + addCriterion("depot_flag is null"); + return (Criteria) this; + } + + public Criteria andDepotFlagIsNotNull() { + addCriterion("depot_flag is not null"); + return (Criteria) this; + } + + public Criteria andDepotFlagEqualTo(String value) { + addCriterion("depot_flag =", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotEqualTo(String value) { + addCriterion("depot_flag <>", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagGreaterThan(String value) { + addCriterion("depot_flag >", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagGreaterThanOrEqualTo(String value) { + addCriterion("depot_flag >=", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLessThan(String value) { + addCriterion("depot_flag <", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLessThanOrEqualTo(String value) { + addCriterion("depot_flag <=", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagLike(String value) { + addCriterion("depot_flag like", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotLike(String value) { + addCriterion("depot_flag not like", value, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagIn(List values) { + addCriterion("depot_flag in", values, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotIn(List values) { + addCriterion("depot_flag not in", values, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagBetween(String value1, String value2) { + addCriterion("depot_flag between", value1, value2, "depotFlag"); + return (Criteria) this; + } + + public Criteria andDepotFlagNotBetween(String value1, String value2) { + addCriterion("depot_flag not between", value1, value2, "depotFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIsNull() { + addCriterion("customer_flag is null"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIsNotNull() { + addCriterion("customer_flag is not null"); + return (Criteria) this; + } + + public Criteria andCustomerFlagEqualTo(String value) { + addCriterion("customer_flag =", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotEqualTo(String value) { + addCriterion("customer_flag <>", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagGreaterThan(String value) { + addCriterion("customer_flag >", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagGreaterThanOrEqualTo(String value) { + addCriterion("customer_flag >=", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLessThan(String value) { + addCriterion("customer_flag <", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLessThanOrEqualTo(String value) { + addCriterion("customer_flag <=", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagLike(String value) { + addCriterion("customer_flag like", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotLike(String value) { + addCriterion("customer_flag not like", value, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagIn(List values) { + addCriterion("customer_flag in", values, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotIn(List values) { + addCriterion("customer_flag not in", values, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagBetween(String value1, String value2) { + addCriterion("customer_flag between", value1, value2, "customerFlag"); + return (Criteria) this; + } + + public Criteria andCustomerFlagNotBetween(String value1, String value2) { + addCriterion("customer_flag not between", value1, value2, "customerFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIsNull() { + addCriterion("minus_stock_flag is null"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIsNotNull() { + addCriterion("minus_stock_flag is not null"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagEqualTo(String value) { + addCriterion("minus_stock_flag =", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotEqualTo(String value) { + addCriterion("minus_stock_flag <>", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagGreaterThan(String value) { + addCriterion("minus_stock_flag >", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagGreaterThanOrEqualTo(String value) { + addCriterion("minus_stock_flag >=", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLessThan(String value) { + addCriterion("minus_stock_flag <", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLessThanOrEqualTo(String value) { + addCriterion("minus_stock_flag <=", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagLike(String value) { + addCriterion("minus_stock_flag like", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotLike(String value) { + addCriterion("minus_stock_flag not like", value, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagIn(List values) { + addCriterion("minus_stock_flag in", values, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotIn(List values) { + addCriterion("minus_stock_flag not in", values, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagBetween(String value1, String value2) { + addCriterion("minus_stock_flag between", value1, value2, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andMinusStockFlagNotBetween(String value1, String value2) { + addCriterion("minus_stock_flag not between", value1, value2, "minusStockFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagIsNull() { + addCriterion("purchase_by_sale_flag is null"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagIsNotNull() { + addCriterion("purchase_by_sale_flag is not null"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagEqualTo(String value) { + addCriterion("purchase_by_sale_flag =", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagNotEqualTo(String value) { + addCriterion("purchase_by_sale_flag <>", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagGreaterThan(String value) { + addCriterion("purchase_by_sale_flag >", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagGreaterThanOrEqualTo(String value) { + addCriterion("purchase_by_sale_flag >=", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagLessThan(String value) { + addCriterion("purchase_by_sale_flag <", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagLessThanOrEqualTo(String value) { + addCriterion("purchase_by_sale_flag <=", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagLike(String value) { + addCriterion("purchase_by_sale_flag like", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagNotLike(String value) { + addCriterion("purchase_by_sale_flag not like", value, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagIn(List values) { + addCriterion("purchase_by_sale_flag in", values, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagNotIn(List values) { + addCriterion("purchase_by_sale_flag not in", values, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagBetween(String value1, String value2) { + addCriterion("purchase_by_sale_flag between", value1, value2, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andPurchaseBySaleFlagNotBetween(String value1, String value2) { + addCriterion("purchase_by_sale_flag not between", value1, value2, "purchaseBySaleFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagIsNull() { + addCriterion("multi_level_approval_flag is null"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagIsNotNull() { + addCriterion("multi_level_approval_flag is not null"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagEqualTo(String value) { + addCriterion("multi_level_approval_flag =", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagNotEqualTo(String value) { + addCriterion("multi_level_approval_flag <>", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagGreaterThan(String value) { + addCriterion("multi_level_approval_flag >", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagGreaterThanOrEqualTo(String value) { + addCriterion("multi_level_approval_flag >=", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagLessThan(String value) { + addCriterion("multi_level_approval_flag <", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagLessThanOrEqualTo(String value) { + addCriterion("multi_level_approval_flag <=", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagLike(String value) { + addCriterion("multi_level_approval_flag like", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagNotLike(String value) { + addCriterion("multi_level_approval_flag not like", value, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagIn(List values) { + addCriterion("multi_level_approval_flag in", values, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagNotIn(List values) { + addCriterion("multi_level_approval_flag not in", values, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagBetween(String value1, String value2) { + addCriterion("multi_level_approval_flag between", value1, value2, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiLevelApprovalFlagNotBetween(String value1, String value2) { + addCriterion("multi_level_approval_flag not between", value1, value2, "multiLevelApprovalFlag"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeIsNull() { + addCriterion("multi_bill_type is null"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeIsNotNull() { + addCriterion("multi_bill_type is not null"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeEqualTo(String value) { + addCriterion("multi_bill_type =", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeNotEqualTo(String value) { + addCriterion("multi_bill_type <>", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeGreaterThan(String value) { + addCriterion("multi_bill_type >", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeGreaterThanOrEqualTo(String value) { + addCriterion("multi_bill_type >=", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeLessThan(String value) { + addCriterion("multi_bill_type <", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeLessThanOrEqualTo(String value) { + addCriterion("multi_bill_type <=", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeLike(String value) { + addCriterion("multi_bill_type like", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeNotLike(String value) { + addCriterion("multi_bill_type not like", value, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeIn(List values) { + addCriterion("multi_bill_type in", values, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeNotIn(List values) { + addCriterion("multi_bill_type not in", values, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeBetween(String value1, String value2) { + addCriterion("multi_bill_type between", value1, value2, "multiBillType"); + return (Criteria) this; + } + + public Criteria andMultiBillTypeNotBetween(String value1, String value2) { + addCriterion("multi_bill_type not between", value1, value2, "multiBillType"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagIsNull() { + addCriterion("force_approval_flag is null"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagIsNotNull() { + addCriterion("force_approval_flag is not null"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagEqualTo(String value) { + addCriterion("force_approval_flag =", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagNotEqualTo(String value) { + addCriterion("force_approval_flag <>", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagGreaterThan(String value) { + addCriterion("force_approval_flag >", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagGreaterThanOrEqualTo(String value) { + addCriterion("force_approval_flag >=", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagLessThan(String value) { + addCriterion("force_approval_flag <", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagLessThanOrEqualTo(String value) { + addCriterion("force_approval_flag <=", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagLike(String value) { + addCriterion("force_approval_flag like", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagNotLike(String value) { + addCriterion("force_approval_flag not like", value, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagIn(List values) { + addCriterion("force_approval_flag in", values, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagNotIn(List values) { + addCriterion("force_approval_flag not in", values, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagBetween(String value1, String value2) { + addCriterion("force_approval_flag between", value1, value2, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andForceApprovalFlagNotBetween(String value1, String value2) { + addCriterion("force_approval_flag not between", value1, value2, "forceApprovalFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagIsNull() { + addCriterion("update_unit_price_flag is null"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagIsNotNull() { + addCriterion("update_unit_price_flag is not null"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagEqualTo(String value) { + addCriterion("update_unit_price_flag =", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagNotEqualTo(String value) { + addCriterion("update_unit_price_flag <>", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagGreaterThan(String value) { + addCriterion("update_unit_price_flag >", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagGreaterThanOrEqualTo(String value) { + addCriterion("update_unit_price_flag >=", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagLessThan(String value) { + addCriterion("update_unit_price_flag <", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagLessThanOrEqualTo(String value) { + addCriterion("update_unit_price_flag <=", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagLike(String value) { + addCriterion("update_unit_price_flag like", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagNotLike(String value) { + addCriterion("update_unit_price_flag not like", value, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagIn(List values) { + addCriterion("update_unit_price_flag in", values, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagNotIn(List values) { + addCriterion("update_unit_price_flag not in", values, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagBetween(String value1, String value2) { + addCriterion("update_unit_price_flag between", value1, value2, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andUpdateUnitPriceFlagNotBetween(String value1, String value2) { + addCriterion("update_unit_price_flag not between", value1, value2, "updateUnitPriceFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagIsNull() { + addCriterion("over_link_bill_flag is null"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagIsNotNull() { + addCriterion("over_link_bill_flag is not null"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagEqualTo(String value) { + addCriterion("over_link_bill_flag =", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagNotEqualTo(String value) { + addCriterion("over_link_bill_flag <>", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagGreaterThan(String value) { + addCriterion("over_link_bill_flag >", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagGreaterThanOrEqualTo(String value) { + addCriterion("over_link_bill_flag >=", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagLessThan(String value) { + addCriterion("over_link_bill_flag <", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagLessThanOrEqualTo(String value) { + addCriterion("over_link_bill_flag <=", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagLike(String value) { + addCriterion("over_link_bill_flag like", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagNotLike(String value) { + addCriterion("over_link_bill_flag not like", value, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagIn(List values) { + addCriterion("over_link_bill_flag in", values, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagNotIn(List values) { + addCriterion("over_link_bill_flag not in", values, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagBetween(String value1, String value2) { + addCriterion("over_link_bill_flag between", value1, value2, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andOverLinkBillFlagNotBetween(String value1, String value2) { + addCriterion("over_link_bill_flag not between", value1, value2, "overLinkBillFlag"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/tenant/Tenant.java b/domain/src/main/java/com/wansensoft/entities/tenant/Tenant.java new file mode 100644 index 00000000..bbdd54cc --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/tenant/Tenant.java @@ -0,0 +1,26 @@ +package com.wansensoft.entities.tenant; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Tenant { + private Long id; + + private Long tenantId; + + private String loginName; + + private Integer userNumLimit; + + private String type; + + private Boolean enabled; + + private Date createTime; + + private Date expireTime; + + private String remark; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/tenant/TenantEx.java b/domain/src/main/java/com/wansensoft/entities/tenant/TenantEx.java new file mode 100644 index 00000000..c75d8fa9 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/tenant/TenantEx.java @@ -0,0 +1,13 @@ +package com.wansensoft.entities.tenant; + +import lombok.Data; + +@Data +public class TenantEx extends Tenant{ + + private String createTimeStr; + + private String expireTimeStr; + + private Integer userCount; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/tenant/TenantExample.java b/domain/src/main/java/com/wansensoft/entities/tenant/TenantExample.java new file mode 100644 index 00000000..ef3edee1 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/tenant/TenantExample.java @@ -0,0 +1,761 @@ +package com.wansensoft.entities.tenant; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +public class TenantExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public TenantExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIsNull() { + addCriterion("user_num_limit is null"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIsNotNull() { + addCriterion("user_num_limit is not null"); + return (Criteria) this; + } + + public Criteria andUserNumLimitEqualTo(Integer value) { + addCriterion("user_num_limit =", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotEqualTo(Integer value) { + addCriterion("user_num_limit <>", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitGreaterThan(Integer value) { + addCriterion("user_num_limit >", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitGreaterThanOrEqualTo(Integer value) { + addCriterion("user_num_limit >=", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitLessThan(Integer value) { + addCriterion("user_num_limit <", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitLessThanOrEqualTo(Integer value) { + addCriterion("user_num_limit <=", value, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitIn(List values) { + addCriterion("user_num_limit in", values, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotIn(List values) { + addCriterion("user_num_limit not in", values, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitBetween(Integer value1, Integer value2) { + addCriterion("user_num_limit between", value1, value2, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andUserNumLimitNotBetween(Integer value1, Integer value2) { + addCriterion("user_num_limit not between", value1, value2, "userNumLimit"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNull() { + addCriterion("expire_time is null"); + return (Criteria) this; + } + + public Criteria andExpireTimeIsNotNull() { + addCriterion("expire_time is not null"); + return (Criteria) this; + } + + public Criteria andExpireTimeEqualTo(Date value) { + addCriterion("expire_time =", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotEqualTo(Date value) { + addCriterion("expire_time <>", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThan(Date value) { + addCriterion("expire_time >", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeGreaterThanOrEqualTo(Date value) { + addCriterion("expire_time >=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThan(Date value) { + addCriterion("expire_time <", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeLessThanOrEqualTo(Date value) { + addCriterion("expire_time <=", value, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeIn(List values) { + addCriterion("expire_time in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotIn(List values) { + addCriterion("expire_time not in", values, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeBetween(Date value1, Date value2) { + addCriterion("expire_time between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andExpireTimeNotBetween(Date value1, Date value2) { + addCriterion("expire_time not between", value1, value2, "expireTime"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/unit/Unit.java b/domain/src/main/java/com/wansensoft/entities/unit/Unit.java new file mode 100644 index 00000000..f2a9ba21 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/unit/Unit.java @@ -0,0 +1,32 @@ +package com.wansensoft.entities.unit; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class Unit { + private Long id; + + private String name; + + private String basicUnit; + + private String otherUnit; + + private String otherUnitTwo; + + private String otherUnitThree; + + private BigDecimal ratio; + + private BigDecimal ratioTwo; + + private BigDecimal ratioThree; + + private Boolean enabled; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/unit/UnitExample.java b/domain/src/main/java/com/wansensoft/entities/unit/UnitExample.java new file mode 100644 index 00000000..94fd04f6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/unit/UnitExample.java @@ -0,0 +1,980 @@ +package com.wansensoft.entities.unit; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class UnitExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UnitExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andBasicUnitIsNull() { + addCriterion("basic_unit is null"); + return (Criteria) this; + } + + public Criteria andBasicUnitIsNotNull() { + addCriterion("basic_unit is not null"); + return (Criteria) this; + } + + public Criteria andBasicUnitEqualTo(String value) { + addCriterion("basic_unit =", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotEqualTo(String value) { + addCriterion("basic_unit <>", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitGreaterThan(String value) { + addCriterion("basic_unit >", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitGreaterThanOrEqualTo(String value) { + addCriterion("basic_unit >=", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLessThan(String value) { + addCriterion("basic_unit <", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLessThanOrEqualTo(String value) { + addCriterion("basic_unit <=", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitLike(String value) { + addCriterion("basic_unit like", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotLike(String value) { + addCriterion("basic_unit not like", value, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitIn(List values) { + addCriterion("basic_unit in", values, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotIn(List values) { + addCriterion("basic_unit not in", values, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitBetween(String value1, String value2) { + addCriterion("basic_unit between", value1, value2, "basicUnit"); + return (Criteria) this; + } + + public Criteria andBasicUnitNotBetween(String value1, String value2) { + addCriterion("basic_unit not between", value1, value2, "basicUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitIsNull() { + addCriterion("other_unit is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitIsNotNull() { + addCriterion("other_unit is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitEqualTo(String value) { + addCriterion("other_unit =", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotEqualTo(String value) { + addCriterion("other_unit <>", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitGreaterThan(String value) { + addCriterion("other_unit >", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitGreaterThanOrEqualTo(String value) { + addCriterion("other_unit >=", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLessThan(String value) { + addCriterion("other_unit <", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLessThanOrEqualTo(String value) { + addCriterion("other_unit <=", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitLike(String value) { + addCriterion("other_unit like", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotLike(String value) { + addCriterion("other_unit not like", value, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitIn(List values) { + addCriterion("other_unit in", values, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotIn(List values) { + addCriterion("other_unit not in", values, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitBetween(String value1, String value2) { + addCriterion("other_unit between", value1, value2, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitNotBetween(String value1, String value2) { + addCriterion("other_unit not between", value1, value2, "otherUnit"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIsNull() { + addCriterion("other_unit_two is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIsNotNull() { + addCriterion("other_unit_two is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoEqualTo(String value) { + addCriterion("other_unit_two =", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotEqualTo(String value) { + addCriterion("other_unit_two <>", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoGreaterThan(String value) { + addCriterion("other_unit_two >", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoGreaterThanOrEqualTo(String value) { + addCriterion("other_unit_two >=", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLessThan(String value) { + addCriterion("other_unit_two <", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLessThanOrEqualTo(String value) { + addCriterion("other_unit_two <=", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoLike(String value) { + addCriterion("other_unit_two like", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotLike(String value) { + addCriterion("other_unit_two not like", value, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoIn(List values) { + addCriterion("other_unit_two in", values, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotIn(List values) { + addCriterion("other_unit_two not in", values, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoBetween(String value1, String value2) { + addCriterion("other_unit_two between", value1, value2, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitTwoNotBetween(String value1, String value2) { + addCriterion("other_unit_two not between", value1, value2, "otherUnitTwo"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIsNull() { + addCriterion("other_unit_three is null"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIsNotNull() { + addCriterion("other_unit_three is not null"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeEqualTo(String value) { + addCriterion("other_unit_three =", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotEqualTo(String value) { + addCriterion("other_unit_three <>", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeGreaterThan(String value) { + addCriterion("other_unit_three >", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeGreaterThanOrEqualTo(String value) { + addCriterion("other_unit_three >=", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLessThan(String value) { + addCriterion("other_unit_three <", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLessThanOrEqualTo(String value) { + addCriterion("other_unit_three <=", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeLike(String value) { + addCriterion("other_unit_three like", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotLike(String value) { + addCriterion("other_unit_three not like", value, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeIn(List values) { + addCriterion("other_unit_three in", values, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotIn(List values) { + addCriterion("other_unit_three not in", values, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeBetween(String value1, String value2) { + addCriterion("other_unit_three between", value1, value2, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andOtherUnitThreeNotBetween(String value1, String value2) { + addCriterion("other_unit_three not between", value1, value2, "otherUnitThree"); + return (Criteria) this; + } + + public Criteria andRatioIsNull() { + addCriterion("ratio is null"); + return (Criteria) this; + } + + public Criteria andRatioIsNotNull() { + addCriterion("ratio is not null"); + return (Criteria) this; + } + + public Criteria andRatioEqualTo(BigDecimal value) { + addCriterion("ratio =", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotEqualTo(BigDecimal value) { + addCriterion("ratio <>", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioGreaterThan(BigDecimal value) { + addCriterion("ratio >", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("ratio >=", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioLessThan(BigDecimal value) { + addCriterion("ratio <", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioLessThanOrEqualTo(BigDecimal value) { + addCriterion("ratio <=", value, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioIn(List values) { + addCriterion("ratio in", values, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotIn(List values) { + addCriterion("ratio not in", values, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio between", value1, value2, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio not between", value1, value2, "ratio"); + return (Criteria) this; + } + + public Criteria andRatioTwoIsNull() { + addCriterion("ratio_two is null"); + return (Criteria) this; + } + + public Criteria andRatioTwoIsNotNull() { + addCriterion("ratio_two is not null"); + return (Criteria) this; + } + + public Criteria andRatioTwoEqualTo(BigDecimal value) { + addCriterion("ratio_two =", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotEqualTo(BigDecimal value) { + addCriterion("ratio_two <>", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoGreaterThan(BigDecimal value) { + addCriterion("ratio_two >", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("ratio_two >=", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoLessThan(BigDecimal value) { + addCriterion("ratio_two <", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoLessThanOrEqualTo(BigDecimal value) { + addCriterion("ratio_two <=", value, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoIn(List values) { + addCriterion("ratio_two in", values, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotIn(List values) { + addCriterion("ratio_two not in", values, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio_two between", value1, value2, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioTwoNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio_two not between", value1, value2, "ratioTwo"); + return (Criteria) this; + } + + public Criteria andRatioThreeIsNull() { + addCriterion("ratio_three is null"); + return (Criteria) this; + } + + public Criteria andRatioThreeIsNotNull() { + addCriterion("ratio_three is not null"); + return (Criteria) this; + } + + public Criteria andRatioThreeEqualTo(BigDecimal value) { + addCriterion("ratio_three =", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotEqualTo(BigDecimal value) { + addCriterion("ratio_three <>", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeGreaterThan(BigDecimal value) { + addCriterion("ratio_three >", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("ratio_three >=", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeLessThan(BigDecimal value) { + addCriterion("ratio_three <", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeLessThanOrEqualTo(BigDecimal value) { + addCriterion("ratio_three <=", value, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeIn(List values) { + addCriterion("ratio_three in", values, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotIn(List values) { + addCriterion("ratio_three not in", values, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio_three between", value1, value2, "ratioThree"); + return (Criteria) this; + } + + public Criteria andRatioThreeNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("ratio_three not between", value1, value2, "ratioThree"); + return (Criteria) this; + } + + public Criteria andEnabledIsNull() { + addCriterion("enabled is null"); + return (Criteria) this; + } + + public Criteria andEnabledIsNotNull() { + addCriterion("enabled is not null"); + return (Criteria) this; + } + + public Criteria andEnabledEqualTo(Boolean value) { + addCriterion("enabled =", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotEqualTo(Boolean value) { + addCriterion("enabled <>", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThan(Boolean value) { + addCriterion("enabled >", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledGreaterThanOrEqualTo(Boolean value) { + addCriterion("enabled >=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThan(Boolean value) { + addCriterion("enabled <", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledLessThanOrEqualTo(Boolean value) { + addCriterion("enabled <=", value, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledIn(List values) { + addCriterion("enabled in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotIn(List values) { + addCriterion("enabled not in", values, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledBetween(Boolean value1, Boolean value2) { + addCriterion("enabled between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andEnabledNotBetween(Boolean value1, Boolean value2) { + addCriterion("enabled not between", value1, value2, "enabled"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/user/User.java b/domain/src/main/java/com/wansensoft/entities/user/User.java new file mode 100644 index 00000000..0bfd1025 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/user/User.java @@ -0,0 +1,38 @@ +package com.wansensoft.entities.user; + +import lombok.Data; + +@Data +public class User { + private Long id; + + private String username; + + private String loginName; + + private String password; + + private String leaderFlag; + + private String position; + + private String department; + + private String email; + + private String phonenum; + + private Byte ismanager; + + private Byte isystem; + + private Byte status; + + private String description; + + private String remark; + + private String weixinOpenId; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/user/UserBusiness.java b/domain/src/main/java/com/wansensoft/entities/user/UserBusiness.java new file mode 100644 index 00000000..ac96f103 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/user/UserBusiness.java @@ -0,0 +1,20 @@ +package com.wansensoft.entities.user; + +import lombok.Data; + +@Data +public class UserBusiness { + private Long id; + + private String type; + + private String keyId; + + private String value; + + private String btnStr; + + private Long tenantId; + + private String deleteFlag; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/user/UserBusinessExample.java b/domain/src/main/java/com/wansensoft/entities/user/UserBusinessExample.java new file mode 100644 index 00000000..326fe247 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/user/UserBusinessExample.java @@ -0,0 +1,669 @@ +package com.wansensoft.entities.user; + +import java.util.ArrayList; +import java.util.List; + +public class UserBusinessExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserBusinessExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("type is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("type is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("type =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("type <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("type >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("type >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("type <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("type <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("type like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("type not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("type in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("type not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("type between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("type not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andKeyIdIsNull() { + addCriterion("key_id is null"); + return (Criteria) this; + } + + public Criteria andKeyIdIsNotNull() { + addCriterion("key_id is not null"); + return (Criteria) this; + } + + public Criteria andKeyIdEqualTo(String value) { + addCriterion("key_id =", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotEqualTo(String value) { + addCriterion("key_id <>", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdGreaterThan(String value) { + addCriterion("key_id >", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdGreaterThanOrEqualTo(String value) { + addCriterion("key_id >=", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLessThan(String value) { + addCriterion("key_id <", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLessThanOrEqualTo(String value) { + addCriterion("key_id <=", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdLike(String value) { + addCriterion("key_id like", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotLike(String value) { + addCriterion("key_id not like", value, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdIn(List values) { + addCriterion("key_id in", values, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotIn(List values) { + addCriterion("key_id not in", values, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdBetween(String value1, String value2) { + addCriterion("key_id between", value1, value2, "keyId"); + return (Criteria) this; + } + + public Criteria andKeyIdNotBetween(String value1, String value2) { + addCriterion("key_id not between", value1, value2, "keyId"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("value is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("value is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("value =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("value <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("value >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("value >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("value <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("value <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("value like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("value not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("value in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("value not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("value between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("value not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andBtnStrIsNull() { + addCriterion("btn_str is null"); + return (Criteria) this; + } + + public Criteria andBtnStrIsNotNull() { + addCriterion("btn_str is not null"); + return (Criteria) this; + } + + public Criteria andBtnStrEqualTo(String value) { + addCriterion("btn_str =", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotEqualTo(String value) { + addCriterion("btn_str <>", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrGreaterThan(String value) { + addCriterion("btn_str >", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrGreaterThanOrEqualTo(String value) { + addCriterion("btn_str >=", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLessThan(String value) { + addCriterion("btn_str <", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLessThanOrEqualTo(String value) { + addCriterion("btn_str <=", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrLike(String value) { + addCriterion("btn_str like", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotLike(String value) { + addCriterion("btn_str not like", value, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrIn(List values) { + addCriterion("btn_str in", values, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotIn(List values) { + addCriterion("btn_str not in", values, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrBetween(String value1, String value2) { + addCriterion("btn_str between", value1, value2, "btnStr"); + return (Criteria) this; + } + + public Criteria andBtnStrNotBetween(String value1, String value2) { + addCriterion("btn_str not between", value1, value2, "btnStr"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNull() { + addCriterion("delete_flag is null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIsNotNull() { + addCriterion("delete_flag is not null"); + return (Criteria) this; + } + + public Criteria andDeleteFlagEqualTo(String value) { + addCriterion("delete_flag =", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotEqualTo(String value) { + addCriterion("delete_flag <>", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThan(String value) { + addCriterion("delete_flag >", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) { + addCriterion("delete_flag >=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThan(String value) { + addCriterion("delete_flag <", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLessThanOrEqualTo(String value) { + addCriterion("delete_flag <=", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagLike(String value) { + addCriterion("delete_flag like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotLike(String value) { + addCriterion("delete_flag not like", value, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagIn(List values) { + addCriterion("delete_flag in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotIn(List values) { + addCriterion("delete_flag not in", values, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagBetween(String value1, String value2) { + addCriterion("delete_flag between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + + public Criteria andDeleteFlagNotBetween(String value1, String value2) { + addCriterion("delete_flag not between", value1, value2, "deleteFlag"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/entities/user/UserEx.java b/domain/src/main/java/com/wansensoft/entities/user/UserEx.java new file mode 100644 index 00000000..bea6804b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/user/UserEx.java @@ -0,0 +1,27 @@ +package com.wansensoft.entities.user; + +import lombok.Data; + +@Data +public class UserEx extends User{ + //机构简称 + private String orgAbr; + //机构id + private Long orgaId; + //用户在部门中排序 + private String userBlngOrgaDsplSeq; + //机构用户关联关系id + private Long orgaUserRelId; + + private Long roleId; + + private String roleName; + + private String userType; + + private Integer userNumLimit; + + private String expireTime; + + private String leaderFlagStr; +} diff --git a/domain/src/main/java/com/wansensoft/entities/user/UserExample.java b/domain/src/main/java/com/wansensoft/entities/user/UserExample.java new file mode 100644 index 00000000..dadc33d8 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/user/UserExample.java @@ -0,0 +1,1269 @@ +package com.wansensoft.entities.user; + +import java.util.ArrayList; +import java.util.List; + +public class UserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public UserExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andPasswordIsNull() { + addCriterion("password is null"); + return (Criteria) this; + } + + public Criteria andPasswordIsNotNull() { + addCriterion("password is not null"); + return (Criteria) this; + } + + public Criteria andPasswordEqualTo(String value) { + addCriterion("password =", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotEqualTo(String value) { + addCriterion("password <>", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThan(String value) { + addCriterion("password >", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThanOrEqualTo(String value) { + addCriterion("password >=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThan(String value) { + addCriterion("password <", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThanOrEqualTo(String value) { + addCriterion("password <=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLike(String value) { + addCriterion("password like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotLike(String value) { + addCriterion("password not like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordIn(List values) { + addCriterion("password in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotIn(List values) { + addCriterion("password not in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordBetween(String value1, String value2) { + addCriterion("password between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotBetween(String value1, String value2) { + addCriterion("password not between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andLeaderFlagIsNull() { + addCriterion("leader_flag is null"); + return (Criteria) this; + } + + public Criteria andLeaderFlagIsNotNull() { + addCriterion("leader_flag is not null"); + return (Criteria) this; + } + + public Criteria andLeaderFlagEqualTo(String value) { + addCriterion("leader_flag =", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagNotEqualTo(String value) { + addCriterion("leader_flag <>", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagGreaterThan(String value) { + addCriterion("leader_flag >", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagGreaterThanOrEqualTo(String value) { + addCriterion("leader_flag >=", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagLessThan(String value) { + addCriterion("leader_flag <", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagLessThanOrEqualTo(String value) { + addCriterion("leader_flag <=", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagLike(String value) { + addCriterion("leader_flag like", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagNotLike(String value) { + addCriterion("leader_flag not like", value, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagIn(List values) { + addCriterion("leader_flag in", values, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagNotIn(List values) { + addCriterion("leader_flag not in", values, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagBetween(String value1, String value2) { + addCriterion("leader_flag between", value1, value2, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andLeaderFlagNotBetween(String value1, String value2) { + addCriterion("leader_flag not between", value1, value2, "leaderFlag"); + return (Criteria) this; + } + + public Criteria andPositionIsNull() { + addCriterion("position is null"); + return (Criteria) this; + } + + public Criteria andPositionIsNotNull() { + addCriterion("position is not null"); + return (Criteria) this; + } + + public Criteria andPositionEqualTo(String value) { + addCriterion("position =", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotEqualTo(String value) { + addCriterion("position <>", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThan(String value) { + addCriterion("position >", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThanOrEqualTo(String value) { + addCriterion("position >=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThan(String value) { + addCriterion("position <", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThanOrEqualTo(String value) { + addCriterion("position <=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLike(String value) { + addCriterion("position like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotLike(String value) { + addCriterion("position not like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionIn(List values) { + addCriterion("position in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotIn(List values) { + addCriterion("position not in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionBetween(String value1, String value2) { + addCriterion("position between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotBetween(String value1, String value2) { + addCriterion("position not between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andDepartmentIsNull() { + addCriterion("department is null"); + return (Criteria) this; + } + + public Criteria andDepartmentIsNotNull() { + addCriterion("department is not null"); + return (Criteria) this; + } + + public Criteria andDepartmentEqualTo(String value) { + addCriterion("department =", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotEqualTo(String value) { + addCriterion("department <>", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentGreaterThan(String value) { + addCriterion("department >", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentGreaterThanOrEqualTo(String value) { + addCriterion("department >=", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLessThan(String value) { + addCriterion("department <", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLessThanOrEqualTo(String value) { + addCriterion("department <=", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentLike(String value) { + addCriterion("department like", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotLike(String value) { + addCriterion("department not like", value, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentIn(List values) { + addCriterion("department in", values, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotIn(List values) { + addCriterion("department not in", values, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentBetween(String value1, String value2) { + addCriterion("department between", value1, value2, "department"); + return (Criteria) this; + } + + public Criteria andDepartmentNotBetween(String value1, String value2) { + addCriterion("department not between", value1, value2, "department"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andPhonenumIsNull() { + addCriterion("phonenum is null"); + return (Criteria) this; + } + + public Criteria andPhonenumIsNotNull() { + addCriterion("phonenum is not null"); + return (Criteria) this; + } + + public Criteria andPhonenumEqualTo(String value) { + addCriterion("phonenum =", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotEqualTo(String value) { + addCriterion("phonenum <>", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumGreaterThan(String value) { + addCriterion("phonenum >", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumGreaterThanOrEqualTo(String value) { + addCriterion("phonenum >=", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLessThan(String value) { + addCriterion("phonenum <", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLessThanOrEqualTo(String value) { + addCriterion("phonenum <=", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumLike(String value) { + addCriterion("phonenum like", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotLike(String value) { + addCriterion("phonenum not like", value, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumIn(List values) { + addCriterion("phonenum in", values, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotIn(List values) { + addCriterion("phonenum not in", values, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumBetween(String value1, String value2) { + addCriterion("phonenum between", value1, value2, "phonenum"); + return (Criteria) this; + } + + public Criteria andPhonenumNotBetween(String value1, String value2) { + addCriterion("phonenum not between", value1, value2, "phonenum"); + return (Criteria) this; + } + + public Criteria andIsmanagerIsNull() { + addCriterion("ismanager is null"); + return (Criteria) this; + } + + public Criteria andIsmanagerIsNotNull() { + addCriterion("ismanager is not null"); + return (Criteria) this; + } + + public Criteria andIsmanagerEqualTo(Byte value) { + addCriterion("ismanager =", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotEqualTo(Byte value) { + addCriterion("ismanager <>", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerGreaterThan(Byte value) { + addCriterion("ismanager >", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerGreaterThanOrEqualTo(Byte value) { + addCriterion("ismanager >=", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerLessThan(Byte value) { + addCriterion("ismanager <", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerLessThanOrEqualTo(Byte value) { + addCriterion("ismanager <=", value, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerIn(List values) { + addCriterion("ismanager in", values, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotIn(List values) { + addCriterion("ismanager not in", values, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerBetween(Byte value1, Byte value2) { + addCriterion("ismanager between", value1, value2, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsmanagerNotBetween(Byte value1, Byte value2) { + addCriterion("ismanager not between", value1, value2, "ismanager"); + return (Criteria) this; + } + + public Criteria andIsystemIsNull() { + addCriterion("isystem is null"); + return (Criteria) this; + } + + public Criteria andIsystemIsNotNull() { + addCriterion("isystem is not null"); + return (Criteria) this; + } + + public Criteria andIsystemEqualTo(Byte value) { + addCriterion("isystem =", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotEqualTo(Byte value) { + addCriterion("isystem <>", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThan(Byte value) { + addCriterion("isystem >", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemGreaterThanOrEqualTo(Byte value) { + addCriterion("isystem >=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThan(Byte value) { + addCriterion("isystem <", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemLessThanOrEqualTo(Byte value) { + addCriterion("isystem <=", value, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemIn(List values) { + addCriterion("isystem in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotIn(List values) { + addCriterion("isystem not in", values, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemBetween(Byte value1, Byte value2) { + addCriterion("isystem between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andIsystemNotBetween(Byte value1, Byte value2) { + addCriterion("isystem not between", value1, value2, "isystem"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("Status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("Status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Byte value) { + addCriterion("Status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Byte value) { + addCriterion("Status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Byte value) { + addCriterion("Status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("Status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Byte value) { + addCriterion("Status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Byte value) { + addCriterion("Status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("Status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("Status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Byte value1, Byte value2) { + addCriterion("Status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Byte value1, Byte value2) { + addCriterion("Status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdIsNull() { + addCriterion("weixin_open_id is null"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdIsNotNull() { + addCriterion("weixin_open_id is not null"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdEqualTo(String value) { + addCriterion("weixin_open_id =", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdNotEqualTo(String value) { + addCriterion("weixin_open_id <>", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdGreaterThan(String value) { + addCriterion("weixin_open_id >", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdGreaterThanOrEqualTo(String value) { + addCriterion("weixin_open_id >=", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdLessThan(String value) { + addCriterion("weixin_open_id <", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdLessThanOrEqualTo(String value) { + addCriterion("weixin_open_id <=", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdLike(String value) { + addCriterion("weixin_open_id like", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdNotLike(String value) { + addCriterion("weixin_open_id not like", value, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdIn(List values) { + addCriterion("weixin_open_id in", values, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdNotIn(List values) { + addCriterion("weixin_open_id not in", values, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdBetween(String value1, String value2) { + addCriterion("weixin_open_id between", value1, value2, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andWeixinOpenIdNotBetween(String value1, String value2) { + addCriterion("weixin_open_id not between", value1, value2, "weixinOpenId"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNull() { + addCriterion("tenant_id is null"); + return (Criteria) this; + } + + public Criteria andTenantIdIsNotNull() { + addCriterion("tenant_id is not null"); + return (Criteria) this; + } + + public Criteria andTenantIdEqualTo(Long value) { + addCriterion("tenant_id =", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotEqualTo(Long value) { + addCriterion("tenant_id <>", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThan(Long value) { + addCriterion("tenant_id >", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdGreaterThanOrEqualTo(Long value) { + addCriterion("tenant_id >=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThan(Long value) { + addCriterion("tenant_id <", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdLessThanOrEqualTo(Long value) { + addCriterion("tenant_id <=", value, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdIn(List values) { + addCriterion("tenant_id in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotIn(List values) { + addCriterion("tenant_id not in", values, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdBetween(Long value1, Long value2) { + addCriterion("tenant_id between", value1, value2, "tenantId"); + return (Criteria) this; + } + + public Criteria andTenantIdNotBetween(Long value1, Long value2) { + addCriterion("tenant_id not between", value1, value2, "tenantId"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/AccountItemVo4List.java b/domain/src/main/java/com/wansensoft/vo/AccountItemVo4List.java new file mode 100644 index 00000000..72ca0cd0 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/AccountItemVo4List.java @@ -0,0 +1,14 @@ +package com.wansensoft.vo; + +import com.wansensoft.entities.account.AccountItem; +import lombok.Data; + +@Data +public class AccountItemVo4List extends AccountItem { + + private String accountName; + + private String inOutItemName; + + private String billNumber; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/AccountVo4InOutList.java b/domain/src/main/java/com/wansensoft/vo/AccountVo4InOutList.java new file mode 100644 index 00000000..c0a0cb84 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/AccountVo4InOutList.java @@ -0,0 +1,31 @@ +package com.wansensoft.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class AccountVo4InOutList { + + private Long accountId; + + private String number; + + private String type; + + private String fromType; + + private String supplierName; + + private BigDecimal changeAmount; + + private BigDecimal balance; + + private String operTime; + + private String aList; + + private String amList; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/AccountVo4List.java b/domain/src/main/java/com/wansensoft/vo/AccountVo4List.java new file mode 100644 index 00000000..b756bf59 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/AccountVo4List.java @@ -0,0 +1,10 @@ +package com.wansensoft.vo; + +import com.wansensoft.entities.account.Account; +import lombok.Data; + +@Data +public class AccountVo4List extends Account { + + private String thisMonthAmount; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/CaptchaVO.java b/domain/src/main/java/com/wansensoft/vo/CaptchaVO.java deleted file mode 100644 index 206dff38..00000000 --- a/domain/src/main/java/com/wansensoft/vo/CaptchaVO.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.vo; - -import lombok.Builder; -import lombok.Data; - -@Data -@Builder -public class CaptchaVO { - - private String captchaId; - - private String imagePath; -} diff --git a/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InDetail.java b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InDetail.java new file mode 100644 index 00000000..9e89fc73 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InDetail.java @@ -0,0 +1,46 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotHeadVo4InDetail { + + private String Number; + + private String barCode; + + private String MName; + + private String Model; + + private String standard; + + private BigDecimal UnitPrice; + + private String mUnit; + + private String newRemark; + + private BigDecimal OperNumber; + + private BigDecimal AllPrice; + + private BigDecimal taxRate; + + private BigDecimal taxMoney; + + private BigDecimal taxLastMoney; + + private String SName; + + private String DName; + + private String OperTime; + + private String NewType; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InOutMCount.java b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InOutMCount.java new file mode 100644 index 00000000..9167eaaa --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4InOutMCount.java @@ -0,0 +1,30 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotHeadVo4InOutMCount { + + private Long MaterialId; + + private String barCode; + + private String mName; + + private String Model; + + private String standard; + + private String categoryName; + + private String materialUnit; + + private BigDecimal numSum; + + private BigDecimal priceSum; + + private Long tenantId; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4List.java b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4List.java new file mode 100644 index 00000000..b9920dbc --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4List.java @@ -0,0 +1,62 @@ +package com.wansensoft.vo; + +import com.wansensoft.entities.depot.DepotHead; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +@EqualsAndHashCode(callSuper = true) +@Data +public class DepotHeadVo4List extends DepotHead { + + private String projectName; + + private String organName; + + private String userName; + + private String accountName; + + private String allocationProjectName; + + private String materialsList; + + private String salesManStr; + + private String operTimeStr; + + private BigDecimal finishDebt; + + private String depotHeadType; + + private String creatorName; + + private String contacts; + + private String telephone; + + private String address; + + private BigDecimal finishDeposit; + + private BigDecimal needDebt; + + private BigDecimal debt; + + private BigDecimal materialCount; + + /** + * 是否有付款单或收款单 + */ + private Boolean hasFinancialFlag; + /** + * 是否有退款单 + */ + private Boolean hasBackFlag; + + /** + * 实际欠款 + */ + private BigDecimal realNeedDebt; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4StatementAccount.java b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4StatementAccount.java new file mode 100644 index 00000000..a0d4be8b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotHeadVo4StatementAccount.java @@ -0,0 +1,68 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotHeadVo4StatementAccount { + + private Long id; + + private String supplier; + + private String contacts; + + private String telephone; + + private String phoneNum; + + private String email; + + /** + * 起始期初金额 + */ + private BigDecimal beginNeed; + + /** + * 上期欠款金额 + */ + private BigDecimal preDebtMoney; + + /** + * 上期退货的欠款金额 + */ + private BigDecimal preReturnDebtMoney; + + + /** + * 上期收付款 + */ + private BigDecimal preBackMoney; + + /** + * 期初应收 + */ + private BigDecimal preNeed; + + /** + * 本期欠款 + */ + private BigDecimal debtMoney; + + /** + * 本期退货的欠款金额 + */ + private BigDecimal returnDebtMoney; + + /** + * 本期收付款 + */ + private BigDecimal backMoney; + + /** + * 期末应收 + */ + private BigDecimal allNeed; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/DepotItemStockWarningCount.java b/domain/src/main/java/com/wansensoft/vo/DepotItemStockWarningCount.java new file mode 100644 index 00000000..321681cc --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotItemStockWarningCount.java @@ -0,0 +1,48 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotItemStockWarningCount { + + private Long MId; + + private String barCode; + + private String MName; + + private String MModel; + + private String MaterialUnit; + + private String MColor; + + private String MStandard; + + private String MMfrs; + + private String unitName; + + private String MaterialOther; + + private String MOtherField1; + + private String MOtherField2; + + private String MOtherField3; + + private String depotName; + + private BigDecimal currentNumber; + + private BigDecimal lowSafeStock; + + private BigDecimal highSafeStock; + + private BigDecimal lowCritical; + + private BigDecimal highCritical; +} diff --git a/domain/src/main/java/com/wansensoft/vo/DepotItemVo4Stock.java b/domain/src/main/java/com/wansensoft/vo/DepotItemVo4Stock.java new file mode 100644 index 00000000..a3bdeda9 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotItemVo4Stock.java @@ -0,0 +1,26 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class DepotItemVo4Stock { + + private BigDecimal inTotal; + + private BigDecimal outTotal; + + private BigDecimal transfInTotal; + + private BigDecimal transfOutTotal; + + private BigDecimal assemInTotal; + + private BigDecimal assemOutTotal; + + private BigDecimal disAssemInTotal; + + private BigDecimal disAssemOutTotal; +} diff --git a/domain/src/main/java/com/wansensoft/vo/DepotItemVoBatchNumberList.java b/domain/src/main/java/com/wansensoft/vo/DepotItemVoBatchNumberList.java new file mode 100644 index 00000000..4d1f09ca --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/DepotItemVoBatchNumberList.java @@ -0,0 +1,33 @@ +package com.wansensoft.vo; + + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class DepotItemVoBatchNumberList { + + private String id; + + private String barCode; + + private String name; + + private String standard; + + private String model; + + private Long unitId; + + private String commodityUnit; + + private String batchNumber; + + private Date expirationDate; + + private String expirationDateStr; + + private BigDecimal totalNum; +} diff --git a/domain/src/main/java/com/wansensoft/vo/DeptListVO.java b/domain/src/main/java/com/wansensoft/vo/DeptListVO.java deleted file mode 100644 index 21cf2eac..00000000 --- a/domain/src/main/java/com/wansensoft/vo/DeptListVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.wansensoft.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class DeptListVO { - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long id; - - private String deptNumber; - - private String deptName; - - private String remark; - - private String sort; - - private List children; - - @Data - public static class DeptChildrenVO { - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long id; - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long parentId; - - private String deptNumber; - - private String deptName; - - private String remark; - - private String sort; - } -} diff --git a/domain/src/main/java/com/wansensoft/vo/FinishDepositVo.java b/domain/src/main/java/com/wansensoft/vo/FinishDepositVo.java new file mode 100644 index 00000000..c6a641f3 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/FinishDepositVo.java @@ -0,0 +1,13 @@ +package com.wansensoft.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class FinishDepositVo { + + private String number; + + private BigDecimal finishDeposit; +} diff --git a/domain/src/main/java/com/wansensoft/vo/LogVo4List.java b/domain/src/main/java/com/wansensoft/vo/LogVo4List.java new file mode 100644 index 00000000..0bcd8cd1 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/LogVo4List.java @@ -0,0 +1,14 @@ +package com.wansensoft.vo; + +import com.wansensoft.entities.log.Log; +import lombok.Data; + +@Data +public class LogVo4List extends Log { + + private String loginName; + + private String userName; + + private String createTimeStr; +} \ No newline at end of file diff --git a/domain/src/main/java/com/wansensoft/vo/MaterialCountVo.java b/domain/src/main/java/com/wansensoft/vo/MaterialCountVo.java new file mode 100644 index 00000000..119a6797 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/MaterialCountVo.java @@ -0,0 +1,13 @@ +package com.wansensoft.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class MaterialCountVo { + + private Long headerId; + + private BigDecimal materialCount; +} diff --git a/domain/src/main/java/com/wansensoft/vo/MaterialExtendVo4List.java b/domain/src/main/java/com/wansensoft/vo/MaterialExtendVo4List.java new file mode 100644 index 00000000..a76af7e7 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/MaterialExtendVo4List.java @@ -0,0 +1,24 @@ +package com.wansensoft.vo; + +import com.wansensoft.entities.material.MaterialExtend; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +@EqualsAndHashCode(callSuper = true) +@Data +public class MaterialExtendVo4List extends MaterialExtend { + + private String supplier; + + private String originPlace; + + private String unit; + + private String brandName; + + private BigDecimal guaranteePeriod; + + private BigDecimal memberDecimal; +} diff --git a/domain/src/main/java/com/wansensoft/vo/MaterialVoSearch.java b/domain/src/main/java/com/wansensoft/vo/MaterialVoSearch.java new file mode 100644 index 00000000..aa9eb5bd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/MaterialVoSearch.java @@ -0,0 +1,19 @@ +package com.wansensoft.vo; + +import lombok.Data; + +@Data +public class MaterialVoSearch { + + private String barCode; + + private String name; + + private String standard; + + private String model; + + private String color; + + private String unit; +} diff --git a/domain/src/main/java/com/wansensoft/vo/MaterialsListVo.java b/domain/src/main/java/com/wansensoft/vo/MaterialsListVo.java new file mode 100644 index 00000000..fd98f3eb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/MaterialsListVo.java @@ -0,0 +1,11 @@ +package com.wansensoft.vo; + +import lombok.Data; + +@Data +public class MaterialsListVo { + + private Long headerId; + + private String materialsList; +} diff --git a/domain/src/main/java/com/wansensoft/vo/MenuVO.java b/domain/src/main/java/com/wansensoft/vo/MenuVO.java deleted file mode 100644 index 2d348f0d..00000000 --- a/domain/src/main/java/com/wansensoft/vo/MenuVO.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.vo; - -import com.alibaba.fastjson.JSONObject; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class MenuVO { - - @JsonFormat(shape = JsonFormat.Shape.NUMBER) - private Integer id; - - private Integer parentId; - - private String name; - - private String path; - - private String component; - - private Integer sort; - - private String icon; - - private Integer menuType; - - private String type; - - private String redirect; - - private JSONObject meta; -} diff --git a/domain/src/main/java/com/wansensoft/vo/NodeAttributes.java b/domain/src/main/java/com/wansensoft/vo/NodeAttributes.java new file mode 100644 index 00000000..1d8717e2 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/NodeAttributes.java @@ -0,0 +1,11 @@ +package com.wansensoft.vo; + +import lombok.Data; + +@Data +public class NodeAttributes { + //编号 + private String no; + //类型 + private Integer type; +} diff --git a/domain/src/main/java/com/wansensoft/vo/RoleVO.java b/domain/src/main/java/com/wansensoft/vo/RoleVO.java deleted file mode 100644 index 9703ac44..00000000 --- a/domain/src/main/java/com/wansensoft/vo/RoleVO.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class RoleVO { - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long id; - - private String roleName; - - private String type; - - private Integer priceLimit; - - private Integer status; - - private String description; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime createTime; -} diff --git a/domain/src/main/java/com/wansensoft/vo/TreeNode.java b/domain/src/main/java/com/wansensoft/vo/TreeNode.java new file mode 100644 index 00000000..1aee47c2 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/TreeNode.java @@ -0,0 +1,39 @@ +package com.wansensoft.vo; + +import lombok.Data; + +import java.util.List; + +@Data +public class TreeNode { + /** + * id主键 + * */ + private Long id; + private Long key; + private Long value; + /** + * title显示的文本 + * */ + private String title; + /** + *state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。 + * */ + private String state="open"; + /** + *iconCls 节点图标id + * */ + private String iconCls; + /** + * checked 是否被选中 + * */ + private boolean checked; + /** + *attributes 自定义属性 + * */ + private String attributes; + /** + * children 子节点 + * */ + private List children; +} diff --git a/domain/src/main/java/com/wansensoft/vo/TreeNodeEx.java b/domain/src/main/java/com/wansensoft/vo/TreeNodeEx.java new file mode 100644 index 00000000..2a2373db --- /dev/null +++ b/domain/src/main/java/com/wansensoft/vo/TreeNodeEx.java @@ -0,0 +1,37 @@ +package com.wansensoft.vo; + +import lombok.Data; + +import java.util.List; + +@Data +public class TreeNodeEx { + /** + * id主键 + * */ + private Long id; + /** + * text显示的文本 + * */ + private String text; + /** + *state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。 + * */ + private String state="open"; + /** + *iconCls 节点图标id + * */ + private String iconCls; + /** + * checked 是否被选中 + * */ + private boolean checked; + /** + *attributes 自定义属性 + * */ + private NodeAttributes attributes; + /** + * children 子节点 + * */ + private List children; +} diff --git a/domain/src/main/java/com/wansensoft/vo/UserInfoVO.java b/domain/src/main/java/com/wansensoft/vo/UserInfoVO.java deleted file mode 100644 index b717dbe6..00000000 --- a/domain/src/main/java/com/wansensoft/vo/UserInfoVO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Builder; -import lombok.Data; -@Data -@Builder -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserInfoVO { - - /** 用户id */ - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long id; - - /** 用户昵称(别名 姓名) */ - private String name; - - /** 用户名(登陆的账户) */ - private String userName; - - /** 用户头像地址 */ - private String avatar; - - /** 用户token */ - private String token; - - /** 过期 */ - private long expire; -} diff --git a/domain/src/main/java/com/wansensoft/vo/UserListVO.java b/domain/src/main/java/com/wansensoft/vo/UserListVO.java deleted file mode 100644 index e4f6198b..00000000 --- a/domain/src/main/java/com/wansensoft/vo/UserListVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.wansensoft.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Builder; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -@Data -@Builder -@JsonInclude(JsonInclude.Include.NON_NULL) -public class UserListVO { - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long id; - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private List roleId; - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private List deptId; - - private String username; - - private String name; - - private String roleName; - - private String email; - - private String phoneNumber; - - private Integer status; - - private String type; - - private String deptName; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime createTime; -} diff --git a/domain/src/main/java/com/wansensoft/vo/UserRoleVO.java b/domain/src/main/java/com/wansensoft/vo/UserRoleVO.java deleted file mode 100644 index 465f2f49..00000000 --- a/domain/src/main/java/com/wansensoft/vo/UserRoleVO.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class UserRoleVO { - - @JsonFormat(shape = JsonFormat.Shape.STRING) - private Long roleId; - - private String roleName; - - private String roleType; -} diff --git a/middleware/pom.xml b/middleware/pom.xml index ba00ac45..8c800cf3 100644 --- a/middleware/pom.xml +++ b/middleware/pom.xml @@ -5,29 +5,19 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT middleware - 21 - 21 + 20 + 20 UTF-8 - - com.wansensoft - utils - 1.0-SNAPSHOT - - - com.wansensoft - dao - 1.0-SNAPSHOT - com.aliyun.oss aliyun-sdk-oss @@ -39,43 +29,5 @@ mybatis-plus-generator 3.5.3.1 - - - - - - - - - - - - io.jsonwebtoken - jjwt - 0.9.1 - - - com.auth0 - java-jwt - 3.11.0 - - - com.tencentcloudapi - tencentcloud-sdk-java - 3.1.870 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - \ No newline at end of file diff --git a/middleware/src/main/java/com/wansensoft/middleware/mybatisplus/MpCodeQuickGeneration.java b/middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java similarity index 74% rename from middleware/src/main/java/com/wansensoft/middleware/mybatisplus/MpCodeQuickGeneration.java rename to middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java index 8fe68399..ecfd3fe5 100644 --- a/middleware/src/main/java/com/wansensoft/middleware/mybatisplus/MpCodeQuickGeneration.java +++ b/middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java @@ -1,20 +1,11 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.middleware.mybatisplus; +package com.wansensoft.middleware; import com.baomidou.mybatisplus.generator.FastAutoGenerator; import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.sql.Types; import java.util.Collections; public class MpCodeQuickGeneration { diff --git a/middleware/src/main/java/com/wansensoft/middleware/security/JWTConfig.java b/middleware/src/main/java/com/wansensoft/middleware/security/JWTConfig.java deleted file mode 100644 index cc18af9c..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/security/JWTConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.middleware.security; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class JWTConfig implements WebMvcConfigurer { - - private final JWTInterceptor interceptor; - - public JWTConfig(JWTInterceptor interceptor) { - this.interceptor = interceptor; - } - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(interceptor) - .addPathPatterns("/**") - // 路径不进行拦截 - .excludePathPatterns("/v2/common/captcha") - .excludePathPatterns("/user/register") - .excludePathPatterns("/user/login") - .excludePathPatterns("/user/mobileLogin") - .excludePathPatterns("/user/updatePassword") - .excludePathPatterns("/v2/common/sms/{type}/{phoneNumber}"); - } -} \ No newline at end of file diff --git a/middleware/src/main/java/com/wansensoft/middleware/security/JWTInterceptor.java b/middleware/src/main/java/com/wansensoft/middleware/security/JWTInterceptor.java deleted file mode 100644 index 4a5ef661..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/security/JWTInterceptor.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.middleware.security; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wansensoft.utils.redis.RedisUtil; -import io.jsonwebtoken.Claims; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; -import org.springframework.web.servlet.HandlerInterceptor; - -import java.util.HashMap; -import java.util.Map; - -@Slf4j -@Component -public class JWTInterceptor implements HandlerInterceptor { //校验类 - - private final RedisUtil redisUtil; - - private final JWTUtil jwtUtil; - - public JWTInterceptor(RedisUtil redisUtil, JWTUtil jwtUtil) { - this.redisUtil = redisUtil; - this.jwtUtil = jwtUtil; - } - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - Map map = new HashMap<>(); - String requestToken = request.getHeader("Authorization"); - if(StringUtils.hasText(requestToken)){ - Claims claims = jwtUtil.checkToken(request.getHeader("Authorization")); - if (claims != null) { - String token = redisUtil.getString(claims.get("userName") + ":token"); - if(Boolean.TRUE.equals(redisUtil.hasKey(claims.get("userName") + ":token"))){ - if(requestToken.equals(token)){ - // token正确 - return true; - }else { - // token错误,判为并发登录,挤下线 - // 对应的修改响应头的状态,用于前端判断做出相应的策略 - map.put("msg", "token无效签名"); - map.put("code", "A0312"); - log.error("用户token验证失败======>" + "无效签名"); - } - }else { - // token不存在于redis中,已过期 - map.put("msg", "token过期"); - map.put("code", "A0312"); - log.error("用户token验证失败======>" + "token过期"); - } - } - } - map.put("msg", "token无效"); - map.put("code", "A0312"); - - String value = new ObjectMapper().writeValueAsString(map); - response.setContentType("application/json;charset=UTF-8"); - response.getWriter().println(value); - return false; - - - -// Map map = new HashMap<>(); -// String token = request.getHeader("Authorization"); -// try { -// JWTUtils.verify(token); //验证令牌 -// Long userId = JWTUtils.getToken(token); -// return true; //放行请求 -// } catch (SignatureVerificationException e) { -// log.error("用户token验证失败======>" + "无效签名"); -// map.put("msg", "无效签名"); -// } catch (TokenExpiredException e) { -// log.error("用户token验证失败======>" + "token过期"); -// map.put("msg", "token过期"); -// } catch (AlgorithmMismatchException e) { -// log.error("用户token验证失败======>" + "token算法不一致"); -// map.put("msg", "token算法不一致"); -// } catch (Exception e) { -// log.error("用户token验证失败======>" + "token无效"); -// map.put("msg", "token无效"); -// } -// map.put("code", "A0312"); -// String value = new ObjectMapper().writeValueAsString(map); -// response.setContentType("application/json;charset=UTF-8"); -// response.getWriter().println(value); -// return false; - } - -} diff --git a/middleware/src/main/java/com/wansensoft/middleware/security/JWTUtil.java b/middleware/src/main/java/com/wansensoft/middleware/security/JWTUtil.java deleted file mode 100644 index 2e1ba9c1..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/security/JWTUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.middleware.security; - -import com.auth0.jwt.JWT; -import com.auth0.jwt.JWTVerifier; -import com.auth0.jwt.algorithms.Algorithm; -import com.auth0.jwt.interfaces.DecodedJWT; -import io.jsonwebtoken.*; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/** - *

- * 封装工具类 - *

- */ -@Component -public class JWTUtil { - - /** 有效期为一天 **/ - private static long time = 1000*60*60*24; - - private static String SECRET ="token"; - - /** - * 生成token - * - */ - public String createToken(String userName) { - // 设置JWT头部 - Map map = new HashMap<>(); - map.put("alg", "HS256"); - map.put("typ", "JWT"); - // 创建token - JwtBuilder builder = Jwts.builder(); - - // 添加头部,可省略保持默认,默认即map中的键值对 - return builder.setHeader(map) - // 设置过期时间 - .setExpiration(new Date(System.currentTimeMillis()+time)) - .claim("userName", userName) - .setSubject(String.valueOf(userName)) - // 设置签名解码算法 - .signWith(SignatureAlgorithm.HS256, SECRET) - .compact(); - } - - /** - * 验证token - * @param token - */ - public Claims checkToken(String token){ - if(token == null){ - return null; - } - JwtParser parser = Jwts.parser(); - try { - Jws claimsJws = parser.setSigningKey(SECRET).parseClaimsJws(token); - Claims claims = claimsJws.getBody(); - // 如果解析token正常,返回claims - return claims; - }catch (Exception e) { - // 如果解析token抛出异常,返回null - return null; - } - } - - /** - * 通过token获取用户的id - * @param token - * @return - */ - public Long getToken(String token){ - JWTVerifier verifier = JWT.require(Algorithm.HMAC256(SECRET)).build(); - DecodedJWT jwt = verifier.verify(token); - String jwtSubject = jwt.getSubject(); - return Long.valueOf(jwtSubject); - } - -} diff --git a/middleware/src/main/java/com/wansensoft/middleware/security/LoginUser.java b/middleware/src/main/java/com/wansensoft/middleware/security/LoginUser.java deleted file mode 100644 index ed8bf874..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/security/LoginUser.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -//package com.wansensoft.middleware.security; -// -//import com.wansensoft.entities.user.SysUser; -//import org.springframework.security.core.GrantedAuthority; -//import org.springframework.security.core.userdetails.UserDetails; -// -//import java.util.Collection; -// -//public class LoginUser implements UserDetails { -// -// private SysUser sysUser; -// -// @Override -// public Collection getAuthorities() { -// return null; -// } -// -// @Override -// public String getPassword() { -// return sysUser.getPassword(); -// } -// -// @Override -// public String getUsername() { -// return sysUser.getUsername(); -// } -// -// @Override -// public boolean isAccountNonExpired() { -// return true; -// } -// -// @Override -// public boolean isAccountNonLocked() { -// return true; -// } -// -// @Override -// public boolean isCredentialsNonExpired() { -// return true; -// } -// -// @Override -// public boolean isEnabled() { -// return true; -// } -//} diff --git a/middleware/src/main/java/com/wansensoft/middleware/security/SecurityConfig.java b/middleware/src/main/java/com/wansensoft/middleware/security/SecurityConfig.java deleted file mode 100644 index a12c2e46..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/security/SecurityConfig.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -//package com.wansensoft.middleware.security; -// -//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -//import com.wansensoft.entities.user.SysUser; -//import com.wansensoft.mappers.user.SysUserMapper; -//import com.wansensoft.mappers.user.UserMapper; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import org.springframework.context.annotation.Lazy; -//import org.springframework.security.authentication.AuthenticationManager; -//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -//import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; -//import org.springframework.security.config.annotation.web.builders.HttpSecurity; -//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration; -//import org.springframework.security.core.userdetails.UserDetails; -//import org.springframework.security.core.userdetails.UserDetailsService; -//import org.springframework.security.core.userdetails.UsernameNotFoundException; -//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -//import org.springframework.security.crypto.password.PasswordEncoder; -//import org.springframework.security.web.SecurityFilterChain; -// -//import static org.springframework.security.config.Customizer.withDefaults; -// -//@Configuration -//@EnableWebSecurity -//public class SecurityConfig extends WebSecurityConfiguration implements UserDetailsService{ -// -//// @Autowired -//// private UserDetailsService userDetailsService; -// -// @Autowired -// private SysUserMapper userMapper; -// -// @Override -// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { -// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); -// wrapper.eq(SysUser::getUsername, username); -// SysUser user = userMapper.selectOne(wrapper); -// if(user == null){ -// throw new RuntimeException("用户名或密码错误"); -// } -// -// return (UserDetails) user; -// } -// -// @Bean -// public SecurityFilterChain apiFilterChain(HttpSecurity http) throws Exception { -// http -// .securityMatcher("/erp-api/**") -// .authorizeHttpRequests(authorize -> authorize -// .anyRequest().permitAll() -// ) -// .httpBasic(withDefaults()); -// return http.build(); -// } -// -// @Bean -// public PasswordEncoder passwordEncoder() { -// return new BCryptPasswordEncoder(); -// } -// -//// @Bean -//// protected void configure(AuthenticationManagerBuilder auth) throws Exception { -//// // 指定UserDetailService和加密器 -//// auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder()); -//// } -// -// @Bean -// public AuthenticationManager authenticationManager(AuthenticationConfiguration config) throws Exception { -// return config.getAuthenticationManager(); -// } -// -//} diff --git a/middleware/src/main/java/com/wansensoft/middleware/sms/SendSms.java b/middleware/src/main/java/com/wansensoft/middleware/sms/SendSms.java deleted file mode 100644 index 8c7fa615..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/sms/SendSms.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.wansensoft.middleware.sms; - -import com.tencentcloudapi.common.Credential; -import com.tencentcloudapi.common.exception.TencentCloudSDKException; -//导入可选配置类 -import com.tencentcloudapi.common.profile.ClientProfile; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.sms.v20190711.SmsClient; -import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest; -import com.tencentcloudapi.sms.v20190711.models.SendSmsResponse; - - -public class SendSms { - - public static void main(String[] args) { - try { - /* 必要步骤: - * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。 - * 这里采用的是从环境变量读取的方式,需要在环境变量中先设置这两个值。 - * 你也可以直接在代码中写死密钥对,但是小心不要将代码复制、上传或者分享给他人, - * 以免泄露密钥对危及你的财产安全。 - * CAM密匙查询: https://console.tencentcloud.com/cam/capi*/ - Credential cred = new Credential("secretId", "secretKey"); - // 实例化一个http选项,可选,没有特殊需求可以跳过 - HttpProfile httpProfile = new HttpProfile(); - // 设置代理 - // httpProfile.setProxyHost("真实代理ip"); - // httpProfile.setProxyPort(真实代理端口); - /* SDK默认使用POST方法。 - * 如果你一定要使用GET方法,可以在这里设置。GET方法无法处理一些较大的请求 */ - httpProfile.setReqMethod("POST"); - /* SDK有默认的超时时间,非必要请不要进行调整 - * 如有需要请在代码中查阅以获取最新的默认值 */ - httpProfile.setConnTimeout(60); - /* SDK会自动指定域名。通常是不需要特地指定域名的,但是如果你访问的是金融区的服务 - * 则必须手动指定域名,例如sms的上海金融区域名: sms.ap-shanghai-fsi.tencentcloudapi.com */ - httpProfile.setEndpoint("sms.tencentcloudapi.com"); - /* 非必要步骤: - * 实例化一个客户端配置对象,可以指定超时时间等配置 */ - ClientProfile clientProfile = new ClientProfile(); - /* SDK默认用TC3-HMAC-SHA256进行签名 - * 非必要请不要修改这个字段 */ - clientProfile.setSignMethod("HmacSHA256"); - clientProfile.setHttpProfile(httpProfile); - /* 实例化要请求产品(以sms为例)的client对象 - * 第二个参数是地域信息,根据您选择的国际站地域,如您选择的是新加坡国际站,则应该填入字符串ap-singapore,地域列表可参考 https://www.tencentcloud.com/document/api/382/40466?lang=en#region-list */ - SmsClient client = new SmsClient(cred, "ap-shanghai",clientProfile); - /* 实例化一个请求对象,根据调用的接口和实际情况,可以进一步设置请求参数 - * 你可以直接查询SDK源码确定接口有哪些属性可以设置 - * 属性可能是基本类型,也可能引用了另一个数据结构 - * 推荐使用IDE进行开发,可以方便的跳转查阅各个接口和数据结构的文档说明 */ - SendSmsRequest req = new SendSmsRequest(); - /* 填充请求参数,这里request对象的成员变量即对应接口的入参 - * 你可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义 - * 基本类型的设置: - * 帮助链接: - * 短信控制台: https://console.tencentcloud.com/smsv2 - * sms helper: https://www.tencentcloud.com/document/product/382/3773?from_cn_redirect=1 */ - /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666 */ - String sdkAppId = "1400009099"; - req.setSmsSdkAppid(sdkAppId); - /* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名,签名信息可登录 [短信控制台] 查看 */ - String signName = "签名内容"; - req.setSign(signName); - /* 国际/港澳台短信 SenderId: 中国大陆地区短信填空,默认未开通,如需开通请联系 [sms helper] */ - String senderid = ""; - req.setSenderId(senderid); - /* 用户的 session 内容: 可以携带用户侧 ID 等上下文信息,server 会原样返回 */ - String sessionContext = "xxx"; - req.setSessionContext(sessionContext); - /* 短信号码扩展号: 默认未开通,如需开通请联系 [sms helper] */ - String extendCode = ""; - req.setExtendCode(extendCode); - /* 模板 ID: 必须填写已审核通过的模板 ID。模板ID可登录 [短信控制台] 查看 */ - String templateId = "400000"; - req.setTemplateID(templateId); - /* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号] - * 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */ - String[] phoneNumberSet = {"+8621212313123", "+8612345678902", "+8612345678903"}; - req.setPhoneNumberSet(phoneNumberSet); - /* 模板参数: 若无模板参数,则设置为空 */ - String[] templateParamSet = {"5678"}; - req.setTemplateParamSet(templateParamSet); - /* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的 - * 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */ - SendSmsResponse res = client.SendSms(req); - // 输出json格式的字符串回包 - System.out.println(SendSmsResponse.toJsonString(res)); - // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义 - System.out.println(res.getRequestId()); - } catch (TencentCloudSDKException e) { - e.printStackTrace(); - } - } -} diff --git a/plugins/pom.xml b/plugins/pom.xml index 654e1bb8..f77a113c 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -5,15 +5,15 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT plugins - 21 - 21 + 17 + 17 UTF-8 diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java b/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java new file mode 100644 index 00000000..50db03a6 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java @@ -0,0 +1,5 @@ +package com.wansensoft.plugins.config; + +public class CodeGeneration { + +} diff --git a/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessParamCheckingException.java b/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessParamCheckingException.java new file mode 100644 index 00000000..a0f3d291 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessParamCheckingException.java @@ -0,0 +1,32 @@ +package com.wansensoft.plugins.exception; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +@Getter +public class BusinessParamCheckingException extends Exception { + + private static final long serialVersionUID = 1L; + private int code; + private Map data; + + public BusinessParamCheckingException(int code, String reason) { + super(reason); + Map objectMap = new HashMap<>(); + objectMap.put("message", reason); + this.code = code; + this.data = objectMap; + } + + public BusinessParamCheckingException(int code, String reason, Throwable throwable) { + super(reason, throwable); + Map objectMap = new HashMap<>(); + objectMap.put("message", reason); + this.code = code; + this.data = objectMap; + } +} diff --git a/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessRunTimeException.java b/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessRunTimeException.java new file mode 100644 index 00000000..ece8b53a --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/exception/BusinessRunTimeException.java @@ -0,0 +1,32 @@ +package com.wansensoft.plugins.exception; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; + +@Slf4j +@Getter +public class BusinessRunTimeException extends RuntimeException { + + private static final long serialVersionUID = 1L; + private int code; + private Map data; + + public BusinessRunTimeException(int code, String reason) { + super(reason); + Map objectMap = new HashMap<>(); + objectMap.put("message", reason); + this.code = code; + this.data = objectMap; + } + + public BusinessRunTimeException(int code, String reason, Throwable throwable) { + super(reason, throwable); + Map objectMap = new HashMap<>(); + objectMap.put("message", reason); + this.code = code; + this.data = objectMap; + } +} diff --git a/plugins/src/main/java/com/wansensoft/plugins/exception/GlobalExceptionHandler.java b/plugins/src/main/java/com/wansensoft/plugins/exception/GlobalExceptionHandler.java new file mode 100644 index 00000000..7eff8380 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/exception/GlobalExceptionHandler.java @@ -0,0 +1,47 @@ +package com.wansensoft.plugins.exception; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.utils.constants.ExceptionConstants; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import jakarta.servlet.http.HttpServletRequest; + +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(value = Exception.class) + @ResponseBody + public Object handleException(Exception e, HttpServletRequest request) { + JSONObject status = new JSONObject(); + + // 针对业务参数异常的处理 + if (e instanceof BusinessParamCheckingException) { + status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ((BusinessParamCheckingException) e).getCode()); + status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ((BusinessParamCheckingException) e).getData()); + return status; + } + + //针对业务运行时异常的处理 + if (e instanceof BusinessRunTimeException) { + status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ((BusinessRunTimeException) e).getCode()); + status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ((BusinessRunTimeException) e).getData()); + return status; + } + + status.put(ExceptionConstants.GLOBAL_RETURNS_CODE, ExceptionConstants.SERVICE_SYSTEM_ERROR_CODE); + status.put(ExceptionConstants.GLOBAL_RETURNS_DATA, ExceptionConstants.SERVICE_SYSTEM_ERROR_MSG); + log.error("Global Exception Occured => url : {}, msg : {}", request.getRequestURL(), e.getMessage()); + /** + * create by: qiankunpingtai + * create time: 2019/4/18 17:41 + * 这里输出完整的堆栈信息,否则有些异常完全不知道哪里出错了。 + */ + log.error("Global Exception Occured => url : {}", request.getRequestURL(), e); + e.printStackTrace(); + return status; + } +} \ No newline at end of file diff --git a/plugins/src/main/java/com/wansensoft/plugins/exception/JshException.java b/plugins/src/main/java/com/wansensoft/plugins/exception/JshException.java new file mode 100644 index 00000000..b0536640 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/exception/JshException.java @@ -0,0 +1,27 @@ +package com.wansensoft.plugins.exception; + +import com.wansensoft.utils.constants.ExceptionConstants; +import org.slf4j.Logger; + +/** + * 封装日志打印,收集日志 + * author: ji shenghua, qq 752718 920 + */ +public class JshException { + + public static void readFail(Logger logger, Exception e) { + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + + public static void writeFail(Logger logger, Exception e) { + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + + +} diff --git a/plugins/src/main/java/com/wansensoft/plugins/security/LogCostFilter.java b/plugins/src/main/java/com/wansensoft/plugins/security/LogCostFilter.java new file mode 100644 index 00000000..3b8559b1 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/security/LogCostFilter.java @@ -0,0 +1,95 @@ +package com.wansensoft.plugins.security; + +import com.wansensoft.utils.constants.BusinessConstants; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.annotation.WebInitParam; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.util.StringUtils; + +import jakarta.annotation.Resource; +import jakarta.servlet.*; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +@WebFilter(filterName = "LogCostFilter", urlPatterns = {"/*"}, + initParams = {@WebInitParam(name = "filterPath", + value = "/wansenerp/user/login#/wansenerp/user/weixinLogin#/wansenerp/user/weixinBind#" + + "/wansenerp/user/registerUser#/wansenerp/user/randomImage#" + + "/wansenerp/platformConfig/getPlatform#/wansenerp/v2/api-docs#/wansenerp/webjars#" + + "/wansenerp/systemConfig/static#/wansenerp/api/plugin/wechat/weChat/share")}) +public class LogCostFilter implements Filter { + + private static final String FILTER_PATH = "filterPath"; + + public static final String ACCESS_TOKEN = "X-Access-Token"; + + private String[] allowUrls; + @Resource + public RedisTemplate redisTemplate; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + String filterPath = filterConfig.getInitParameter(FILTER_PATH); + if (!StringUtils.isEmpty(filterPath)) { + allowUrls = filterPath.contains("#") ? filterPath.split("#") : new String[]{filterPath}; + } + } + + public Object getObjectFromSessionByKey(HttpServletRequest request, String key){ + Object obj=null; + if(request==null){ + return null; + } + String token = request.getHeader(ACCESS_TOKEN); + if(token!=null) { + //开启redis,用户数据放在redis中,从redis中获取 + if(redisTemplate.opsForHash().hasKey(token,key)){ + //redis中存在,拿出来使用 + obj=redisTemplate.opsForHash().get(token,key); + redisTemplate.expire(token, BusinessConstants.MAX_SESSION_IN_SECONDS, TimeUnit.SECONDS); + } + } + return obj; + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletRequest servletRequest = (HttpServletRequest) request; + HttpServletResponse servletResponse = (HttpServletResponse) response; + String requestUrl = servletRequest.getRequestURI(); + //具体,比如:处理若用户未登录,则跳转到登录页 + String userId = String.valueOf(getObjectFromSessionByKey(servletRequest,"userId")); + + System.err.println("userId: " + userId); + + if(StringUtils.hasLength(userId)) { //如果已登录,不阻止 + chain.doFilter(request, response); + return; + } + if (requestUrl != null && (requestUrl.contains("/doc.html") || + requestUrl.contains("/user/login") || requestUrl.contains("/user/register"))) { + chain.doFilter(request, response); + return; + } + if (null != allowUrls && allowUrls.length > 0) { + for (String url : allowUrls) { + if (requestUrl.startsWith(url)) { + chain.doFilter(request, response); + return; + } + } + } + servletResponse.setStatus(500); + if(requestUrl != null && !requestUrl.contains("/user/logout") && !requestUrl.contains("/function/findMenuByPNumber")) { + servletResponse.getWriter().write("loginOut"); + } + } + + @Override + public void destroy() { + + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 507396d3..6a0dbb52 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT pom wansenerp 万森ERP + utils domain @@ -21,16 +22,15 @@ org.springframework.boot spring-boot-starter-parent - 3.1.4 + 3.1.3 UTF-8 UTF-8 - 21 - 21 - 1.9.10 - + 17 + 17 + @@ -41,6 +41,7 @@ org.springframework.boot spring-boot-starter-web + org.springframework.boot spring-boot-starter-test @@ -57,17 +58,13 @@ org.projectlombok lombok - 1.18.30 + 1.18.24 provided - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin.version} - - + + WanSenERP src/main/java @@ -80,36 +77,6 @@ - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - compile - - compile - - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/main/java - - - - - test-compile - test-compile - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - - - - org.springframework.boot spring-boot-maven-plugin @@ -123,14 +90,17 @@ - - - - repackage - - - + + + + + + + + + + diff --git a/service/pom.xml b/service/pom.xml index 0bed44db..aad0ccbd 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -5,39 +5,40 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT service - 21 - 21 + 20 + 20 UTF-8 com.wansensoft - middleware + dao 1.0-SNAPSHOT + com.wansensoft - dao + utils 1.0-SNAPSHOT com.wansensoft - utils + plugins 1.0-SNAPSHOT com.wansensoft - plugins + middleware 1.0-SNAPSHOT diff --git a/service/src/main/java/com/wansensoft/service/CommonQueryManager.java b/service/src/main/java/com/wansensoft/service/CommonQueryManager.java new file mode 100644 index 00000000..ba812c5b --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/CommonQueryManager.java @@ -0,0 +1,131 @@ +package com.wansensoft.service; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.constants.BusinessConstants; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@Service +public class CommonQueryManager { + + private final InterfaceContainer container; + public CommonQueryManager(InterfaceContainer container) { + this.container = container; + } + + /** + * 查询单条 + * + * @param apiName 接口名称 + * @param id ID + */ + public Object selectOne(String apiName, Long id) throws Exception { + if (StringUtil.isNotEmpty(apiName) && id!=null) { + return container.getCommonQuery(apiName).selectOne(id); + } + return null; + } + + /** + * 查询 + * @param apiName + * @param parameterMap + * @return + */ + public List select(String apiName, Map parameterMap)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).select(parameterMap); + } + return new ArrayList(); + } + + /** + * 计数 + * @param apiName + * @param parameterMap + * @return + */ + public Long counts(String apiName, Map parameterMap)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).counts(parameterMap); + } + return BusinessConstants.DEFAULT_LIST_NULL_NUMBER; + } + + /** + * 插入 + * @param apiName + * @param obj + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insert(String apiName, JSONObject obj, HttpServletRequest request) throws Exception{ + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).insert(obj, request); + } + return 0; + } + + /** + * 更新 + * @param apiName + * @param obj + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int update(String apiName, JSONObject obj, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).update(obj, request); + } + return 0; + } + + /** + * 删除 + * @param apiName + * @param id + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int delete(String apiName, Long id, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).delete(id, request); + } + return 0; + } + + /** + * 批量删除 + * @param apiName + * @param ids + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteBatch(String apiName, String ids, HttpServletRequest request)throws Exception { + if (StringUtil.isNotEmpty(apiName)) { + return container.getCommonQuery(apiName).deleteBatch(ids, request); + } + return 0; + } + + /** + * 判断是否存在 + * @param apiName + * @param id + * @param name + * @return + */ + public int checkIsNameExist(String apiName, Long id, String name) throws Exception{ + if (StringUtil.isNotEmpty(apiName) && name!=null) { + return container.getCommonQuery(apiName).checkIsNameExist(id, name); + } + return 0; + } + +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/CommonService.java b/service/src/main/java/com/wansensoft/service/CommonService.java new file mode 100644 index 00000000..a9a4eed9 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/CommonService.java @@ -0,0 +1,169 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.material.MaterialInitialStock; +import com.wansensoft.entities.material.MaterialInitialStockExample; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.entities.supplier.SupplierExample; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.account.AccountHeadMapperEx; +import com.wansensoft.mappers.account.AccountItemMapperEx; +import com.wansensoft.mappers.material.MaterialInitialStockMapper; +import com.wansensoft.mappers.material.MaterialMapper; +import com.wansensoft.mappers.material.MaterialMapperEx; +import com.wansensoft.mappers.role.RoleMapperEx; +import com.wansensoft.mappers.supplier.SupplierMapper; +import com.wansensoft.mappers.user.UserMapper; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.utils.constants.BusinessConstants; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Objects; + +@Service +public class CommonService { + + private final RedisService redisService; + + private final UserMapper userMapper; + + private final RoleMapperEx roleMapperEx; + + private final MaterialMapper materialMapper; + + private final MaterialMapperEx materialMapperEx; + + private final MaterialInitialStockMapper materialInitialStockMapper; + + private final SupplierMapper supplierMapper; + + private final AccountHeadMapperEx accountHeadMapperEx; + + private final AccountItemMapperEx accountItemMapperEx; + + public CommonService(RedisService redisService, UserMapper userMapper, RoleMapperEx roleMapperEx, MaterialMapper materialMapper, MaterialMapperEx materialMapperEx, MaterialInitialStockMapper materialInitialStockMapper, SupplierMapper supplierMapper, AccountHeadMapperEx accountHeadMapperEx, AccountItemMapperEx accountItemMapperEx) { + this.redisService = redisService; + this.userMapper = userMapper; + this.roleMapperEx = roleMapperEx; + this.materialMapper = materialMapper; + this.materialMapperEx = materialMapperEx; + this.materialInitialStockMapper = materialInitialStockMapper; + this.supplierMapper = supplierMapper; + this.accountHeadMapperEx = accountHeadMapperEx; + this.accountItemMapperEx = accountItemMapperEx; + } + + public User getCurrentUser() { + HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); + long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + return userMapper.selectByPrimaryKey(userId); + } + + public Long getUserId(HttpServletRequest request) { + Object userIdObj = redisService.getObjectFromSessionByKey(request,"userId"); + Long userId = null; + if(userIdObj != null) { + userId = Long.parseLong(userIdObj.toString()); + } + return userId; + } + + public Material getMaterial(long id) { + Material result=null; + try{ + result = materialMapper.selectByPrimaryKey(id); + }catch(Exception e){ + e.printStackTrace(); + } + return result; + } + public Unit findUnit(Long mId){ + Unit unit = new Unit(); + try{ + List list = materialMapperEx.findUnitList(mId); + if(list!=null && !list.isEmpty()) { + unit = list.get(0); + } + }catch(Exception e){ + e.printStackTrace(); + } + return unit; + } + + public BigDecimal getInitStockByMidAndDepotList(List depotList, Long materialId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialInitialStockExample example = new MaterialInitialStockExample(); + if(depotList!=null && !depotList.isEmpty()) { + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdIn(depotList) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + example.createCriteria().andMaterialIdEqualTo(materialId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list = materialInitialStockMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + for(MaterialInitialStock ms: list) { + if(ms!=null) { + stock = stock.add(ms.getNumber()); + } + } + } + return stock; + } + + public List getMaterialByBarCode(String barCode) { + String [] barCodeArray=barCode.split(","); + return materialMapperEx.getMaterialByBarCode(barCodeArray); + } + + public List findBySelectCus() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("客户").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + e.printStackTrace(); + } + return list; + } + + public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn) { + Supplier supplier; + supplier = supplierMapper.selectByPrimaryKey(supplierId); + int result=0; + if(supplier!=null) { + supplier.setAdvanceIn(supplier.getAdvanceIn().add(advanceIn)); //增加预收款的金额,可能增加的是负值 + result = supplierMapper.updateByPrimaryKeySelective(supplier); + } + return result; + } + + public Supplier getSupplier(long id) { + Supplier result=null; + try{ + result=supplierMapper.selectByPrimaryKey(id); + }catch(Exception e){ + e.printStackTrace(); + } + return result; + } + + public List getFinancialBillNoByBillIdList(List idList) { + return accountHeadMapperEx.getFinancialBillNoByBillIdList(idList); + } + + public BigDecimal getEachAmountByBillId(Long billId) { + return accountItemMapperEx.getEachAmountByBillId(billId).abs(); + } +} diff --git a/service/src/main/java/com/wansensoft/service/ICommonQuery.java b/service/src/main/java/com/wansensoft/service/ICommonQuery.java new file mode 100644 index 00000000..a77ccf0c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/ICommonQuery.java @@ -0,0 +1,77 @@ +package com.wansensoft.service; + +import com.alibaba.fastjson.JSONObject; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * 通用查询接口 + * 功能:1、单条查询 2、分页+搜索 3、查询数量 + */ +public interface ICommonQuery { + /** + * 根据id查询明细。 + * + * @param id 资源id + * @return 资源 + */ + Object selectOne(Long id) throws Exception; + + /** + * 自定义查询 + * + * @param parameterMap 查询参数 + * @return 查询结果 + */ + List select(Map parameterMap) throws Exception; + + /** + * 查询数量 + * + * @param parameterMap 查询参数 + * @return 查询结果 + */ + Long counts(Map parameterMap) throws Exception; + + /** + * 新增数据 + * + * @param obj + * @return + */ + int insert(JSONObject obj, HttpServletRequest request) throws Exception; + + /** + * 更新数据 + * + * @param obj + * @return + */ + int update(JSONObject obj, HttpServletRequest request) throws Exception; + + /** + * 删除数据 + * + * @param id + * @return + */ + int delete(Long id, HttpServletRequest request) throws Exception; + + /** + * 批量删除数据 + * + * @param ids + * @return + */ + int deleteBatch(String ids, HttpServletRequest request) throws Exception; + + /** + * 查询名称是否存在 + * + * @param id + * @return + */ + int checkIsNameExist(Long id, String name) throws Exception; +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java b/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java index bd5e9e19..c3722725 100644 --- a/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java +++ b/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service; import com.wansensoft.entities.IncomeExpense; @@ -19,6 +7,9 @@ *

* 收支项目 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IIncomeExpenseService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/IOperatorService.java b/service/src/main/java/com/wansensoft/service/IOperatorService.java index 683b444e..7b8ae561 100644 --- a/service/src/main/java/com/wansensoft/service/IOperatorService.java +++ b/service/src/main/java/com/wansensoft/service/IOperatorService.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service; import com.wansensoft.entities.Operator; @@ -19,6 +7,9 @@ *

* 经手人表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IOperatorService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java b/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java new file mode 100644 index 00000000..83cb31a6 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.SystemSupplier; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 供应商/客户信息表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISystemSupplierService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java b/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java index 84fc0345..cf5cd056 100644 --- a/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service; import com.wansensoft.entities.IncomeExpense; @@ -21,6 +9,9 @@ *

* 收支项目 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class IncomeExpenseServiceImpl extends ServiceImpl implements IIncomeExpenseService { diff --git a/service/src/main/java/com/wansensoft/service/InterfaceContainer.java b/service/src/main/java/com/wansensoft/service/InterfaceContainer.java new file mode 100644 index 00000000..01d11cf7 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/InterfaceContainer.java @@ -0,0 +1,27 @@ +package com.wansensoft.service; + +import com.wansensoft.utils.AnnotationUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +@Service +public class InterfaceContainer { + private final Map configComponentMap = new HashMap<>(); + + @Autowired(required = false) + private synchronized void init(ICommonQuery[] configComponents) { + for (ICommonQuery configComponent : configComponents) { + ResourceInfo info = AnnotationUtils.getAnnotation(configComponent, ResourceInfo.class); + if (info != null) { + configComponentMap.put(info.value(), configComponent); + } + } + } + + public ICommonQuery getCommonQuery(String apiName) { + return configComponentMap.get(apiName); + } +} diff --git a/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java b/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java index 79257445..2e2a4215 100644 --- a/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service; import com.wansensoft.entities.Operator; @@ -21,6 +9,9 @@ *

* 经手人表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class OperatorServiceImpl extends ServiceImpl implements IOperatorService { diff --git a/service/src/main/java/com/wansensoft/service/ResourceInfo.java b/service/src/main/java/com/wansensoft/service/ResourceInfo.java index db1733fb..df126bb2 100644 --- a/service/src/main/java/com/wansensoft/service/ResourceInfo.java +++ b/service/src/main/java/com/wansensoft/service/ResourceInfo.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service; import java.lang.annotation.*; diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SystemSupplierServiceImpl.java b/service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java similarity index 72% rename from service/src/main/java/com/wansensoft/service/system/impl/SystemSupplierServiceImpl.java rename to service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java index 0f76e59c..b60d2c9f 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SystemSupplierServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java @@ -1,9 +1,8 @@ -package com.wansensoft.service.system.impl; +package com.wansensoft.service; -import com.wansensoft.entities.system.SystemSupplier; +import com.wansensoft.entities.SystemSupplier; import com.wansensoft.mappers.SystemSupplierMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansensoft.service.system.ISystemSupplierService; import org.springframework.stereotype.Service; /** diff --git a/service/src/main/java/com/wansensoft/service/account/AccountComponent.java b/service/src/main/java/com/wansensoft/service/account/AccountComponent.java new file mode 100644 index 00000000..0a012f79 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/account/AccountComponent.java @@ -0,0 +1,77 @@ +package com.wansensoft.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@AccountResource +public class AccountComponent implements ICommonQuery { + + private final AccountService accountService; + + public AccountComponent(AccountService accountService) { + this.accountService = accountService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return accountService.getAccount(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountList(map); + } + + private List getAccountList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String serialNo = StringUtil.getInfo(search, "serialNo"); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return accountService.select(name, serialNo, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String serialNo = StringUtil.getInfo(search, "serialNo"); + String remark = StringUtil.getInfo(search, "remark"); + return accountService.countAccount(name, serialNo, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountService.insertAccount(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountService.updateAccount(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountService.deleteAccount(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountService.batchDeleteAccount(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return accountService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/account/AccountResource.java b/service/src/main/java/com/wansensoft/service/account/AccountResource.java new file mode 100644 index 00000000..cb7a776e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/account/AccountResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.account; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "account") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountResource { +} diff --git a/service/src/main/java/com/wansensoft/service/account/AccountService.java b/service/src/main/java/com/wansensoft/service/account/AccountService.java new file mode 100644 index 00000000..505a31fc --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/account/AccountService.java @@ -0,0 +1,61 @@ +package com.wansensoft.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.account.Account; +import com.wansensoft.vo.AccountVo4InOutList; +import com.wansensoft.vo.AccountVo4List; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface AccountService extends IService { + + Account getAccount(long id); + + List getAccount(); + + List getAccountByParam(String name, String serialNo); + + List select(String name, String serialNo, String remark, int offset, int rows); + + Long countAccount(String name, String serialNo, String remark); + + int insertAccount(JSONObject obj, HttpServletRequest request); + + int updateAccount(JSONObject obj, HttpServletRequest request); + + int deleteAccount(Long id, HttpServletRequest request); + + int batchDeleteAccount(String ids, HttpServletRequest request); + + int batchDeleteAccountByIds(String ids); + + int checkIsNameExist(Long id, String name); + + List findBySelect(); + + BigDecimal getAccountSum(Long id, String timeStr, String type, Boolean forceFlag); + + BigDecimal getAccountSumByHead(Long id, String timeStr, String type, Boolean forceFlag); + + BigDecimal getAccountSumByDetail(Long id, String timeStr, String type, Boolean forceFlag); + + BigDecimal getManyAccountSum(Long id, String timeStr, String type, Boolean forceFlag); + + List findAccountInOutList(Long accountId, Integer offset, Integer rows); + + int findAccountInOutListCount(Long accountId); + + int updateIsDefault(Long accountId); + + Map getAccountMap(); + + String getAccountStrByIdAndMoney(Map accountMap, String accountIdList, String accountMoneyList); + + Map getStatistics(String name, String serialNo); + + int batchSetStatus(Boolean status, String ids); +} diff --git a/service/src/main/java/com/wansensoft/service/account/AccountServiceImpl.java b/service/src/main/java/com/wansensoft/service/account/AccountServiceImpl.java new file mode 100644 index 00000000..ad6a8269 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/account/AccountServiceImpl.java @@ -0,0 +1,629 @@ +package com.wansensoft.service.account; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.*; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.depot.DepotHeadExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.account.*; +import com.wansensoft.mappers.depot.DepotHeadMapper; +import com.wansensoft.mappers.depot.DepotHeadMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.vo.AccountVo4InOutList; +import com.wansensoft.vo.AccountVo4List; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.*; + +@Service +public class AccountServiceImpl extends ServiceImpl implements AccountService { + private Logger logger = LoggerFactory.getLogger(AccountServiceImpl.class); + + private final AccountMapper accountMapper; + private final AccountMapperEx accountMapperEx; + private final DepotHeadMapper depotHeadMapper; + private final DepotHeadMapperEx depotHeadMapperEx; + private final AccountHeadMapper accountHeadMapper; + private final AccountHeadMapperEx accountHeadMapperEx; + private final AccountItemMapper accountItemMapper; + private final AccountItemMapperEx accountItemMapperEx; + private final LogService logService; + private final CommonService commonService; + private final SystemConfigService systemConfigService; + + public AccountServiceImpl(AccountMapper accountMapper, AccountMapperEx accountMapperEx, DepotHeadMapper depotHeadMapper, DepotHeadMapperEx depotHeadMapperEx, AccountHeadMapper accountHeadMapper, AccountHeadMapperEx accountHeadMapperEx, AccountItemMapper accountItemMapper, AccountItemMapperEx accountItemMapperEx, LogService logService, CommonService commonService, SystemConfigService systemConfigService) { + this.accountMapper = accountMapper; + this.accountMapperEx = accountMapperEx; + this.depotHeadMapper = depotHeadMapper; + this.depotHeadMapperEx = depotHeadMapperEx; + this.accountHeadMapper = accountHeadMapper; + this.accountHeadMapperEx = accountHeadMapperEx; + this.accountItemMapper = accountItemMapper; + this.accountItemMapperEx = accountItemMapperEx; + this.logService = logService; + this.commonService = commonService; + this.systemConfigService = systemConfigService; + } + + public Account getAccount(long id) { + return accountMapper.selectByPrimaryKey(id); + } + + public List getAccountListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + AccountExample example = new AccountExample(); + example.createCriteria().andIdIn(idList); + list = accountMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getAccount() { + List list=null; + try{ + AccountExample example = new AccountExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + list=accountMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getAccountByParam(String name, String serialNo) { + List list=null; + try{ + list=accountMapperEx.getAccountByParam(name, serialNo); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, String serialNo, String remark, int offset, int rows) { + List resList = new ArrayList<>(); + List list=null; + try{ + list = accountMapperEx.selectByConditionAccount(name, serialNo, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + String timeStr = Tools.getCurrentMonth(); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + if (null != list) { + for (AccountVo4List al : list) { + DecimalFormat df = new DecimalFormat(".##"); + BigDecimal thisMonthAmount = getAccountSum(al.getId(), timeStr, "month", forceFlag).add(getAccountSumByHead(al.getId(), timeStr, "month", forceFlag)) + .add(getAccountSumByDetail(al.getId(), timeStr, "month", forceFlag)).add(getManyAccountSum(al.getId(), timeStr, "month", forceFlag)); + String thisMonthAmountFmt = "0"; + if ((thisMonthAmount.compareTo(BigDecimal.ZERO))!=0) { + thisMonthAmountFmt = df.format(thisMonthAmount); + } + al.setThisMonthAmount(thisMonthAmountFmt); //本月发生额 + BigDecimal currentAmount = getAccountSum(al.getId(), "", "month", forceFlag).add(getAccountSumByHead(al.getId(), "", "month", forceFlag)) + .add(getAccountSumByDetail(al.getId(), "", "month", forceFlag)).add(getManyAccountSum(al.getId(), "", "month", forceFlag)) .add(al.getInitialAmount()) ; + al.setCurrentAmount(currentAmount); + resList.add(al); + } + } + return resList; + } + + public Long countAccount(String name, String serialNo, String remark) { + Long result=null; + try{ + result=accountMapperEx.countsByAccount(name, serialNo, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccount(JSONObject obj, HttpServletRequest request) { + Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); + if(account.getInitialAmount() == null) { + account.setInitialAmount(BigDecimal.ZERO); + } + List accountList = getAccountByParam(null, null); + if(accountList.isEmpty()) { + account.setIsDefault(true); + } else { + account.setIsDefault(false); + } + account.setEnabled(true); + int result=0; + try{ + result = accountMapper.insertSelective(account); + logService.insertLog("账户", + BusinessConstants.LOG_OPERATION_TYPE_ADD + account.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccount(JSONObject obj, HttpServletRequest request) { + Account account = JSONObject.parseObject(obj.toJSONString(), Account.class); + int result=0; + try{ + result = accountMapper.updateByPrimaryKeySelective(account); + logService.insertLog("账户", + new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(account.getName()).toString(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccount(Long id, HttpServletRequest request) { + return batchDeleteAccountByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccount(String ids, HttpServletRequest request) { + return batchDeleteAccountByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountByIds(String ids) { + int result=0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList=null; + try{ + accountHeadList = accountHeadMapperEx.getAccountHeadListByAccountIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(accountHeadList!=null&& !accountHeadList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验财务子表 jsh_accountitem + List accountItemList=null; + try{ + accountItemList = accountItemMapperEx.getAccountItemListByAccountIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(accountItemList!=null&& !accountItemList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList =null; + try{ + depotHeadList = depotHeadMapperEx.getDepotHeadListByAccountIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(depotHeadList!=null&& !depotHeadList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,AccountIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getAccountListByIds(ids); + for(Account account: list){ + sb.append("[").append(account.getName()).append("]"); + } + logService.insertLog("账户", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = commonService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = accountMapperEx.batchDeleteAccountByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + AccountExample example = new AccountExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list = accountMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List findBySelect() { + AccountExample example = new AccountExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = accountMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + /** + * 单个账户的金额求和-入库和出库 + * + * @param id + * @return + */ + public BigDecimal getAccountSum(Long id, String timeStr, String type, Boolean forceFlag) { + BigDecimal accountSum = BigDecimal.ZERO; + try { + DepotHeadExample example = new DepotHeadExample(); + DepotHeadExample.Criteria criteria = example.createCriteria(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + criteria.andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + criteria.andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andOperTimeLessThanOrEqualTo(mTime).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + criteria.andAccountIdEqualTo(id).andPayTypeNotEqualTo("预付款") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + if(forceFlag) { + criteria.andStatusEqualTo("1"); + } + dataList = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (dataList != null) { + for (DepotHead depotHead : dataList) { + if(depotHead.getChangeAmount()!=null) { + accountSum = accountSum .add(depotHead.getChangeAmount()) ; + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-收入、支出、转账的单据表头的合计 + * + * @param id + * @return + */ + public BigDecimal getAccountSumByHead(Long id, String timeStr, String type, Boolean forceFlag) { + BigDecimal accountSum = BigDecimal.ZERO; + try { + AccountHeadExample example = new AccountHeadExample(); + AccountHeadExample.Criteria criteria = example.createCriteria(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + criteria.andAccountIdEqualTo(id) + .andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + criteria.andAccountIdEqualTo(id) + .andBillTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + criteria.andAccountIdEqualTo(id) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + if(forceFlag) { + criteria.andStatusEqualTo("1"); + } + dataList = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (dataList != null) { + for (AccountHead accountHead : dataList) { + if(accountHead.getChangeAmount()!=null) { + accountSum = accountSum.add(accountHead.getChangeAmount()); + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-收款、付款、转账、收预付款的单据明细的合计 + * + * @param id + * @return + */ + public BigDecimal getAccountSumByDetail(Long id, String timeStr, String type, Boolean forceFlag) { + BigDecimal accountSum =BigDecimal.ZERO ; + try { + AccountHeadExample example = new AccountHeadExample(); + AccountHeadExample.Criteria criteria = example.createCriteria(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + criteria.andBillTimeGreaterThanOrEqualTo(bTime).andBillTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + criteria.andBillTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } + List dataList=null; + try{ + if(forceFlag) { + criteria.andStatusEqualTo("1"); + } + dataList = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (dataList != null) { + String ids = ""; + for (AccountHead accountHead : dataList) { + ids = ids + accountHead.getId() + ","; + } + if (!ids.equals("")) { + ids = ids.substring(0, ids.length() - 1); + } + AccountItemExample exampleAi = new AccountItemExample(); + if (!ids.equals("")) { + List idList = StringUtil.strToLongList(ids); + exampleAi.createCriteria().andAccountIdEqualTo(id).andHeaderIdIn(idList) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List dataListOne = accountItemMapper.selectByExample(exampleAi); + if (dataListOne != null) { + for (AccountItem accountItem : dataListOne) { + if(accountItem.getEachAmount()!=null) { + accountSum = accountSum.add(accountItem.getEachAmount()); + } + } + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找进销存信息异常", e); + } catch (Exception e) { + logger.error(">>>>>>>>>异常信息:", e); + } + return accountSum; + } + + /** + * 单个账户的金额求和-多账户的明细合计 + * + * @param id + * @return + */ + public BigDecimal getManyAccountSum(Long id, String timeStr, String type, Boolean forceFlag) { + BigDecimal accountSum = BigDecimal.ZERO; + try { + DepotHeadExample example = new DepotHeadExample(); + DepotHeadExample.Criteria criteria = example.createCriteria(); + if (!timeStr.equals("")) { + Date bTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + Date eTime = StringUtil.getDateByString(Tools.lastDayOfMonth(timeStr) + BusinessConstants.DAY_LAST_TIME, null); + Date mTime = StringUtil.getDateByString(Tools.firstDayOfMonth(timeStr) + BusinessConstants.DAY_FIRST_TIME, null); + if (type.equals("month")) { + criteria.andAccountIdListLike("%" +id.toString() + "%") + .andOperTimeGreaterThanOrEqualTo(bTime).andOperTimeLessThanOrEqualTo(eTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("date")) { + criteria.andAccountIdListLike("%" +id.toString() + "%") + .andOperTimeLessThanOrEqualTo(mTime) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + } else { + example.createCriteria().andAccountIdListLike("%" +id.toString() + "%") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List dataList=null; + try{ + if(forceFlag) { + criteria.andStatusEqualTo("1"); + } + dataList = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (dataList != null) { + for (DepotHead depotHead : dataList) { + String accountIdList = depotHead.getAccountIdList(); + String accountMoneyList = depotHead.getAccountMoneyList(); + if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) { + accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", ""); + accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", ""); + String[] aList = accountIdList.split(","); + String[] amList = accountMoneyList.split(","); + for (int i = 0; i < aList.length; i++) { + if (aList[i].toString().equals(id.toString())) { + if(amList!=null && amList.length>0) { + accountSum = accountSum.add(new BigDecimal(amList[i])); + } + } + } + } + } + } + } catch (DataAccessException e) { + logger.error(">>>>>>>>>查找信息异常", e); + } + return accountSum; + } + + public List findAccountInOutList(Long accountId, Integer offset, Integer rows) { + List list=null; + try{ + list = accountMapperEx.findAccountInOutList(accountId, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findAccountInOutListCount(Long accountId) { + int result=0; + try{ + result = accountMapperEx.findAccountInOutListCount(accountId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateIsDefault(Long accountId) { + int result=0; + try{ + //全部取消默认 + Account allAccount = new Account(); + allAccount.setIsDefault(false); + AccountExample allExample = new AccountExample(); + allExample.createCriteria(); + accountMapper.updateByExampleSelective(allAccount, allExample); + //给指定账户设为默认 + Account account = new Account(); + account.setIsDefault(true); + AccountExample example = new AccountExample(); + example.createCriteria().andIdEqualTo(accountId); + accountMapper.updateByExampleSelective(account, example); + logService.insertLog("账户",BusinessConstants.LOG_OPERATION_TYPE_EDIT+accountId, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + result = 1; + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public Map getAccountMap() { + List accountList = getAccount(); + Map accountMap = new HashMap<>(); + for(Account account : accountList){ + accountMap.put(account.getId(), account.getName()); + } + return accountMap; + } + + public String getAccountStrByIdAndMoney(Map accountMap, String accountIdList, String accountMoneyList) { + StringBuffer sb = new StringBuffer(); + List idList = StringUtil.strToLongList(accountIdList); + List moneyList = StringUtil.strToBigDecimalList(accountMoneyList); + for (int i = 0; i < idList.size(); i++) { + Long id = idList.get(i); + BigDecimal money = moneyList.get(i).abs(); + sb.append(accountMap.get(id) + "(" + money + "元) "); + } + return sb.toString(); + } + + public Map getStatistics(String name, String serialNo) { + Map map = new HashMap<>(); + try { + List list = getAccountByParam(name, serialNo); + String timeStr = Tools.getCurrentMonth(); + BigDecimal allMonthAmount = BigDecimal.ZERO; + BigDecimal allCurrentAmount = BigDecimal.ZERO; + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + if (null != list) { + for (Account a : list) { + BigDecimal monthAmount = getAccountSum(a.getId(), timeStr, "month", forceFlag).add(getAccountSumByHead(a.getId(), timeStr, "month", forceFlag)) + .add(getAccountSumByDetail(a.getId(), timeStr, "month", forceFlag)).add(getManyAccountSum(a.getId(), timeStr, "month", forceFlag)); + BigDecimal currentAmount = getAccountSum(a.getId(), "", "month", forceFlag).add(getAccountSumByHead(a.getId(), "", "month", forceFlag)) + .add(getAccountSumByDetail(a.getId(), "", "month", forceFlag)).add(getManyAccountSum(a.getId(), "", "month", forceFlag)).add(a.getInitialAmount()); + allMonthAmount = allMonthAmount.add(monthAmount); + allCurrentAmount = allCurrentAmount.add(currentAmount); + } + } + map.put("allCurrentAmount", priceFormat(allCurrentAmount)); //当前总金额 + map.put("allMonthAmount", priceFormat(allMonthAmount)); //本月发生额 + } catch (Exception e) { + JshException.readFail(logger, e); + } + return map; + } + + /** + * 价格格式化 + * @param price + * @return + */ + private String priceFormat(BigDecimal price) { + String priceFmt = "0"; + DecimalFormat df = new DecimalFormat(".##"); + if ((price.compareTo(BigDecimal.ZERO))!=0) { + priceFmt = df.format(price); + } + return priceFmt; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("账户", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List accountIds = StringUtil.strToLongList(ids); + Account account = new Account(); + account.setEnabled(status); + AccountExample example = new AccountExample(); + example.createCriteria().andIdIn(accountIds); + int result=0; + try{ + result = accountMapper.updateByExampleSelective(account, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadComponent.java b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadComponent.java new file mode 100644 index 00000000..eb253f50 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadComponent.java @@ -0,0 +1,96 @@ +package com.wansensoft.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@AccountHeadResource +public class AccountHeadComponent implements ICommonQuery { + + private final AccountHeadService accountHeadService; + + public AccountHeadComponent(AccountHeadService accountHeadService) { + this.accountHeadService = accountHeadService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return accountHeadService.getAccountHead(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountHeadList(map); + } + + private List getAccountHeadList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String roleType = StringUtil.getInfo(search, "roleType"); + String billNo = StringUtil.getInfo(search, "billNo"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId")); + Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); + String status = StringUtil.getInfo(search, "status"); + String remark = StringUtil.getInfo(search, "remark"); + String number = StringUtil.getInfo(search, "number"); + return accountHeadService.select(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, + accountId, status, remark, number, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String roleType = StringUtil.getInfo(search, "roleType"); + String billNo = StringUtil.getInfo(search, "billNo"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long handsPersonId = StringUtil.parseStrLong(StringUtil.getInfo(search, "handsPersonId")); + Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); + String status = StringUtil.getInfo(search, "status"); + String remark = StringUtil.getInfo(search, "remark"); + String number = StringUtil.getInfo(search, "number"); + return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime, organId, creator, handsPersonId, + accountId, status, remark, number); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountHeadService.insertAccountHead(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountHeadService.updateAccountHead(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountHeadService.deleteAccountHead(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountHeadService.batchDeleteAccountHead(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadResource.java b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadResource.java new file mode 100644 index 00000000..bcb08aec --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.accountHead; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "accountHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountHeadResource { +} diff --git a/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadService.java b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadService.java new file mode 100644 index 00000000..0dd0e0fc --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadService.java @@ -0,0 +1,51 @@ +package com.wansensoft.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.account.AccountHeadVo4ListEx; +import com.wansensoft.entities.account.AccountItem; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface AccountHeadService extends IService { + + AccountHead getAccountHead(long id); + + List getAccountHeadListByIds(String ids); + + List getAccountHead(); + + List select(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId, Long accountId, String status, + String remark, String number, int offset, int rows); + + Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId, Long accountId, String status, + String remark, String number); + + int insertAccountHead(JSONObject obj, HttpServletRequest request); + + int updateAccountHead(JSONObject obj, HttpServletRequest request); + + int deleteAccountHead(Long id, HttpServletRequest request); + + int batchDeleteAccountHead(String ids, HttpServletRequest request); + + int batchDeleteAccountHeadByIds(String ids); + + int checkIsBillNoExist(Long id, String billNo); + + int batchSetStatus(String status, String accountHeadIds); + + void addAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request); + + void updateAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request); + + List getDetailByNumber(String billNo); + + List getFinancialBillNoByBillIdList(List idList); + + List getFinancialBillNoByBillId(Long billId); +} diff --git a/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadServiceImpl.java b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadServiceImpl.java new file mode 100644 index 00000000..1d50a509 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountHead/AccountHeadServiceImpl.java @@ -0,0 +1,404 @@ +package com.wansensoft.service.accountHead; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.account.AccountHeadExample; +import com.wansensoft.entities.account.AccountHeadVo4ListEx; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.account.AccountHeadMapper; +import com.wansensoft.mappers.account.AccountHeadMapperEx; +import com.wansensoft.mappers.account.AccountItemMapperEx; +import com.wansensoft.service.accountItem.AccountItemService; +import com.wansensoft.service.accountItem.AccountItemServiceImpl; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.service.orgaUserRel.OrgaUserRelServiceImpl; +import com.wansensoft.service.supplier.SupplierService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.service.supplier.SupplierServiceImpl; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class AccountHeadServiceImpl extends ServiceImpl implements AccountHeadService{ + private Logger logger = LoggerFactory.getLogger(AccountHeadServiceImpl.class); + private final AccountHeadMapper accountHeadMapper; + private final AccountHeadMapperEx accountHeadMapperEx; + private final OrgaUserRelService orgaUserRelService; + private final AccountItemService accountItemService; + private final UserService userService; + private final SupplierService supplierService; + private final LogService logService; + private final AccountItemMapperEx accountItemMapperEx; + + public AccountHeadServiceImpl(AccountHeadMapper accountHeadMapper, AccountHeadMapperEx accountHeadMapperEx, OrgaUserRelService orgaUserRelService, AccountItemService accountItemService, UserService userService, SupplierService supplierService, LogService logService, AccountItemMapperEx accountItemMapperEx) { + this.accountHeadMapper = accountHeadMapper; + this.accountHeadMapperEx = accountHeadMapperEx; + this.orgaUserRelService = orgaUserRelService; + this.accountItemService = accountItemService; + this.userService = userService; + this.supplierService = supplierService; + this.logService = logService; + this.accountItemMapperEx = accountItemMapperEx; + } + + public AccountHead getAccountHead(long id) { + AccountHead result=null; + try{ + result=accountHeadMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getAccountHeadListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdIn(idList); + list = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getAccountHead() { + AccountHeadExample example = new AccountHeadExample(); + List list=null; + try{ + list=accountHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId, Long accountId, String status, + String remark, String number, int offset, int rows) { + List resList = new ArrayList<>(); + try{ + String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, + beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number, offset, rows); + if (null != list) { + for (AccountHeadVo4ListEx ah : list) { + if(ah.getChangeAmount() != null) { + if(BusinessConstants.TYPE_MONEY_IN.equals(ah.getType())) { + ah.setChangeAmount(ah.getChangeAmount()); + } else if(BusinessConstants.TYPE_MONEY_OUT.equals(ah.getType())) { + ah.setChangeAmount(BigDecimal.ZERO.subtract(ah.getChangeAmount())); + } else { + ah.setChangeAmount(ah.getChangeAmount().abs()); + } + } + if(ah.getTotalPrice() != null) { + if(BusinessConstants.TYPE_MONEY_IN.equals(ah.getType())) { + ah.setTotalPrice(ah.getTotalPrice()); + } else if(BusinessConstants.TYPE_MONEY_OUT.equals(ah.getType())) { + ah.setTotalPrice(BigDecimal.ZERO.subtract(ah.getTotalPrice())); + } else { + ah.setTotalPrice(ah.getTotalPrice().abs()); + } + } + if(ah.getBillTime() !=null) { + ah.setBillTimeStr(Tools.getCenternTime(ah.getBillTime())); + } + resList.add(ah); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime, + Long organId, Long creator, Long handsPersonId, Long accountId, String status, + String remark, String number) { + Long result=null; + try{ + String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, + beginTime, endTime, organId, creator, handsPersonId, accountId, status, remark, number); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + /** + * 根据角色类型获取操作员数组 + * @param roleType + * @return + * @throws Exception + */ + private String[] getCreatorArray(String roleType) { + String creator = ""; + User user = userService.getCurrentUser(); + //再从后端获取一次角色类型,防止前端关闭了缓存功能 + if(StringUtil.isEmpty(roleType)) { + roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型 + } + if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { + creator = user.getId().toString(); + } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { + creator = orgaUserRelService.getUserIdListByUserId(user.getId()); + } + String [] creatorArray=null; + if(StringUtil.isNotEmpty(creator)){ + creatorArray = creator.split(","); + } + return creatorArray; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountHead(JSONObject obj, HttpServletRequest request) { + AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); + int result=0; + try{ + User userInfo= userService.getCurrentUser(); + accountHead.setCreator(userInfo==null?null:userInfo.getId()); + result = accountHeadMapper.insertSelective(accountHead); + logService.insertLog("财务", + BusinessConstants.LOG_OPERATION_TYPE_ADD + accountHead.getBillNo(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountHead(JSONObject obj, HttpServletRequest request) { + AccountHead accountHead = JSONObject.parseObject(obj.toJSONString(), AccountHead.class); + int result=0; + try{ + result = accountHeadMapper.updateByPrimaryKeySelective(accountHead); + logService.insertLog("财务", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + accountHead.getBillNo(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountHead(Long id, HttpServletRequest request) { + return batchDeleteAccountHeadByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHead(String ids, HttpServletRequest request) { + return batchDeleteAccountHeadByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountHeadByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getAccountHeadListByIds(ids); + for(AccountHead accountHead: list){ + sb.append("[").append(accountHead.getBillNo()).append("]"); + if("1".equals(accountHead.getStatus())) { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); + } + if("收预付款".equals(accountHead.getType())){ + if (accountHead.getOrganId() != null) { + //删除时需要从会员扣除预付款 + supplierService.updateAdvanceIn(accountHead.getOrganId(), BigDecimal.ZERO.subtract(accountHead.getTotalPrice())); + } + } + } + User userInfo= userService.getCurrentUser(); + String [] idArray=ids.split(","); + //删除主表 + accountItemMapperEx.batchDeleteAccountItemByHeadIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + //删除子表 + accountHeadMapperEx.batchDeleteAccountHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + logService.insertLog("财务", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; + } + + /** + * 校验单据编号是否存在 + * @param id + * @param billNo + * @return + * @throws Exception + */ + public int checkIsBillNoExist(Long id, String billNo) { + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdNotEqualTo(id).andBillNoEqualTo(billNo).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list = accountHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(String status, String accountHeadIds) { + int result = 0; + try{ + List ahIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(accountHeadIds); + for(Long id: ids) { + AccountHead accountHead = getAccountHead(id); + if("0".equals(status)){ + if("1".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } else if("1".equals(status)){ + if("0".equals(accountHead.getStatus())) { + ahIds.add(id); + } + } + } + if(!ahIds.isEmpty()) { + AccountHead accountHead = new AccountHead(); + accountHead.setStatus(status); + AccountHeadExample example = new AccountHeadExample(); + example.createCriteria().andIdIn(ahIds); + result = accountHeadMapper.updateByExampleSelective(accountHead, example); + } else { + return 1; + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) { + AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); + //校验单号是否重复 + if(checkIsBillNoExist(0L, accountHead.getBillNo())>0) { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_BILL_NO_EXIST_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_BILL_NO_EXIST_MSG)); + } + User userInfo= userService.getCurrentUser(); + accountHead.setCreator(userInfo==null?null:userInfo.getId()); + if(StringUtil.isEmpty(accountHead.getStatus())) { + accountHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + } + accountHeadMapper.insertSelective(accountHead); + //根据单据编号查询单据id + AccountHeadExample dhExample = new AccountHeadExample(); + dhExample.createCriteria().andBillNoEqualTo(accountHead.getBillNo()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = accountHeadMapper.selectByExample(dhExample); + if(list!=null) { + Long headId = list.get(0).getId(); + String type = list.get(0).getType(); + /**处理单据子表信息*/ + accountItemService.saveDetials(rows, headId, type, request); + } + if("收预付款".equals(accountHead.getType())){ + supplierService.updateAdvanceIn(accountHead.getOrganId(), accountHead.getTotalPrice()); + } + logService.insertLog("财务单据", + BusinessConstants.LOG_OPERATION_TYPE_ADD + accountHead.getBillNo(), request); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateAccountHeadAndDetail(String beanJson, String rows, HttpServletRequest request) { + AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); + //校验单号是否重复 + if(checkIsBillNoExist(accountHead.getId(), accountHead.getBillNo())>0) { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_BILL_NO_EXIST_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_BILL_NO_EXIST_MSG)); + } + //获取之前的金额数据 + BigDecimal preTotalPrice = getAccountHead(accountHead.getId()).getTotalPrice().abs(); + accountHeadMapper.updateByPrimaryKeySelective(accountHead); + //根据单据编号查询单据id + AccountHeadExample dhExample = new AccountHeadExample(); + dhExample.createCriteria().andBillNoEqualTo(accountHead.getBillNo()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = accountHeadMapper.selectByExample(dhExample); + if(list!=null) { + Long headId = list.get(0).getId(); + String type = list.get(0).getType(); + /**处理单据子表信息*/ + accountItemService.saveDetials(rows, headId, type, request); + } + if("收预付款".equals(accountHead.getType())){ + supplierService.updateAdvanceIn(accountHead.getOrganId(), accountHead.getTotalPrice().subtract(preTotalPrice)); + } + logService.insertLog("财务单据", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + accountHead.getBillNo(), request); + } + + public List getDetailByNumber(String billNo) { + List resList = new ArrayList(); + List list = null; + try{ + list = accountHeadMapperEx.getDetailByNumber(billNo); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (null != list) { + for (AccountHeadVo4ListEx ah : list) { + if(ah.getChangeAmount() != null) { + if(BusinessConstants.TYPE_MONEY_IN.equals(ah.getType())) { + ah.setChangeAmount(ah.getChangeAmount()); + } else if(BusinessConstants.TYPE_MONEY_OUT.equals(ah.getType())) { + ah.setChangeAmount(BigDecimal.ZERO.subtract(ah.getChangeAmount())); + } else { + ah.setChangeAmount(ah.getChangeAmount().abs()); + } + } + if(ah.getTotalPrice() != null) { + if(BusinessConstants.TYPE_MONEY_IN.equals(ah.getType())) { + ah.setTotalPrice(ah.getTotalPrice()); + } else if(BusinessConstants.TYPE_MONEY_OUT.equals(ah.getType())) { + ah.setTotalPrice(BigDecimal.ZERO.subtract(ah.getTotalPrice())); + } else { + ah.setTotalPrice(ah.getTotalPrice().abs()); + } + } + if(ah.getBillTime() !=null) { + ah.setBillTimeStr(Tools.getCenternTime(ah.getBillTime())); + } + resList.add(ah); + } + } + return resList; + } + + public List getFinancialBillNoByBillIdList(List idList) { + return accountHeadMapperEx.getFinancialBillNoByBillIdList(idList); + } + + public List getFinancialBillNoByBillId(Long billId) { + return accountHeadMapperEx.getFinancialBillNoByBillId(billId); + } +} diff --git a/service/src/main/java/com/wansensoft/service/accountItem/AccountItemComponent.java b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemComponent.java new file mode 100644 index 00000000..0675737a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemComponent.java @@ -0,0 +1,77 @@ +package com.wansensoft.service.accountItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@AccountItemResource +public class AccountItemComponent implements ICommonQuery { + + private final AccountItemService accountItemService; + + public AccountItemComponent(AccountItemService accountItemService) { + this.accountItemService = accountItemService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return accountItemService.getAccountItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getAccountItemList(map); + } + + private List getAccountItemList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return accountItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return accountItemService.countAccountItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return accountItemService.insertAccountItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return accountItemService.updateAccountItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return accountItemService.deleteAccountItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return accountItemService.batchDeleteAccountItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return accountItemService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/accountItem/AccountItemResource.java b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemResource.java new file mode 100644 index 00000000..d54f12c3 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.accountItem; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "accountItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AccountItemResource { +} diff --git a/service/src/main/java/com/wansensoft/service/accountItem/AccountItemService.java b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemService.java new file mode 100644 index 00000000..9dc9120f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemService.java @@ -0,0 +1,46 @@ +package com.wansensoft.service.accountItem; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.vo.AccountItemVo4List; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; + +public interface AccountItemService extends IService { + + AccountItem getAccountItem(long id); + + List getAccountItem(); + + List getDetailList(Long headerId); + + Long countAccountItem(String name, Integer type, String remark); + + int insertAccountItem(JSONObject obj, HttpServletRequest request); + + int updateAccountItem(JSONObject obj, HttpServletRequest request); + + int deleteAccountItem(Long id, HttpServletRequest request); + + int batchDeleteAccountItem(String ids, HttpServletRequest request); + + int checkIsNameExist(Long id, String name); + + int insertAccountItemWithObj(AccountItem accountItem); + + int updateAccountItemWithObj(AccountItem accountItem); + + void saveDetials(String rows, Long headerId, String type, HttpServletRequest request); + + void deleteAccountItemHeadId(Long headerId); + + int batchDeleteAccountItemByIds(String ids); + + BigDecimal getEachAmountByBillId(Long billId); + + List select(String name, Integer type, String remark, int offset, int rows); +} diff --git a/service/src/main/java/com/wansensoft/service/accountItem/AccountItemServiceImpl.java b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemServiceImpl.java new file mode 100644 index 00000000..decd6b95 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/accountItem/AccountItemServiceImpl.java @@ -0,0 +1,265 @@ +package com.wansensoft.service.accountItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.account.AccountItemExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.account.AccountItemMapper; +import com.wansensoft.mappers.account.AccountItemMapperEx; +import com.wansensoft.service.depotHead.DepotHeadService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.AccountItemVo4List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Service +public class AccountItemServiceImpl extends ServiceImpl implements AccountItemService{ + private Logger logger = LoggerFactory.getLogger(AccountItemServiceImpl.class); + + private final AccountItemMapper accountItemMapper; + private final AccountItemMapperEx accountItemMapperEx; + private final LogService logService; + private final UserService userService; + private final DepotHeadService depotHeadService; + + public AccountItemServiceImpl(AccountItemMapper accountItemMapper, AccountItemMapperEx accountItemMapperEx, LogService logService, UserService userService, DepotHeadService depotHeadService) { + this.accountItemMapper = accountItemMapper; + this.accountItemMapperEx = accountItemMapperEx; + this.logService = logService; + this.userService = userService; + this.depotHeadService = depotHeadService; + } + + public AccountItem getAccountItem(long id) { + AccountItem result=null; + try{ + result=accountItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getAccountItem() { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=accountItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows) { + List list=null; + try{ + list = accountItemMapperEx.selectByConditionAccountItem(name, type, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countAccountItem(String name, Integer type, String remark) { + Long result=null; + try{ + result = accountItemMapperEx.countsByAccountItem(name, type, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountItem(JSONObject obj, HttpServletRequest request) { + AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class); + int result=0; + try{ + result = accountItemMapper.insertSelective(accountItem); + logService.insertLog("财务明细", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountItem(JSONObject obj, HttpServletRequest request) { + AccountItem accountItem = JSONObject.parseObject(obj.toJSONString(), AccountItem.class); + int result=0; + try{ + result = accountItemMapper.updateByPrimaryKeySelective(accountItem); + logService.insertLog("财务明细", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + accountItem.getId(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteAccountItem(Long id, HttpServletRequest request) { + int result=0; + try{ + result = accountItemMapper.deleteByPrimaryKey(id); + logService.insertLog("财务明细", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + id, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountItem(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result = accountItemMapper.deleteByExample(example); + logService.insertLog("财务明细", "批量删除,id集:" + ids, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list = accountItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertAccountItemWithObj(AccountItem accountItem) { + int result=0; + try{ + result = accountItemMapper.insertSelective(accountItem); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAccountItemWithObj(AccountItem accountItem) { + int result=0; + try{ + result = accountItemMapper.updateByPrimaryKeySelective(accountItem); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getDetailList(Long headerId) { + List list=null; + try{ + list = accountItemMapperEx.getDetailList(headerId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void saveDetials(String rows, Long headerId, String type, HttpServletRequest request) { + //删除单据的明细 + deleteAccountItemHeadId(headerId); + JSONArray rowArr = JSONArray.parseArray(rows); + if (null != rowArr && rowArr.size()>0) { + for (int i = 0; i < rowArr.size(); i++) { + AccountItem accountItem = new AccountItem(); + JSONObject tempInsertedJson = JSONObject.parseObject(rowArr.getString(i)); + accountItem.setHeaderId(headerId); + if (tempInsertedJson.get("accountId") != null && !tempInsertedJson.get("accountId").equals("")) { + accountItem.setAccountId(tempInsertedJson.getLong("accountId")); + } + if (tempInsertedJson.get("inOutItemId") != null && !tempInsertedJson.get("inOutItemId").equals("")) { + accountItem.setInOutItemId(tempInsertedJson.getLong("inOutItemId")); + } + if (tempInsertedJson.get("billNumber") != null && !tempInsertedJson.get("billNumber").equals("")) { + String billNo = tempInsertedJson.getString("billNumber"); + accountItem.setBillId(depotHeadService.getDepotHead(billNo).getId()); + } + if (tempInsertedJson.get("needDebt") != null && !tempInsertedJson.get("needDebt").equals("")) { + accountItem.setNeedDebt(tempInsertedJson.getBigDecimal("needDebt")); + } + if (tempInsertedJson.get("finishDebt") != null && !tempInsertedJson.get("finishDebt").equals("")) { + accountItem.setFinishDebt(tempInsertedJson.getBigDecimal("finishDebt")); + } + if (tempInsertedJson.get("eachAmount") != null && !tempInsertedJson.get("eachAmount").equals("")) { + BigDecimal eachAmount = tempInsertedJson.getBigDecimal("eachAmount"); + if (type.equals("付款")) { + eachAmount = BigDecimal.ZERO.subtract(eachAmount); + } + accountItem.setEachAmount(eachAmount); + } else { + accountItem.setEachAmount(BigDecimal.ZERO); + } + accountItem.setRemark(tempInsertedJson.getString("remark")); + this.insertAccountItemWithObj(accountItem); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_CODE, + String.format(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_MSG)); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteAccountItemHeadId(Long headerId) { + AccountItemExample example = new AccountItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId); + try{ + accountItemMapper.deleteByExample(example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteAccountItemByIds(String ids) { + logService.insertLog("财务明细", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = accountItemMapperEx.batchDeleteAccountItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public BigDecimal getEachAmountByBillId(Long billId) { + return accountItemMapperEx.getEachAmountByBillId(billId).abs(); + } +} diff --git a/service/src/main/java/com/wansensoft/service/common/CommonService.java b/service/src/main/java/com/wansensoft/service/common/CommonService.java deleted file mode 100644 index 5a0c9260..00000000 --- a/service/src/main/java/com/wansensoft/service/common/CommonService.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.common; - -import com.wansensoft.vo.CaptchaVO; -public interface CommonService { - CaptchaVO getCaptcha(); - - Boolean sendSmsCode(Integer type, String phoneNumber); -} diff --git a/service/src/main/java/com/wansensoft/service/common/CommonServiceImpl.java b/service/src/main/java/com/wansensoft/service/common/CommonServiceImpl.java deleted file mode 100644 index f65d78b5..00000000 --- a/service/src/main/java/com/wansensoft/service/common/CommonServiceImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.common; - -import com.google.code.kaptcha.Producer; -import com.tencentcloudapi.common.Credential; -import com.tencentcloudapi.common.profile.ClientProfile; -import com.tencentcloudapi.common.profile.HttpProfile; -import com.tencentcloudapi.sms.v20190711.SmsClient; -import com.tencentcloudapi.sms.v20190711.models.SendSmsRequest; -import com.wansensoft.utils.SnowflakeIdUtil; -import com.wansensoft.utils.constants.SecurityConstants; -import com.wansensoft.utils.constants.SmsConstants; -import com.wansensoft.utils.redis.RedisUtil; -import com.wansensoft.vo.CaptchaVO; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.util.FastByteArrayOutputStream; -import org.springframework.util.StringUtils; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.util.Base64; -import java.util.Random; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@Service -@Slf4j -public class CommonServiceImpl implements CommonService{ - - private final RedisUtil redisUtil; - - private final Producer producer; - - @Value("${sms.secretId}") - private String secretId; - - @Value("${sms.secretKey}") - private String secretKey; - - @Value("${sms.smsClint}") - private String smsClint; - - @Value("${sms.sdkAppId}") - private String sdkAppId; - - public CommonServiceImpl(RedisUtil redisUtil, Producer producer) { - this.redisUtil = redisUtil; - this.producer = producer; - } - - @Override - public CaptchaVO getCaptcha() { - String captchaId = "CAPTCHA" + SnowflakeIdUtil.nextId(); - String text = producer.createText(); - String imgEncode = ""; - BufferedImage bi = producer.createImage(text); - try (FastByteArrayOutputStream fos = new FastByteArrayOutputStream()) { - ImageIO.write(bi, "jpg", fos); - imgEncode = Base64.getEncoder().encodeToString(fos.toByteArray()); - redisUtil.set(SecurityConstants.EMAIL_VERIFY_CODE_CACHE_PREFIX + captchaId, text, 180); - fos.flush(); - } catch (Exception e) { - log.error("获取验证码失败: " + e.getMessage()); - return null; - } - return CaptchaVO.builder() - .captchaId(captchaId) - .imagePath("data:image/jpeg;base64," + imgEncode) - .build(); - } - - @Override - public Boolean sendSmsCode(Integer type, String phoneNumber) { - if(!StringUtils.hasText(phoneNumber) && type == null) { - return false; - } - var regex = "^(0|86|17951)?(13[0-9]|15[012356789]|16[6]|19[89]]|17[01345678]|18[0-9]|14[579])[0-9]{8}$"; - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(phoneNumber); - if(!matcher.matches()) { - return false; - } - var templateId = switch (type) { - case 0 -> SmsConstants.SMS_TEMPLATE_ID_REGISTER_USER; - case 1 -> SmsConstants.SMS_TEMPLATE_ID_PHONE_LOGIN; - case 2 -> SmsConstants.SMS_TEMPLATE_ID_UPDATE_PASSWORD; - default -> ""; - }; - - var key = switch (type) { - case 0 -> SecurityConstants.REGISTER_VERIFY_CODE_CACHE_PREFIX; - case 1 -> SecurityConstants.LOGIN_VERIFY_CODE_CACHE_PREFIX; - case 2 -> SecurityConstants.UPDATE_PASSWORD_VERIFY_CODE_CACHE_PREFIX; - default -> ""; - }; - - try { - Credential cred = new Credential(secretId, secretKey); - HttpProfile httpProfile = new HttpProfile(); - httpProfile.setReqMethod("POST"); - httpProfile.setConnTimeout(60); - - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setSignMethod("HmacSHA256"); - clientProfile.setHttpProfile(httpProfile); - SmsClient client = new SmsClient(cred, smsClint,clientProfile); - - SendSmsRequest req = new SendSmsRequest(); - req.setSmsSdkAppid(sdkAppId); - req.setSign(SmsConstants.SMS_SIGN_NAME); - req.setSessionContext(phoneNumber); - req.setTemplateID(templateId); - req.setPhoneNumberSet(new String[]{"86"+phoneNumber}); - - Random random = new Random(); - var code = String.valueOf(random.nextInt(900000) + 100000); - redisUtil.set(key + phoneNumber, code, 120); - req.setTemplateParamSet(new String[]{code}); - - client.SendSms(req); - - return true; - }catch (Exception e) { - log.error(String.format("用户手机号:%s, 验证码发送失败,错误消息:%s", phoneNumber, e.getMessage())); - return false; - } - } -} diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotComponent.java b/service/src/main/java/com/wansensoft/service/depot/DepotComponent.java new file mode 100644 index 00000000..d2e6c119 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depot/DepotComponent.java @@ -0,0 +1,77 @@ +package com.wansensoft.service.depot; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@DepotResource +public class DepotComponent implements ICommonQuery { + + private final DepotService depotService; + + public DepotComponent(DepotService depotService) { + this.depotService = depotService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return depotService.getDepot(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotList(map); + } + + private List getDepotList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return depotService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return depotService.countDepot(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return depotService.insertDepot(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotService.updateDepot(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotService.deleteDepot(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotService.batchDeleteDepot(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return depotService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotResource.java b/service/src/main/java/com/wansensoft/service/depot/DepotResource.java new file mode 100644 index 00000000..9d591202 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depot/DepotResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.depot; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "depot") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotResource { +} diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotService.java b/service/src/main/java/com/wansensoft/service/depot/DepotService.java new file mode 100644 index 00000000..4f2ddd7a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depot/DepotService.java @@ -0,0 +1,53 @@ +package com.wansensoft.service.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.depot.DepotEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface DepotService extends IService { + + Depot getDepot(long id); + + List getDepotListByIds(String ids); + + List getDepot(); + + List getAllList(); + + List select(String name, Integer type, String remark, int offset, int rows); + + Long countDepot(String name, Integer type, String remark); + + int insertDepot(JSONObject obj, HttpServletRequest request); + + int updateDepot(JSONObject obj, HttpServletRequest request); + + int deleteDepot(Long id, HttpServletRequest request); + + int batchDeleteDepot(String ids, HttpServletRequest request); + + int batchDeleteDepotByIds(String ids); + + int checkIsNameExist(Long id, String name); + + List findUserDepot(); + + int updateIsDefault(Long depotId); + + Long getIdByName(String name); + + List parseDepotList(Long depotId); + + JSONArray findDepotByCurrentUser(); + + String findDepotStrByCurrentUser(); + + int batchSetStatus(Boolean status, String ids); + + JSONArray findDepotByCurrentUserTest(String userId); +} diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java b/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java new file mode 100644 index 00000000..c3d24dd1 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java @@ -0,0 +1,427 @@ +package com.wansensoft.service.depot; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.depot.DepotEx; +import com.wansensoft.entities.depot.DepotExample; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.mappers.depot.DepotItemMapperEx; +import com.wansensoft.mappers.depot.DepotMapper; +import com.wansensoft.mappers.depot.DepotMapperEx; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class DepotServiceImpl extends ServiceImpl implements DepotService{ + private Logger logger = LoggerFactory.getLogger(DepotServiceImpl.class); + + private final DepotMapper depotMapper; + private final DepotMapperEx depotMapperEx; + private final UserService userService; + private final SystemConfigService systemConfigService; + private final UserBusinessService userBusinessService; + private final LogService logService; + private final DepotItemMapperEx depotItemMapperEx; + + public DepotServiceImpl(DepotMapper depotMapper, DepotMapperEx depotMapperEx, UserService userService, SystemConfigService systemConfigService, UserBusinessService userBusinessService, LogService logService, DepotItemMapperEx depotItemMapperEx) { + this.depotMapper = depotMapper; + this.depotMapperEx = depotMapperEx; + this.userService = userService; + this.systemConfigService = systemConfigService; + this.userBusinessService = userBusinessService; + this.logService = logService; + this.depotItemMapperEx = depotItemMapperEx; + } + + public Depot getDepot(long id) { + Depot result=null; + try{ + result=depotMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + DepotExample example = new DepotExample(); + example.createCriteria().andIdIn(idList); + list = depotMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getDepot() { + DepotExample example = new DepotExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=depotMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getAllList() { + DepotExample example = new DepotExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list=depotMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows) { + List list=null; + try{ + list=depotMapperEx.selectByConditionDepot(name, type, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countDepot(String name, Integer type, String remark) { + Long result=null; + try{ + result=depotMapperEx.countsByDepot(name, type, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepot(JSONObject obj, HttpServletRequest request) { + Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class); + int result=0; + try{ + depot.setType(0); + List depotList = getDepot(); + if(depotList.size() == 0) { + depot.setIsDefault(true); + } else { + depot.setIsDefault(false); + } + depot.setEnabled(true); + result=depotMapper.insertSelective(depot); + //新增仓库时给当前用户自动授权 + Long userId = userService.getUserId(request); + Long depotId = getIdByName(depot.getName()); + String ubKey = "[" + depotId + "]"; + List ubList = userBusinessService.getBasicData(userId.toString(), "UserDepot"); + if(ubList ==null || ubList.size() == 0) { + JSONObject ubObj = new JSONObject(); + ubObj.put("type", "UserDepot"); + ubObj.put("keyId", userId); + ubObj.put("value", ubKey); + userBusinessService.insertUserBusiness(ubObj, request); + } else { + UserBusiness ubInfo = ubList.get(0); + JSONObject ubObj = new JSONObject(); + ubObj.put("id", ubInfo.getId()); + ubObj.put("type", ubInfo.getType()); + ubObj.put("keyId", ubInfo.getKeyId()); + ubObj.put("value", ubInfo.getValue() + ubKey); + userBusinessService.updateUserBusiness(ubObj, request); + } + logService.insertLog("仓库", + BusinessConstants.LOG_OPERATION_TYPE_ADD + depot.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepot(JSONObject obj, HttpServletRequest request) { + Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class); + int result=0; + try{ + result= depotMapper.updateByPrimaryKeySelective(depot); + logService.insertLog("仓库", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + depot.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepot(Long id, HttpServletRequest request) { + return batchDeleteDepotByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepot(String ids, HttpServletRequest request) { + return batchDeleteDepotByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotByIds(String ids) { + int result=0; + String [] idArray=ids.split(","); + //校验单据子表 jsh_depot_item + List depotItemList=null; + try{ + depotItemList = depotItemMapperEx.getDepotItemListListByDepotIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(depotItemList!=null&&depotItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,DepotIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getDepotListByIds(ids); + for(Depot depot: list){ + sb.append("[").append(depot.getName()).append("]"); + } + logService.insertLog("仓库", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = depotMapperEx.batchDeleteDepotByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + DepotExample example = new DepotExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= depotMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List findUserDepot() { + DepotExample example = new DepotExample(); + example.createCriteria().andTypeEqualTo(0).andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list= depotMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateIsDefault(Long depotId) { + int result=0; + try{ + //全部取消默认 + Depot allDepot = new Depot(); + allDepot.setIsDefault(false); + DepotExample allExample = new DepotExample(); + allExample.createCriteria(); + depotMapper.updateByExampleSelective(allDepot, allExample); + //给指定仓库设为默认 + Depot depot = new Depot(); + depot.setIsDefault(true); + DepotExample example = new DepotExample(); + example.createCriteria().andIdEqualTo(depotId); + depotMapper.updateByExampleSelective(depot, example); + logService.insertLog("仓库",BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotId, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + result = 1; + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + /** + * 根据名称获取id + * @param name + */ + public Long getIdByName(String name) { + Long id = 0L; + DepotExample example = new DepotExample(); + example.createCriteria().andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotMapper.selectByExample(example); + if(list!=null && list.size()>0) { + id = list.get(0).getId(); + } + return id; + } + + public List parseDepotList(Long depotId) { + List depotList = new ArrayList<>(); + if(depotId !=null) { + depotList.add(depotId); + } else { + //未选择仓库时默认为当前用户有权限的仓库 + JSONArray depotArr = findDepotByCurrentUser(); + for(Object obj: depotArr) { + JSONObject object = JSONObject.parseObject(obj.toString()); + depotList.add(object.getLong("id")); + } + } + return depotList; + } + + public JSONArray findDepotByCurrentUser() { + JSONArray arr = new JSONArray(); + String type = "UserDepot"; + Long userId = userService.getCurrentUser().getId(); + List dataList = findUserDepot(); + //开始拼接json数据 + if (null != dataList) { + boolean depotFlag = systemConfigService.getDepotFlag(); + if(depotFlag) { + List list = userBusinessService.getBasicData(userId.toString(), type); + if(list!=null && !list.isEmpty()) { + String depotStr = list.get(0).getValue(); + if(StringUtil.isNotEmpty(depotStr)){ + depotStr = depotStr.replaceAll("\\[", "").replaceAll("]", ","); + String[] depotArr = depotStr.split(","); + for (Depot depot : dataList) { + for(String depotId: depotArr) { + if(depot.getId() == Long.parseLong(depotId)){ + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + } + } + } else { + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + return arr; + } + + public JSONArray findDepotByCurrentUserTest(String userId) { + JSONArray arr = new JSONArray(); + String type = "UserDepot"; + List dataList = findUserDepot(); + //开始拼接json数据 + if (null != dataList) { + boolean depotFlag = systemConfigService.getDepotFlag(); + if(depotFlag) { + List list = userBusinessService.getBasicData(userId, type); + if(list!=null && !list.isEmpty()) { + String depotStr = list.get(0).getValue(); + if(StringUtil.isNotEmpty(depotStr)){ + depotStr = depotStr.replaceAll("\\[", "").replaceAll("]", ","); + String[] depotArr = depotStr.split(","); + for (Depot depot : dataList) { + for(String depotId: depotArr) { + if(depot.getId() == Long.parseLong(depotId)){ + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + } + } + } else { + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + return arr; + } + + /** + * 当前用户有权限使用的仓库列表的id,用逗号隔开 + * @return + * @throws Exception + */ + public String findDepotStrByCurrentUser() { + JSONArray arr = findDepotByCurrentUser(); + StringBuffer sb = new StringBuffer(); + for(Object object: arr) { + JSONObject obj = (JSONObject)object; + sb.append(obj.getLong("id")).append(","); + } + String depotStr = sb.toString(); + if(StringUtil.isNotEmpty(depotStr)){ + depotStr = depotStr.substring(0, depotStr.length()-1); + } + return depotStr; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("仓库", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List depotIds = StringUtil.strToLongList(ids); + Depot depot = new Depot(); + depot.setEnabled(status); + DepotExample example = new DepotExample(); + example.createCriteria().andIdIn(depotIds); + int result=0; + try{ + result = depotMapper.updateByExampleSelective(depot, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadComponent.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadComponent.java new file mode 100644 index 00000000..fda89099 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadComponent.java @@ -0,0 +1,104 @@ +package com.wansensoft.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@DepotHeadResource +public class DepotHeadComponent implements ICommonQuery { + + private final DepotHeadService depotHeadService; + + public DepotHeadComponent(DepotHeadService depotHeadService) { + this.depotHeadService = depotHeadService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return depotHeadService.getDepotHead(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotHeadList(map); + } + + private List getDepotHeadList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); + String hasDebt = StringUtil.getInfo(search, "hasDebt"); + String status = StringUtil.getInfo(search, "status"); + String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus"); + String number = StringUtil.getInfo(search, "number"); + String linkNumber = StringUtil.getInfo(search, "linkNumber"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId")); + Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); + String remark = StringUtil.getInfo(search, "remark"); + return depotHeadService.select(type, subType, roleType, hasDebt, status, purchaseStatus, number, linkNumber, + beginTime, endTime, materialParam, organId, creator, depotId, accountId, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String type = StringUtil.getInfo(search, "type"); + String subType = StringUtil.getInfo(search, "subType"); + String roleType = StringUtil.getInfo(search, "roleType"); + String hasDebt = StringUtil.getInfo(search, "hasDebt"); + String status = StringUtil.getInfo(search, "status"); + String purchaseStatus = StringUtil.getInfo(search, "purchaseStatus"); + String number = StringUtil.getInfo(search, "number"); + String linkNumber = StringUtil.getInfo(search, "linkNumber"); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + Long organId = StringUtil.parseStrLong(StringUtil.getInfo(search, "organId")); + Long creator = StringUtil.parseStrLong(StringUtil.getInfo(search, "creator")); + Long depotId = StringUtil.parseStrLong(StringUtil.getInfo(search, "depotId")); + Long accountId = StringUtil.parseStrLong(StringUtil.getInfo(search, "accountId")); + String remark = StringUtil.getInfo(search, "remark"); + return depotHeadService.countDepotHead(type, subType, roleType, hasDebt, status, purchaseStatus, number, linkNumber, + beginTime, endTime, materialParam, organId, creator, depotId, accountId, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return depotHeadService.insertDepotHead(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotHeadService.updateDepotHead(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotHeadService.deleteDepotHead(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotHeadService.batchDeleteDepotHead(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadResource.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadResource.java new file mode 100644 index 00000000..64ea77ff --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.depotHead; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "depotHead") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotHeadResource { +} diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java new file mode 100644 index 00000000..b93c6438 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java @@ -0,0 +1,132 @@ +package com.wansensoft.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.dto.depot.RetailOutboundDto; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.vo.DepotHeadVo4InDetail; +import com.wansensoft.vo.DepotHeadVo4InOutMCount; +import com.wansensoft.vo.DepotHeadVo4List; +import com.wansensoft.vo.DepotHeadVo4StatementAccount; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface DepotHeadService extends IService { + + DepotHead getDepotHead(long id); + + List getDepotHead(); + + List select(String type, String subType, String roleType, String hasDebt, String status, String purchaseStatus, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark, int offset, int rows); + + Long countDepotHead(String type, String subType, String roleType, String hasDebt, String status, String purchaseStatus, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark); + + String[] getDepotArray(String subType); + + String[] getCreatorArray(String roleType); + + String[] getOrganArray(String subType, String purchaseStatus); + + String getCreatorByRoleType(String roleType); + + Map getFinishDepositMapByNumberList(List numberList); + + Map getBillSizeMapByLinkNumberList(List numberList); + + Map getFinancialBillNoMapByBillIdList(List idList); + + int insertDepotHead(JSONObject obj, HttpServletRequest request); + + int updateDepotHead(JSONObject obj, HttpServletRequest request); + + int deleteDepotHead(Long id, HttpServletRequest request); + + int batchDeleteDepotHead(String ids, HttpServletRequest request); + + int batchDeleteBillByIds(String ids); + + int batchDeleteDepotHeadByIds(String ids); + + List getDepotHeadListByIds(String ids); + + int checkIsBillNumberExist(Long id, String number); + + int batchSetStatus(String status, String depotHeadIDs); + + Map findMaterialsListMapByHeaderIdList(List idList); + + Map getMaterialCountListMapByHeaderIdList(List idList); + + List findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray, + String [] organArray, Boolean forceFlag, String materialParam, List depotList, Integer oId, String number, + Long creator, String remark, Integer offset, Integer rows); + + int findInOutDetailCount(String beginTime, String endTime, String type, String [] creatorArray, + String [] organArray, Boolean forceFlag, String materialParam, List depotList, Integer oId, String number, + Long creator, String remark); + + List findInOutMaterialCount(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam, + List depotList, Integer oId, String roleType, Integer offset, Integer rows); + + int findInOutMaterialCountTotal(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam, + List depotList, Integer oId, String roleType); + + List findAllocationDetail(String beginTime, String endTime, String subType, String number, + String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String remark, Integer offset, Integer rows); + + int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, + String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String remark); + + List getStatementAccount(String beginTime, String endTime, Integer organId, String [] organArray, + String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType, Integer offset, Integer rows); + + int getStatementAccountCount(String beginTime, String endTime, Integer organId, + String [] organArray, String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType); + + List getStatementAccountTotalPay(String beginTime, String endTime, Integer organId, + String [] organArray, String supplierType, + String type, String subType, String typeBack, String subTypeBack, String billType); + + List getDetailByNumber(String number, HttpServletRequest request); + + List getListByLinkNumberExceptCurrent(String linkNumber, String number, String type); + + List getBillListByLinkNumberList(List linkNumberList); + + List getBillListByLinkNumber(String linkNumber); + + List getBillListByLinkNumberExceptNumber(String linkNumber, String number); + + void addDepotHeadAndDetail(String beanJson, String rows, + HttpServletRequest request); + + void updateDepotHeadAndDetail(String beanJson, String rows,HttpServletRequest request); + + Map getBuyAndSaleStatistics(String today, String monthFirstDay, String yesterdayBegin, String yesterdayEnd, + String yearBegin, String yearEnd, String roleType, HttpServletRequest request); + + BigDecimal getBuyAndSaleBasicStatistics(String type, String subType, Integer hasSupplier, + String beginTime, String endTime, String[] creatorArray); + + BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, + String beginTime, String endTime, String[] creatorArray); + + DepotHead getDepotHead(String number); + + List debtList(Long organId, String materialParam, String number, String beginTime, String endTime, + String roleType, String status, Integer offset, Integer rows); + int debtListCount(Long organId, String materialParam, String number, String beginTime, String endTime, + String roleType, String status); + + String getBillCategory(String subType); + + List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto); +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java new file mode 100644 index 00000000..469a33bf --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java @@ -0,0 +1,1363 @@ +package com.wansensoft.service.depotHead; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.dto.depot.RetailOutboundDto; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.depot.DepotHeadExample; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.depot.DepotItemVo4MaterialAndSum; +import com.wansensoft.entities.serialNumber.SerialNumberExample; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.depot.DepotHeadMapper; +import com.wansensoft.mappers.depot.DepotHeadMapperEx; +import com.wansensoft.mappers.depot.DepotItemMapperEx; +import com.wansensoft.mappers.user.UserMapper; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.account.AccountService; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.depotItem.DepotItemService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.service.person.PersonService; +import com.wansensoft.service.role.RoleService; +import com.wansensoft.service.serialNumber.SerialNumberService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.vo.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.*; + +@Service +public class DepotHeadServiceImpl extends ServiceImpl implements DepotHeadService{ + private Logger logger = LoggerFactory.getLogger(DepotHeadServiceImpl.class); + private final DepotHeadMapper depotHeadMapper; + private final DepotHeadMapperEx depotHeadMapperEx; + private final UserService userService; + private final RoleService roleService; + private final DepotService depotService; + private final DepotItemService depotItemService; + private final CommonService commonService; + private final UserBusinessService userBusinessService; + private final SystemConfigService systemConfigService; + private final SerialNumberService serialNumberService; + private final OrgaUserRelService orgaUserRelService; + private final PersonService personService; + private final AccountService accountService; + private final DepotItemMapperEx depotItemMapperEx; + private final LogService logService; + + public DepotHeadServiceImpl(DepotHeadMapper depotHeadMapper, DepotHeadMapperEx depotHeadMapperEx, UserService userService, RoleService roleService, DepotService depotService, DepotItemService depotItemService, CommonService commonService, UserBusinessService userBusinessService, SystemConfigService systemConfigService, SerialNumberService serialNumberService, OrgaUserRelService orgaUserRelService, PersonService personService, AccountService accountService, DepotItemMapperEx depotItemMapperEx, LogService logService) { + this.depotHeadMapper = depotHeadMapper; + this.depotHeadMapperEx = depotHeadMapperEx; + this.userService = userService; + this.roleService = roleService; + this.depotService = depotService; + this.depotItemService = depotItemService; + this.commonService = commonService; + this.userBusinessService = userBusinessService; + this.systemConfigService = systemConfigService; + this.serialNumberService = serialNumberService; + this.orgaUserRelService = orgaUserRelService; + this.personService = personService; + this.accountService = accountService; + this.depotItemMapperEx = depotItemMapperEx; + this.logService = logService; + } + + public DepotHead getDepotHead(long id) { + DepotHead result=null; + try{ + result=depotHeadMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotHead() { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=depotHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String type, String subType, String roleType, String hasDebt, String status, String purchaseStatus, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark, int offset, int rows) { + List resList = new ArrayList<>(); + try{ + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + String billCategory = getBillCategory(subType); + String [] depotArray = getDepotArray(subType); + String [] creatorArray = getCreatorArray(roleType); + String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null; + String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null; + String [] organArray = getOrganArray(subType, purchaseStatus); + Map personMap = personService.getPersonMap(); + Map accountMap = accountService.getAccountMap(); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list = depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, hasDebt, statusArray, purchaseStatusArray, number, linkNumber, beginTime, endTime, + materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark, offset, rows); + if (null != list) { + List idList = new ArrayList<>(); + List numberList = new ArrayList<>(); + for (DepotHeadVo4List dh : list) { + idList.add(dh.getId()); + numberList.add(dh.getNumber()); + } + //通过批量查询去构造map + Map finishDepositMap = getFinishDepositMapByNumberList(numberList); + Map financialBillNoMap = getFinancialBillNoMapByBillIdList(idList); + Map billSizeMap = getBillSizeMapByLinkNumberList(numberList); + Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); + Map materialCountListMap = getMaterialCountListMapByHeaderIdList(idList); + for (DepotHeadVo4List dh : list) { + if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { + String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); + dh.setAccountName(accountStr); + } + if(dh.getAccountIdList() != null) { + String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountIdList(accountidlistStr); + } + if(dh.getAccountMoneyList() != null) { + String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountMoneyList(accountmoneylistStr); + } + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(roleService.parseBillPriceByLimit(dh.getChangeAmount().abs(), billCategory, priceLimit, request)); + } else { + dh.setChangeAmount(BigDecimal.ZERO); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(roleService.parseBillPriceByLimit(dh.getTotalPrice().abs(), billCategory, priceLimit, request)); + } + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + dh.setDiscountLastMoney(roleService.parseBillPriceByLimit(discountLastMoney, billCategory, priceLimit, request)); + BigDecimal backAmount = dh.getBackAmount()!=null?dh.getBackAmount():BigDecimal.ZERO; + dh.setBackAmount(roleService.parseBillPriceByLimit(backAmount, billCategory, priceLimit, request)); + if(dh.getDeposit() == null) { + dh.setDeposit(BigDecimal.ZERO); + } else { + dh.setDeposit(roleService.parseBillPriceByLimit(dh.getDeposit(), billCategory, priceLimit, request)); + } + //已经完成的欠款 + if(finishDepositMap!=null) { + BigDecimal finishDeposit = finishDepositMap.get(dh.getNumber()) != null ? finishDepositMap.get(dh.getNumber()) : BigDecimal.ZERO; + dh.setFinishDeposit(roleService.parseBillPriceByLimit(finishDeposit, billCategory, priceLimit, request)); + } + //欠款计算 + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount():BigDecimal.ZERO; + BigDecimal debt = discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount))); + dh.setDebt(roleService.parseBillPriceByLimit(debt, billCategory, priceLimit, request)); + //是否有付款单或收款单 + if(financialBillNoMap!=null) { + Integer financialBillNoSize = financialBillNoMap.get(dh.getId()); + dh.setHasFinancialFlag(financialBillNoSize!=null && financialBillNoSize>0); + } + //是否有退款单 + if(billSizeMap!=null) { + Integer billListSize = billSizeMap.get(dh.getNumber()); + dh.setHasBackFlag(billListSize!=null && billListSize>0); + } + if(StringUtil.isNotEmpty(dh.getSalesMan())) { + dh.setSalesManStr(personService.getPersonByMapAndIds(personMap,dh.getSalesMan())); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(Tools.getCenternTime(dh.getOperTime())); + } + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + //商品总数量 + if(materialCountListMap!=null) { + dh.setMaterialCount(materialCountListMap.get(dh.getId())); + } + //以销定购的情况(不能显示销售单据的金额和客户名称) + if(StringUtil.isNotEmpty(purchaseStatus)) { + dh.setOrganName("****"); + dh.setTotalPrice(null); + dh.setDiscountLastMoney(null); + } + resList.add(dh); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + public Long countDepotHead(String type, String subType, String roleType, String hasDebt, String status, String purchaseStatus, String number, String linkNumber, + String beginTime, String endTime, String materialParam, Long organId, Long creator, Long depotId, Long accountId, String remark) { + Long result=null; + try{ + String [] depotArray = getDepotArray(subType); + String [] creatorArray = getCreatorArray(roleType); + String [] statusArray = StringUtil.isNotEmpty(status) ? status.split(",") : null; + String [] purchaseStatusArray = StringUtil.isNotEmpty(purchaseStatus) ? purchaseStatus.split(",") : null; + String [] organArray = getOrganArray(subType, purchaseStatus); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, hasDebt, statusArray, purchaseStatusArray, number, linkNumber, beginTime, endTime, + materialParam, organId, organArray, creator, depotId, depotArray, accountId, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + /** + * 根据单据类型获取仓库数组 + * @param subType + * @return + * @throws Exception + */ + public String[] getDepotArray(String subType) { + String [] depotArray = null; + if(!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(subType) && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(subType)) { + String depotIds = depotService.findDepotStrByCurrentUser(); + depotArray = StringUtil.isNotEmpty(depotIds) ? depotIds.split(",") : null; + } + return depotArray; + } + + @Override + public String[] getCreatorArray(String roleType) { + String creator = getCreatorByRoleType(roleType); + String [] creatorArray=null; + if(StringUtil.isNotEmpty(creator)){ + creatorArray = creator.split(","); + } + return creatorArray; + } + + /** + * 获取机构数组 + * @return + */ + public String[] getOrganArray(String subType, String purchaseStatus) { + String [] organArray = null; + String type = "UserCustomer"; + Long userId = userService.getCurrentUser().getId(); + //获取权限信息 + String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString()); + List supplierList = commonService.findBySelectCus(); + if(BusinessConstants.SUB_TYPE_SALES_ORDER.equals(subType) || BusinessConstants.SUB_TYPE_SALES.equals(subType) + ||BusinessConstants.SUB_TYPE_SALES_RETURN.equals(subType) ) { + //采购订单里面选择销售订单的时候不要过滤 + if(StringUtil.isEmpty(purchaseStatus)) { + if (null != supplierList && !supplierList.isEmpty()) { + boolean customerFlag = systemConfigService.getCustomerFlag(); + List organList = new ArrayList<>(); + for (Supplier supplier : supplierList) { + boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]"); + if (!customerFlag || flag) { + organList.add(supplier.getId().toString()); + } + } + if(!organList.isEmpty()) { + organArray = StringUtil.listToStringArray(organList); + } + } + } + } + return organArray; + } + + @Override + public String getCreatorByRoleType(String roleType) { + String creator = ""; + User user = userService.getCurrentUser(); + //再从后端获取一次角色类型,防止前端关闭了缓存功能 + if(StringUtil.isEmpty(roleType)) { + roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型 + } + if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { + creator = user.getId().toString(); + } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { + creator = orgaUserRelService.getUserIdListByUserId(user.getId()); + } + return creator; + } + + public Map getFinishDepositMapByNumberList(List numberList) { + Map finishDepositMap = new HashMap<>(); + if(!numberList.isEmpty()) { + List list = depotHeadMapperEx.getFinishDepositByNumberList(numberList); + if(list!=null && !list.isEmpty()) { + for (FinishDepositVo finishDepositVo : list) { + if(finishDepositVo!=null) { + finishDepositMap.put(finishDepositVo.getNumber(), finishDepositVo.getFinishDeposit()); + } + } + } + } + return finishDepositMap; + } + + public Map getBillSizeMapByLinkNumberList(List numberList) { + Map billListMap = new HashMap<>(); + if(!numberList.isEmpty()) { + List list = getBillListByLinkNumberList(numberList); + if(list!=null && !list.isEmpty()) { + for (DepotHead depotHead : list) { + if(depotHead!=null) { + billListMap.put(depotHead.getLinkNumber(), list.size()); + } + } + } + } + return billListMap; + } + + public Map getFinancialBillNoMapByBillIdList(List idList) { + Map billListMap = new HashMap<>(); + if(!idList.isEmpty()) { + List list = commonService.getFinancialBillNoByBillIdList(idList); + if(list!=null && !list.isEmpty()) { + for (AccountItem accountItem : list) { + if(accountItem!=null) { + billListMap.put(accountItem.getBillId(), list.size()); + } + } + } + } + return billListMap; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepotHead(JSONObject obj, HttpServletRequest request) { + DepotHead depotHead = JSONObject.parseObject(obj.toJSONString(), DepotHead.class); + depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); + depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + int result=0; + try{ + result=depotHeadMapper.insert(depotHead); + logService.insertLog("单据", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotHead(JSONObject obj, HttpServletRequest request) { + DepotHead depotHead = JSONObject.parseObject(obj.toJSONString(), DepotHead.class); + DepotHead dh=null; + try{ + dh = depotHeadMapper.selectByPrimaryKey(depotHead.getId()); + }catch(Exception e){ + JshException.readFail(logger, e); + } + depotHead.setStatus(dh.getStatus()); + depotHead.setCreateTime(dh.getCreateTime()); + int result=0; + try{ + result = depotHeadMapper.updateByPrimaryKey(depotHead); + logService.insertLog("单据", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + depotHead.getId(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepotHead(Long id, HttpServletRequest request) { + return batchDeleteBillByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotHead(String ids, HttpServletRequest request) { + return batchDeleteBillByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteBillByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List dhList = getDepotHeadListByIds(ids); + for(DepotHead depotHead: dhList){ + sb.append("[").append(depotHead.getNumber()).append("]"); + //只有未审核的单据才能被删除 + if("0".equals(depotHead.getStatus())) { + User userInfo = userService.getCurrentUser(); + //删除入库单据,先校验序列号是否出库,如果未出库则同时删除序列号,如果已出库则不能删除单据 + if (BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType())) { + List depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(depotHead.getId(), BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED); + if (depotItemList != null && !depotItemList.isEmpty()) { + //单据明细里面存在序列号商品 + int serialNumberSellCount = depotHeadMapperEx.getSerialNumberBySell(depotHead.getNumber()); + if (serialNumberSellCount > 0) { + //已出库则不能删除单据 + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_SERIAL_IS_SELL_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_SERIAL_IS_SELL_MSG, depotHead.getNumber())); + } else { + //删除序列号 + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andInBillNoEqualTo(depotHead.getNumber()); + serialNumberService.deleteByExample(example); + } + } + } + //删除出库数据回收序列号 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && !BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + //查询单据子表列表 + List depotItemList = depotItemMapperEx.findDepotItemListBydepotheadId(depotHead.getId(), BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED); + /**回收序列号*/ + if (depotItemList != null && !depotItemList.isEmpty()) { + for (DepotItem depotItem : depotItemList) { + //BasicNumber=OperNumber*ratio + serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotHead.getNumber(), (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); + } + } + } + //对于零售出库单据,更新会员的预收款信息 + if (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) + && BusinessConstants.SUB_TYPE_RETAIL.equals(depotHead.getSubType())){ + if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())) { + if (depotHead.getOrganId() != null) { + commonService.updateAdvanceIn(depotHead.getOrganId(), depotHead.getTotalPrice().abs()); + } + } + } + List list = depotItemService.getListByHeaderId(depotHead.getId()); + //删除单据子表数据 + depotItemMapperEx.batchDeleteDepotItemByDepotHeadIds(new Long[]{depotHead.getId()}); + //删除单据主表信息 + batchDeleteDepotHeadByIds(depotHead.getId().toString()); + //将关联的单据置为审核状态-针对采购入库、销售出库和盘点复盘 + if(StringUtil.isNotEmpty(depotHead.getLinkNumber())){ + if((BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType())) + || (BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) + || (BusinessConstants.DEPOTHEAD_TYPE_OTHER.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType()))) { + String status = BusinessConstants.BILLS_STATUS_AUDIT; + //查询除当前单据之外的关联单据列表 + List exceptCurrentList = getListByLinkNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber(), depotHead.getType()); + if(exceptCurrentList!=null && !exceptCurrentList.isEmpty()) { + status = BusinessConstants.BILLS_STATUS_SKIPING; + } + DepotHead dh = new DepotHead(); + dh.setStatus(status); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(depotHead.getLinkNumber()); + depotHeadMapper.updateByExampleSelective(dh, example); + } + } + //将关联的销售订单单据置为未采购状态-针对销售订单转采购订单的情况 + if(StringUtil.isNotEmpty(depotHead.getLinkNumber())){ + if(BusinessConstants.DEPOTHEAD_TYPE_OTHER.equals(depotHead.getType()) && + BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType())) { + DepotHead dh = new DepotHead(); + //获取分批操作后单据的商品和商品数量(汇总) + List batchList = depotItemMapperEx.getBatchBillDetailMaterialSum(depotHead.getLinkNumber(), depotHead.getType()); + if(!batchList.isEmpty()) { + dh.setPurchaseStatus(BusinessConstants.PURCHASE_STATUS_SKIPING); + } else { + dh.setPurchaseStatus(BusinessConstants.PURCHASE_STATUS_UN_AUDIT); + } + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(depotHead.getLinkNumber()); + depotHeadMapper.updateByExampleSelective(dh, example); + } + } + //更新当前库存 + for (DepotItem depotItem : list) { + depotItemService.updateCurrentStock(depotItem); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG)); + } + } + logService.insertLog("单据", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + return 1; + } + + /** + * 删除单据主表信息 + * @param ids + * @return + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotHeadByIds(String ids) { + User userInfo = userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = depotHeadMapperEx.batchDeleteDepotHeadByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getDepotHeadListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdIn(idList); + list = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + /** + * 校验单据编号是否存在 + * @param id + * @param number + * @return + * @throws Exception + */ + public int checkIsBillNumberExist(Long id, String number) { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdNotEqualTo(id).andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list = depotHeadMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(String status, String depotHeadIDs) { + int result = 0; + List dhIds = new ArrayList<>(); + List ids = StringUtil.strToLongList(depotHeadIDs); + for(Long id: ids) { + DepotHead depotHead = getDepotHead(id); + if("0".equals(status)){ + if("1".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG)); + } + } else if("1".equals(status)){ + if("0".equals(depotHead.getStatus())) { + dhIds.add(id); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG)); + } + } + } + if(!dhIds.isEmpty()) { + DepotHead depotHead = new DepotHead(); + depotHead.setStatus(status); + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andIdIn(dhIds); + result = depotHeadMapper.updateByExampleSelective(depotHead, example); + //更新当前库存 + if(systemConfigService.getForceApprovalFlag()) { + for(Long dhId: dhIds) { + List list = depotItemService.getListByHeaderId(dhId); + for (DepotItem depotItem : list) { + depotItemService.updateCurrentStock(depotItem); + } + } + } + } + return result; + } + + public Map findMaterialsListMapByHeaderIdList(List idList) { + Map materialsListMap = new HashMap<>(); + if(!idList.isEmpty()) { + List list = depotHeadMapperEx.findMaterialsListMapByHeaderIdList(idList); + for (MaterialsListVo materialsListVo : list) { + String materialsList = materialsListVo.getMaterialsList(); + if(StringUtil.isNotEmpty(materialsList)) { + materialsList = materialsList.replace(",",","); + } + materialsListMap.put(materialsListVo.getHeaderId(), materialsList); + } + } + return materialsListMap; + } + + public Map getMaterialCountListMapByHeaderIdList(List idList) { + Map materialCountListMap = new HashMap<>(); + if(!idList.isEmpty()) { + List list = depotHeadMapperEx.getMaterialCountListByHeaderIdList(idList); + for(MaterialCountVo materialCountVo : list){ + materialCountListMap.put(materialCountVo.getHeaderId(), materialCountVo.getMaterialCount()); + } + } + return materialCountListMap; + } + + public List findInOutDetail(String beginTime, String endTime, String type, String [] creatorArray, + String [] organArray, Boolean forceFlag, String materialParam, List depotList, Integer oId, String number, + Long creator, String remark, Integer offset, Integer rows) { + List list = null; + try{ + list =depotHeadMapperEx.findInOutDetail(beginTime, endTime, type, creatorArray, organArray, forceFlag, + materialParam, depotList, oId, number, creator, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findInOutDetailCount(String beginTime, String endTime, String type, String [] creatorArray, + String [] organArray, Boolean forceFlag, String materialParam, List depotList, Integer oId, String number, + Long creator, String remark) { + int result = 0; + try{ + result =depotHeadMapperEx.findInOutDetailCount(beginTime, endTime, type, creatorArray, organArray, forceFlag, + materialParam, depotList, oId, number, creator, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List findInOutMaterialCount(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam, + List depotList, Integer oId, String roleType, Integer offset, Integer rows) { + List list = null; + try{ + String [] creatorArray = getCreatorArray(roleType); + String subType = "出库".equals(type)? "销售" : ""; + String [] organArray = getOrganArray(subType, ""); + list =depotHeadMapperEx.findInOutMaterialCount(beginTime, endTime, type, forceFlag, materialParam, depotList, oId, + creatorArray, organArray, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findInOutMaterialCountTotal(String beginTime, String endTime, String type, Boolean forceFlag, String materialParam, + List depotList, Integer oId, String roleType) { + int result = 0; + try{ + String [] creatorArray = getCreatorArray(roleType); + String subType = "出库".equals(type)? "销售" : ""; + String [] organArray = getOrganArray(subType, ""); + result =depotHeadMapperEx.findInOutMaterialCountTotal(beginTime, endTime, type, forceFlag, materialParam, depotList, oId, + creatorArray, organArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List findAllocationDetail(String beginTime, String endTime, String subType, String number, + String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String remark, Integer offset, Integer rows) { + List list = null; + try{ + list =depotHeadMapperEx.findAllocationDetail(beginTime, endTime, subType, number, creatorArray, forceFlag, + materialParam, depotList, depotFList, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findAllocationDetailCount(String beginTime, String endTime, String subType, String number, + String [] creatorArray, Boolean forceFlag, String materialParam, List depotList, List depotFList, + String remark) { + int result = 0; + try{ + result =depotHeadMapperEx.findAllocationDetailCount(beginTime, endTime, subType, number, creatorArray, forceFlag, + materialParam, depotList, depotFList, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getStatementAccount(String beginTime, String endTime, Integer organId, String [] organArray, + String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType, Integer offset, Integer rows) { + List list = null; + try{ + list = depotHeadMapperEx.getStatementAccount(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType, offset, rows); + } catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int getStatementAccountCount(String beginTime, String endTime, Integer organId, + String [] organArray, String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType) { + int result = 0; + try{ + result = depotHeadMapperEx.getStatementAccountCount(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType); + } catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getStatementAccountTotalPay(String beginTime, String endTime, Integer organId, + String [] organArray, String supplierType, + String type, String subType, String typeBack, String subTypeBack, String billType) { + List list = null; + try{ + list = depotHeadMapperEx.getStatementAccountTotalPay(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType); + } catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getDetailByNumber(String number, HttpServletRequest request) { + List resList = new ArrayList<>(); + try{ + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + Map personMap = personService.getPersonMap(); + Map accountMap = accountService.getAccountMap(); + List list = depotHeadMapperEx.getDetailByNumber(number); + if (null != list) { + List idList = new ArrayList<>(); + List numberList = new ArrayList<>(); + for (DepotHeadVo4List dh : list) { + idList.add(dh.getId()); + numberList.add(dh.getNumber()); + } + //通过批量查询去构造map + Map financialBillNoMap = getFinancialBillNoMapByBillIdList(idList); + Map billSizeMap = getBillSizeMapByLinkNumberList(numberList); + Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); + DepotHeadVo4List dh = list.get(0); + String billCategory = getBillCategory(dh.getSubType()); + if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { + String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); + dh.setAccountName(accountStr); + } + if(dh.getAccountIdList() != null) { + String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountIdList(accountidlistStr); + } + if(dh.getAccountMoneyList() != null) { + String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountMoneyList(accountmoneylistStr); + } + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(roleService.parseBillPriceByLimit(dh.getChangeAmount().abs(), billCategory, priceLimit, request)); + } else { + dh.setChangeAmount(BigDecimal.ZERO); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(roleService.parseBillPriceByLimit(dh.getTotalPrice().abs(), billCategory, priceLimit, request)); + } + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + dh.setDiscountLastMoney(roleService.parseBillPriceByLimit(discountLastMoney, billCategory, priceLimit, request)); + BigDecimal backAmount = dh.getBackAmount()!=null?dh.getBackAmount():BigDecimal.ZERO; + dh.setBackAmount(roleService.parseBillPriceByLimit(backAmount, billCategory, priceLimit, request)); + if(dh.getDeposit() == null) { + dh.setDeposit(BigDecimal.ZERO); + } else { + dh.setDeposit(roleService.parseBillPriceByLimit(dh.getDeposit(), billCategory, priceLimit, request)); + } + //欠款计算 + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount():BigDecimal.ZERO; + BigDecimal debt = discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount))); + dh.setDebt(roleService.parseBillPriceByLimit(debt, billCategory, priceLimit, request)); + //是否有付款单或收款单 + if(financialBillNoMap!=null) { + Integer financialBillNoSize = financialBillNoMap.get(dh.getId()); + dh.setHasFinancialFlag(financialBillNoSize!=null && financialBillNoSize>0); + } + //是否有退款单 + if(billSizeMap!=null) { + Integer billListSize = billSizeMap.get(dh.getNumber()); + dh.setHasBackFlag(billListSize!=null && billListSize>0); + } + if(StringUtil.isNotEmpty(dh.getSalesMan())) { + dh.setSalesManStr(personService.getPersonByMapAndIds(personMap,dh.getSalesMan())); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(Tools.getCenternTime(dh.getOperTime())); + } + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + dh.setCreatorName(userService.getUser(dh.getCreator()).getUsername()); + resList.add(dh); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + /** + * 查询除当前单据之外的关联单据列表 + * @param linkNumber + * @param number + * @return + * @throws Exception + */ + public List getListByLinkNumberExceptCurrent(String linkNumber, String number, String type) { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andLinkNumberEqualTo(linkNumber).andNumberNotEqualTo(number).andTypeEqualTo(type) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return depotHeadMapper.selectByExample(example); + } + + /** + * 根据原单号查询关联的单据列表(批量) + * @param linkNumberList + * @return + * @throws Exception + */ + public List getBillListByLinkNumberList(List linkNumberList) { + if(linkNumberList!=null && !linkNumberList.isEmpty()) { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andLinkNumberIn(linkNumberList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return depotHeadMapper.selectByExample(example); + } else { + return new ArrayList<>(); + } + } + + /** + * 根据原单号查询关联的单据列表 + * @param linkNumber + * @return + * @throws Exception + */ + public List getBillListByLinkNumber(String linkNumber) { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andLinkNumberEqualTo(linkNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return depotHeadMapper.selectByExample(example); + } + + /** + * 根据原单号查询关联的单据列表(排除当前的单据编号) + * @param linkNumber + * @return + * @throws Exception + */ + public List getBillListByLinkNumberExceptNumber(String linkNumber, String number) { + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andLinkNumberEqualTo(linkNumber).andNumberNotEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return depotHeadMapper.selectByExample(example); + } + + /** + * 新增单据主表及单据子表信息 + * @param beanJson + * @param rows + * @param request + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addDepotHeadAndDetail(String beanJson, String rows, + HttpServletRequest request) { + /**处理单据主表数据*/ + DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class); + //校验单号是否重复 + if(checkIsBillNumberExist(0L, depotHead.getNumber())>0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_MSG)); + } + String subType = depotHead.getSubType(); + //结算账户校验 + if("采购".equals(subType) || "采购退货".equals(subType) || "销售".equals(subType) || "销售退货".equals(subType)) { + if (StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId() == null) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG)); + } + } + //判断用户是否已经登录过,登录过不再处理 + User userInfo= userService.getCurrentUser(); + depotHead.setCreator(userInfo==null?null:userInfo.getId()); + depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); + if(StringUtil.isEmpty(depotHead.getStatus())) { + depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + } + depotHead.setPurchaseStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); + depotHead.setPayType(depotHead.getPayType()==null?"现付":depotHead.getPayType()); + if(StringUtil.isNotEmpty(depotHead.getAccountIdList())){ + depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", "")); + } + if(StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) { + //校验多账户的结算金额 + String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + BigDecimal sum = StringUtil.getArrSum(accountMoneyList.split(",")); + BigDecimal manyAccountSum = sum.abs(); + if(manyAccountSum.compareTo(depotHead.getChangeAmount().abs())!=0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG)); + } + depotHead.setAccountMoneyList(accountMoneyList); + } + //校验累计扣除订金是否超出订单中的金额 + if(depotHead.getDeposit()!=null && StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + BigDecimal finishDeposit = depotHeadMapperEx.getFinishDepositByNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber()); + //订单中的订金金额 + BigDecimal changeAmount = getDepotHead(depotHead.getLinkNumber()).getChangeAmount(); + if(changeAmount!=null) { + BigDecimal preDeposit = changeAmount.abs(); + if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG)); + } + } + } + //校验附件的数量 + if(StringUtil.isNotEmpty(depotHead.getFileName())) { + String[] fileArr = depotHead.getFileName().split(","); + if(fileArr.length>4) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4)); + } + } + try{ + depotHeadMapper.insertSelective(depotHead); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + /**入库和出库处理预付款信息*/ + if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){ + if(depotHead.getOrganId()!=null) { + BigDecimal currentAdvanceIn = commonService.getSupplier(depotHead.getOrganId()).getAdvanceIn(); + if(currentAdvanceIn.compareTo(depotHead.getTotalPrice())>=0) { + commonService.updateAdvanceIn(depotHead.getOrganId(), BigDecimal.ZERO.subtract(depotHead.getTotalPrice())); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MEMBER_PAY_LACK_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MEMBER_PAY_LACK_MSG)); + } + } + } + //根据单据编号查询单据id + DepotHeadExample dhExample = new DepotHeadExample(); + dhExample.createCriteria().andNumberEqualTo(depotHead.getNumber()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotHeadMapper.selectByExample(dhExample); + if(list!=null) { + Long headId = list.get(0).getId(); + /**入库和出库处理单据子表信息*/ + depotItemService.saveDetials(rows,headId, "add",request); + } + logService.insertLog("单据", + BusinessConstants.LOG_OPERATION_TYPE_ADD + depotHead.getNumber(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + + /** + * 更新单据主表及单据子表信息 + * @param beanJson + * @param rows + * @param request + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateDepotHeadAndDetail(String beanJson, String rows,HttpServletRequest request) { + /**更新单据主表信息*/ + DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class); + //校验单号是否重复 + if(checkIsBillNumberExist(depotHead.getId(), depotHead.getNumber())>0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BILL_NUMBER_EXIST_MSG)); + } + //校验单据状态,如何不是未审核则提示 + if(!"0".equals(getDepotHead(depotHead.getId()).getStatus())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BILL_CANNOT_EDIT_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BILL_CANNOT_EDIT_MSG)); + } + //获取之前的金额数据 + BigDecimal preTotalPrice = getDepotHead(depotHead.getId()).getTotalPrice().abs(); + String subType = depotHead.getSubType(); + //结算账户校验 + if("采购".equals(subType) || "采购退货".equals(subType) || "销售".equals(subType) || "销售退货".equals(subType)) { + if (StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId() == null) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG)); + } + } + if(StringUtil.isNotEmpty(depotHead.getAccountIdList())){ + depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", "")); + } + if(StringUtil.isNotEmpty(depotHead.getAccountMoneyList())) { + //校验多账户的结算金额 + String accountMoneyList = depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + BigDecimal sum = StringUtil.getArrSum(accountMoneyList.split(",")); + BigDecimal manyAccountSum = sum.abs(); + if(manyAccountSum.compareTo(depotHead.getChangeAmount().abs())!=0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG)); + } + depotHead.setAccountMoneyList(accountMoneyList); + } + //校验累计扣除订金是否超出订单中的金额 + if(depotHead.getDeposit()!=null && StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + BigDecimal finishDeposit = depotHeadMapperEx.getFinishDepositByNumberExceptCurrent(depotHead.getLinkNumber(), depotHead.getNumber()); + //订单中的订金金额 + BigDecimal changeAmount = getDepotHead(depotHead.getLinkNumber()).getChangeAmount(); + if(changeAmount!=null) { + BigDecimal preDeposit = changeAmount.abs(); + if(depotHead.getDeposit().add(finishDeposit).compareTo(preDeposit)>0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG)); + } + } + } + //校验附件的数量 + if(StringUtil.isNotEmpty(depotHead.getFileName())) { + String[] fileArr = depotHead.getFileName().split(","); + if(fileArr.length>4) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_FILE_NUM_LIMIT_MSG, 4)); + } + } + try{ + depotHeadMapper.updateByPrimaryKeySelective(depotHead); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + //如果存在多账户结算需要将原账户的id置空 + if(StringUtil.isNotEmpty(depotHead.getAccountIdList())) { + depotHeadMapperEx.setAccountIdToNull(depotHead.getId()); + } + /**入库和出库处理预付款信息*/ + if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPayType())){ + if(depotHead.getOrganId()!=null){ + BigDecimal currentAdvanceIn = commonService.getSupplier(depotHead.getOrganId()).getAdvanceIn(); + if(currentAdvanceIn.compareTo(depotHead.getTotalPrice())>=0) { + commonService.updateAdvanceIn(depotHead.getOrganId(), BigDecimal.ZERO.subtract(depotHead.getTotalPrice().subtract(preTotalPrice))); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_MEMBER_PAY_LACK_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_MEMBER_PAY_LACK_MSG)); + } + } + } + /**入库和出库处理单据子表信息*/ + depotItemService.saveDetials(rows,depotHead.getId(), "update",request); + logService.insertLog("单据", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + depotHead.getNumber(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + + /** + * 退货单对应的原单实际欠款(这里面要除去收付款的金额) + * @param linkNumber 原单单号 + * @param number 当前单号 + * @return + */ + public BigDecimal getOriginalRealDebt(String linkNumber, String number) throws Exception { + DepotHead depotHead = getDepotHead(linkNumber); + BigDecimal discountLastMoney = depotHead.getDiscountLastMoney()!=null?depotHead.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal otherMoney = depotHead.getOtherMoney()!=null?depotHead.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = depotHead.getDeposit()!=null?depotHead.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = depotHead.getChangeAmount()!=null?depotHead.getChangeAmount().abs():BigDecimal.ZERO; + //原单欠款 + BigDecimal debt = discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount))); + //完成欠款 + BigDecimal finishDebt = commonService.getEachAmountByBillId(depotHead.getId()); + finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO; + //原单对应的退货单欠款(总数) + List billList = getBillListByLinkNumberExceptNumber(linkNumber, number); + BigDecimal allBillDebt = BigDecimal.ZERO; + for(DepotHead dh: billList) { + BigDecimal billDiscountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal billOtherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal billDeposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal billChangeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount().abs():BigDecimal.ZERO; + BigDecimal billDebt = billDiscountLastMoney.add(billOtherMoney).subtract((billDeposit.add(billChangeAmount))); + allBillDebt = allBillDebt.add(billDebt); + } + //原单实际欠款 + return debt.subtract(finishDebt).subtract(allBillDebt); + } + + public Map getBuyAndSaleStatistics(String today, String monthFirstDay, String yesterdayBegin, String yesterdayEnd, + String yearBegin, String yearEnd, String roleType, HttpServletRequest request) { + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + String [] creatorArray = getCreatorArray(roleType); + Map map = new HashMap<>(); + //今日 + BigDecimal todayBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, today, Tools.getNow3(), creatorArray); //今日采购入库 + BigDecimal todayBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, today, Tools.getNow3(), creatorArray); //今日采购退货 + BigDecimal todaySale = getBuyAndSaleBasicStatistics("出库", "销售", + 1, today, Tools.getNow3(), creatorArray); //今日销售出库 + BigDecimal todaySaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1, today, Tools.getNow3(), creatorArray); //今日销售退货 + BigDecimal todayRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + today, Tools.getNow3(), creatorArray); //今日零售出库 + BigDecimal todayRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + today, Tools.getNow3(), creatorArray); //今日零售退货 + //本月 + BigDecimal monthBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, monthFirstDay, Tools.getNow3(), creatorArray); //本月采购入库 + BigDecimal monthBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, monthFirstDay, Tools.getNow3(), creatorArray); //本月采购退货 + BigDecimal monthSale = getBuyAndSaleBasicStatistics("出库", "销售", + 1,monthFirstDay, Tools.getNow3(), creatorArray); //本月销售出库 + BigDecimal monthSaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1,monthFirstDay, Tools.getNow3(), creatorArray); //本月销售退货 + BigDecimal monthRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + monthFirstDay, Tools.getNow3(), creatorArray); //本月零售出库 + BigDecimal monthRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + monthFirstDay, Tools.getNow3(), creatorArray); //本月零售退货 + //昨日 + BigDecimal yesterdayBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日采购入库 + BigDecimal yesterdayBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日采购退货 + BigDecimal yesterdaySale = getBuyAndSaleBasicStatistics("出库", "销售", + 1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日销售出库 + BigDecimal yesterdaySaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1, yesterdayBegin, yesterdayEnd, creatorArray); //昨日销售退货 + BigDecimal yesterdayRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + yesterdayBegin, yesterdayEnd, creatorArray); //昨日零售出库 + BigDecimal yesterdayRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + yesterdayBegin, yesterdayEnd, creatorArray); //昨日零售退货 + //今年 + BigDecimal yearBuy = getBuyAndSaleBasicStatistics("入库", "采购", + 1, yearBegin, yearEnd, creatorArray); //今年采购入库 + BigDecimal yearBuyBack = getBuyAndSaleBasicStatistics("出库", "采购退货", + 1, yearBegin, yearEnd, creatorArray); //今年采购退货 + BigDecimal yearSale = getBuyAndSaleBasicStatistics("出库", "销售", + 1, yearBegin, yearEnd, creatorArray); //今年销售出库 + BigDecimal yearSaleBack = getBuyAndSaleBasicStatistics("入库", "销售退货", + 1, yearBegin, yearEnd, creatorArray); //今年销售退货 + BigDecimal yearRetailSale = getBuyAndSaleRetailStatistics("出库", "零售", + yearBegin, yearEnd, creatorArray); //今年零售出库 + BigDecimal yearRetailSaleBack = getBuyAndSaleRetailStatistics("入库", "零售退货", + yearBegin, yearEnd, creatorArray); //今年零售退货 + map.put("todayBuy", roleService.parseHomePriceByLimit(todayBuy.subtract(todayBuyBack), "buy", priceLimit, "***", request)); + map.put("todaySale", roleService.parseHomePriceByLimit(todaySale.subtract(todaySaleBack), "sale", priceLimit, "***", request)); + map.put("todayRetailSale", roleService.parseHomePriceByLimit(todayRetailSale.subtract(todayRetailSaleBack), "retail", priceLimit, "***", request)); + map.put("monthBuy", roleService.parseHomePriceByLimit(monthBuy.subtract(monthBuyBack), "buy", priceLimit, "***", request)); + map.put("monthSale", roleService.parseHomePriceByLimit(monthSale.subtract(monthSaleBack), "sale", priceLimit, "***", request)); + map.put("monthRetailSale", roleService.parseHomePriceByLimit(monthRetailSale.subtract(monthRetailSaleBack), "retail", priceLimit, "***", request)); + map.put("yesterdayBuy", roleService.parseHomePriceByLimit(yesterdayBuy.subtract(yesterdayBuyBack), "buy", priceLimit, "***", request)); + map.put("yesterdaySale", roleService.parseHomePriceByLimit(yesterdaySale.subtract(yesterdaySaleBack), "sale", priceLimit, "***", request)); + map.put("yesterdayRetailSale", roleService.parseHomePriceByLimit(yesterdayRetailSale.subtract(yesterdayRetailSaleBack), "retail", priceLimit, "***", request)); + map.put("yearBuy", roleService.parseHomePriceByLimit(yearBuy.subtract(yearBuyBack), "buy", priceLimit, "***", request)); + map.put("yearSale", roleService.parseHomePriceByLimit(yearSale.subtract(yearSaleBack), "sale", priceLimit, "***", request)); + map.put("yearRetailSale", roleService.parseHomePriceByLimit(yearRetailSale.subtract(yearRetailSaleBack), "retail", priceLimit, "***", request)); + return map; + } + + public BigDecimal getBuyAndSaleBasicStatistics(String type, String subType, Integer hasSupplier, + String beginTime, String endTime, String[] creatorArray) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + return depotHeadMapperEx.getBuyAndSaleBasicStatistics(type, subType, hasSupplier, beginTime, endTime, creatorArray, forceFlag); + } + + public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, + String beginTime, String endTime, String[] creatorArray) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, beginTime, endTime, creatorArray, forceFlag).abs(); + } + + public DepotHead getDepotHead(String number) { + DepotHead depotHead = new DepotHead(); + try{ + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotHeadMapper.selectByExample(example); + if(null!=list && !list.isEmpty()) { + depotHead = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return depotHead; + } + + public List debtList(Long organId, String materialParam, String number, String beginTime, String endTime, + String roleType, String status, Integer offset, Integer rows) { + List resList = new ArrayList<>(); + try{ + String depotIds = depotService.findDepotStrByCurrentUser(); + String [] depotArray=depotIds.split(","); + String [] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + List list=depotHeadMapperEx.debtList(organId, creatorArray, status, number, + beginTime, endTime, materialParam, depotArray, offset, rows); + if (null != list) { + List idList = new ArrayList<>(); + for (DepotHeadVo4List dh : list) { + idList.add(dh.getId()); + } + //通过批量查询去构造map + Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); + for (DepotHeadVo4List dh : list) { + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if(dh.getDeposit() == null) { + dh.setDeposit(BigDecimal.ZERO); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(Tools.getCenternTime(dh.getOperTime())); + } + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount().abs():BigDecimal.ZERO; + //本单欠款(如果退货则为负数) + dh.setNeedDebt(discountLastMoney.add(otherMoney).subtract(deposit.add(changeAmount))); + if(BusinessConstants.SUB_TYPE_PURCHASE_RETURN.equals(dh.getSubType()) || BusinessConstants.SUB_TYPE_SALES_RETURN.equals(dh.getSubType())) { + dh.setNeedDebt(BigDecimal.ZERO.subtract(dh.getNeedDebt())); + } + BigDecimal needDebt = dh.getNeedDebt()!=null?dh.getNeedDebt():BigDecimal.ZERO; + BigDecimal finishDebt = commonService.getEachAmountByBillId(dh.getId()); + finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO; + //已收欠款 + dh.setFinishDebt(finishDebt); + //待收欠款 + dh.setDebt(needDebt.subtract(finishDebt)); + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + resList.add(dh); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + public int debtListCount(Long organId, String materialParam, String number, String beginTime, String endTime, + String roleType, String status) { + int total = 0; + try { + String depotIds = depotService.findDepotStrByCurrentUser(); + String[] depotArray = depotIds.split(","); + String[] creatorArray = getCreatorArray(roleType); + beginTime = Tools.parseDayToTime(beginTime, BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime, BusinessConstants.DAY_LAST_TIME); + total = depotHeadMapperEx.debtListCount(organId, creatorArray, status, number, + beginTime, endTime, materialParam, depotArray); + } catch(Exception e){ + JshException.readFail(logger, e); + } + return total; + } + + public String getBillCategory(String subType) { + if(subType.equals("零售") || subType.equals("零售退货")) { + return "retail"; + } else if(subType.equals("销售订单") || subType.equals("销售") || subType.equals("销售退货")) { + return "sale"; + } else { + return "buy"; + } + } + + @Override + public List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto) { + if (retailOutboundDto == null) { + return null; + } + + List resList = new ArrayList<>(); + try{ + String depotIds = String.valueOf(depotService.findDepotByCurrentUserTest(String.valueOf(retailOutboundDto.getCreator()))); + String [] depotArray=depotIds.split(","); + String [] creatorArray = getCreatorArray(retailOutboundDto.getRoleType()); + String beginTime = Tools.parseDayToTime(retailOutboundDto.getBeginTime(), BusinessConstants.DAY_FIRST_TIME); + String endTime = Tools.parseDayToTime(retailOutboundDto.getEndTime(), BusinessConstants.DAY_LAST_TIME); + List list = depotHeadMapperEx + .debtList(retailOutboundDto.getOrganId(), creatorArray, retailOutboundDto.getStatus(), retailOutboundDto.getNumber(), + beginTime, endTime, retailOutboundDto.getMaterialParam(), depotArray, retailOutboundDto.getOffset(), retailOutboundDto.getRows()); + if (null != list) { + List idList = new ArrayList<>(); + for (DepotHeadVo4List dh : list) { + idList.add(dh.getId()); + } + //通过批量查询去构造map + Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); + for (DepotHeadVo4List dh : list) { + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if(dh.getDeposit() == null) { + dh.setDeposit(BigDecimal.ZERO); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(Tools.getCenternTime(dh.getOperTime())); + } + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount().abs():BigDecimal.ZERO; + //本单欠款(如果退货则为负数) + dh.setNeedDebt(discountLastMoney.add(otherMoney).subtract(deposit.add(changeAmount))); + if(BusinessConstants.SUB_TYPE_PURCHASE_RETURN.equals(dh.getSubType()) || BusinessConstants.SUB_TYPE_SALES_RETURN.equals(dh.getSubType())) { + dh.setNeedDebt(BigDecimal.ZERO.subtract(dh.getNeedDebt())); + } + BigDecimal needDebt = dh.getNeedDebt()!=null?dh.getNeedDebt():BigDecimal.ZERO; + BigDecimal finishDebt = commonService.getEachAmountByBillId(dh.getId()); + finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO; + //已收欠款 + dh.setFinishDebt(finishDebt); + //待收欠款 + dh.setDebt(needDebt.subtract(finishDebt)); + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + resList.add(dh); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } +} diff --git a/service/src/main/java/com/wansensoft/service/depotItem/DepotItemComponent.java b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemComponent.java new file mode 100644 index 00000000..05b65abd --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemComponent.java @@ -0,0 +1,77 @@ +package com.wansensoft.service.depotItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@DepotItemResource +public class DepotItemComponent implements ICommonQuery { + + private final DepotItemService depotItemService; + + public DepotItemComponent(DepotItemService depotItemService) { + this.depotItemService = depotItemService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return depotItemService.getDepotItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getDepotItemList(map); + } + + private List getDepotItemList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return depotItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type")); + String remark = StringUtil.getInfo(search, "remark"); + return depotItemService.countDepotItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return depotItemService.insertDepotItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return depotItemService.updateDepotItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return depotItemService.deleteDepotItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return depotItemService.batchDeleteDepotItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return depotItemService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/depotItem/DepotItemResource.java b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemResource.java new file mode 100644 index 00000000..4f6e6273 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.depotItem; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "depotItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface DepotItemResource { +} diff --git a/service/src/main/java/com/wansensoft/service/depotItem/DepotItemService.java b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemService.java new file mode 100644 index 00000000..d8acee51 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemService.java @@ -0,0 +1,119 @@ +package com.wansensoft.service.depotItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.depot.DepotItemVo4DetailByTypeAndMId; +import com.wansensoft.entities.depot.DepotItemVo4WithInfoEx; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.vo.DepotItemStockWarningCount; +import com.wansensoft.vo.DepotItemVoBatchNumberList; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface DepotItemService extends IService { + + DepotItem getDepotItem(long id); + + List select(String name, Integer type, String remark, int offset, int rows); + + Long countDepotItem(String name, Integer type, String remark); + + int insertDepotItem(JSONObject obj, HttpServletRequest request); + + int updateDepotItem(JSONObject obj, HttpServletRequest request); + + int deleteDepotItem(Long id, HttpServletRequest request); + + int batchDeleteDepotItem(String ids, HttpServletRequest request); + + int checkIsNameExist(Long id, String name); + + List findDetailByDepotIdsAndMaterialIdList(String depotIds, Boolean forceFlag, String sku, String batchNumber, + String number, String beginTime, String endTime, Long mId, int offset, int rows); + + Long findDetailByDepotIdsAndMaterialIdCount(String depotIds, Boolean forceFlag, String sku, String batchNumber, + String number, String beginTime, String endTime, Long mId); + + int insertDepotItemWithObj(DepotItem depotItem); + + int updateDepotItemWithObj(DepotItem depotItem); + + List getListByHeaderId(Long headerId); + + DepotItem getItemByHeaderIdAndMaterial(Long headerId, Long meId); + + DepotItem getPreItemByHeaderIdAndMaterial(String linkNumber, Long meId, Long linkId); + + List getDetailList(Long headerId); + + List findByAll(String materialParam, List categoryIdList, String endTime, Integer offset, Integer rows); + + int findByAllCount(String materialParam, List categoryIdList, String endTime); + + List getListWithBugOrSale(String materialParam, String billType, + String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag, Integer offset, Integer rows); + + int getListWithBugOrSaleCount(String materialParam, String billType, + String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag); + + BigDecimal buyOrSale(String type, String subType, Long MId, String beginTime, String endTime, + String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag, String sumType); + + BigDecimal inOrOutPrice(String type, String subType, String month, String roleType); + + BigDecimal inOrOutRetailPrice(String type, String subType, String month, String roleType); + + void saveDetials(String rows, Long headerId, String actionType, HttpServletRequest request); + + String getBillStatusByParam(DepotHead depotHead); + + void changeBillStatus(DepotHead depotHead, String billStatus); + + void changeBillPurchaseStatus(DepotHead depotHead, String billStatus); + + DepotItem getDepotItemByBatchNumber(String batchNumber); + + void deleteDepotItemHeadId(Long headerId); + + void deleteOrCancelSerialNumber(String actionType, DepotHead depotHead, Long headerId); + + void checkAssembleWithMaterialType(JSONArray rowArr, String subType); + + void updateMaterialExtendPrice(Long meId, String subType, JSONObject rowObj); + + List findStockWarningCount(Integer offset, Integer rows, String materialParam, List depotList); + + int findStockWarningCountTotal(String materialParam, List depotList); + + BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime); + + BigDecimal getStockByParam(Long depotId, Long mId, String beginTime, String endTime); + + BigDecimal getStockByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime); + + Map getIntervalMapByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime); + + void updateCurrentStock(DepotItem depotItem); + + void updateCurrentStockFun(Long mId, Long dId); + + BigDecimal getFinishNumber(Long meId, Long id, Long headerId, Unit unitInfo, String materialUnit, String linkType); + + BigDecimal getRealFinishNumber(String currentSubType, Long meId, Long linkId, Long preHeaderId, Long currentHeaderId, Unit unitInfo, String materialUnit); + + List getBatchNumberList(String number, String name, Long depotId, String barCode, String batchNumber); + + Long getCountByMaterialAndDepot(Long mId, Long depotId); + + JSONObject parseMapByExcelData(String barCodes, List> detailList, String prefixNo); + + BigDecimal getLastUnitPriceByParam(Long organId, Long meId, String prefixNo); + + BigDecimal getCurrentStockByParam(Long depotId, Long mId); +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/depotItem/DepotItemServiceImpl.java b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemServiceImpl.java new file mode 100644 index 00000000..71730cc8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/depotItem/DepotItemServiceImpl.java @@ -0,0 +1,1271 @@ +package com.wansensoft.service.depotItem; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.depot.*; +import com.wansensoft.entities.material.*; +import com.wansensoft.entities.serialNumber.SerialNumberExample; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.depot.DepotHeadMapper; +import com.wansensoft.mappers.depot.DepotItemMapper; +import com.wansensoft.mappers.depot.DepotItemMapperEx; +import com.wansensoft.mappers.material.MaterialCurrentStockMapper; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.materialExtend.MaterialExtendService; +import com.wansensoft.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.service.serialNumber.SerialNumberService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.service.unit.UnitService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.vo.DepotItemStockWarningCount; +import com.wansensoft.vo.DepotItemVo4Stock; +import com.wansensoft.vo.DepotItemVoBatchNumberList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class DepotItemServiceImpl extends ServiceImpl implements DepotItemService{ + private Logger logger = LoggerFactory.getLogger(DepotItemServiceImpl.class); + + private final static String TYPE = "入库"; + private final static String SUM_TYPE = "number"; + private final static String IN = "in"; + private final static String OUT = "out"; + + private final DepotItemMapper depotItemMapper; + private final DepotItemMapperEx depotItemMapperEx; + private final CommonService commonService; + private final MaterialExtendService materialExtendService; + private final DepotHeadMapper depotHeadMapper; + private final SerialNumberService serialNumberService; + private final UserService userService; + private final SystemConfigService systemConfigService; + private final DepotService depotService; + private final UnitService unitService; + private final OrgaUserRelService orgaUserRelService; + private final MaterialCurrentStockMapper materialCurrentStockMapper; + + public DepotItemServiceImpl(DepotItemMapper depotItemMapper, DepotItemMapperEx depotItemMapperEx, CommonService commonService, MaterialExtendService materialExtendService, DepotHeadMapper depotHeadMapper, SerialNumberService serialNumberService, UserService userService, SystemConfigService systemConfigService, DepotService depotService, UnitService unitService, OrgaUserRelService orgaUserRelService, MaterialCurrentStockMapper materialCurrentStockMapper) { + this.depotItemMapper = depotItemMapper; + this.depotItemMapperEx = depotItemMapperEx; + this.commonService = commonService; + this.materialExtendService = materialExtendService; + this.depotHeadMapper = depotHeadMapper; + this.serialNumberService = serialNumberService; + this.userService = userService; + this.systemConfigService = systemConfigService; + this.depotService = depotService; + this.unitService = unitService; + this.orgaUserRelService = orgaUserRelService; + this.materialCurrentStockMapper = materialCurrentStockMapper; + } + + public DepotItem getDepotItem(long id) { + DepotItem result=null; + try{ + result=depotItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getDepotItem() { + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=depotItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, Integer type, String remark, int offset, int rows) { + List list=null; + try{ + list=depotItemMapperEx.selectByConditionDepotItem(name, type, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countDepotItem(String name, Integer type, String remark) { + Long result =null; + try{ + result=depotItemMapperEx.countsByDepotItem(name, type, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepotItem(JSONObject obj, HttpServletRequest request) { + DepotItem depotItem = JSONObject.parseObject(obj.toJSONString(), DepotItem.class); + int result =0; + try{ + result=depotItemMapper.insertSelective(depotItem); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotItem(JSONObject obj, HttpServletRequest request) { + DepotItem depotItem = JSONObject.parseObject(obj.toJSONString(), DepotItem.class); + int result =0; + try{ + result=depotItemMapper.updateByPrimaryKeySelective(depotItem); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteDepotItem(Long id, HttpServletRequest request) { + int result =0; + try{ + result=depotItemMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteDepotItem(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andIdIn(idList); + int result =0; + try{ + result=depotItemMapper.deleteByExample(example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=depotItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List findDetailByDepotIdsAndMaterialIdList(String depotIds, Boolean forceFlag, String sku, String batchNumber, + String number, String beginTime, String endTime, Long mId, int offset, int rows) { + Long depotId = null; + if(StringUtil.isNotEmpty(depotIds)) { + depotId = Long.parseLong(depotIds); + } + List depotList = depotService.parseDepotList(depotId); + Long[] depotIdArray = StringUtil.listToLongArray(depotList); + List list =null; + try{ + list = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdList(depotIdArray, forceFlag, sku, batchNumber, number, beginTime, endTime, mId, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long findDetailByDepotIdsAndMaterialIdCount(String depotIds, Boolean forceFlag, String sku, String batchNumber, + String number, String beginTime, String endTime, Long mId) { + Long depotId = null; + if(StringUtil.isNotEmpty(depotIds)) { + depotId = Long.parseLong(depotIds); + } + List depotList = depotService.parseDepotList(depotId); + Long[] depotIdArray = StringUtil.listToLongArray(depotList); + Long result =null; + try{ + result = depotItemMapperEx.findDetailByDepotIdsAndMaterialIdCount(depotIdArray, forceFlag, sku, batchNumber, number, beginTime, endTime, mId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertDepotItemWithObj(DepotItem depotItem) { + int result =0; + try{ + result = depotItemMapper.insertSelective(depotItem); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateDepotItemWithObj(DepotItem depotItem) { + int result =0; + try{ + result = depotItemMapper.updateByPrimaryKeySelective(depotItem); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getListByHeaderId(Long headerId) { + List list =null; + try{ + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = depotItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + /** + * 查询当前单据中指定商品的明细信息 + * @param headerId + * @param meId + * @return + * @throws Exception + */ + public DepotItem getItemByHeaderIdAndMaterial(Long headerId, Long meId) { + DepotItem depotItem = new DepotItem(); + try{ + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId).andMaterialExtendIdEqualTo(meId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotItemMapper.selectByExample(example); + if(list!=null && list.size()>0) { + depotItem = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return depotItem; + } + + public DepotHead getDepotHead(String number) { + DepotHead depotHead = new DepotHead(); + try{ + DepotHeadExample example = new DepotHeadExample(); + example.createCriteria().andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotHeadMapper.selectByExample(example); + if(null!=list && !list.isEmpty()) { + depotHead = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return depotHead; + } + + /** + * 查询被关联订单中指定商品的明细信息 + * @param linkNumber + * @param meId + * @return + * @throws Exception + */ + public DepotItem getPreItemByHeaderIdAndMaterial(String linkNumber, Long meId, Long linkId) { + DepotItem depotItem = new DepotItem(); + try{ + DepotHead depotHead = getDepotHead(linkNumber); + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(depotHead.getId()).andMaterialExtendIdEqualTo(meId).andIdEqualTo(linkId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = depotItemMapper.selectByExample(example); + if(list!=null && list.size()>0) { + depotItem = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return depotItem; + } + + public List getDetailList(Long headerId) { + List list =null; + try{ + list = depotItemMapperEx.getDetailList(headerId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByAll(String materialParam, List categoryIdList, String endTime, Integer offset, Integer rows) { + List list =null; + try{ + list = depotItemMapperEx.findByAll(materialParam, categoryIdList, endTime, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findByAllCount(String materialParam, List categoryIdList, String endTime) { + int result=0; + try{ + result = depotItemMapperEx.findByAllCount(materialParam, categoryIdList, endTime); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getListWithBugOrSale(String materialParam, String billType, + String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag, Integer offset, Integer rows) { + List list =null; + try{ + list = depotItemMapperEx.getListWithBugOrSale(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int getListWithBugOrSaleCount(String materialParam, String billType, + String beginTime, String endTime, String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag) { + int result=0; + try{ + result = depotItemMapperEx.getListWithBugOrSaleCount(materialParam, billType, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public BigDecimal buyOrSale(String type, String subType, Long MId, String beginTime, String endTime, + String[] creatorArray, Long organId, String [] organArray, List depotList, Boolean forceFlag, String sumType) { + BigDecimal result= BigDecimal.ZERO; + try{ + if (SUM_TYPE.equals(sumType)) { + result= depotItemMapperEx.buyOrSaleNumber(type, subType, MId, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, sumType); + } else { + result= depotItemMapperEx.buyOrSalePrice(type, subType, MId, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, sumType); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + + } + + public String[] getCreatorArray(String roleType) { + String creator = getCreatorByRoleType(roleType); + String [] creatorArray=null; + if(StringUtil.isNotEmpty(creator)){ + creatorArray = creator.split(","); + } + return creatorArray; + } + + public String getCreatorByRoleType(String roleType) { + String creator = ""; + User user = userService.getCurrentUser(); + //再从后端获取一次角色类型,防止前端关闭了缓存功能 + if(StringUtil.isEmpty(roleType)) { + roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型 + } + if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { + creator = user.getId().toString(); + } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { + creator = orgaUserRelService.getUserIdListByUserId(user.getId()); + } + return creator; + } + + /** + * 统计采购或销售的总金额 + * @param type + * @param subType + * @param month + * @return + * @throws Exception + */ + public BigDecimal inOrOutPrice(String type, String subType, String month, String roleType) { + BigDecimal result= BigDecimal.ZERO; + try{ + String [] creatorArray = getCreatorArray(roleType); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME; + result = depotItemMapperEx.inOrOutPrice(type, subType, beginTime, endTime, creatorArray, forceFlag); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + /** + * 统计零售的总金额 + * @param type + * @param subType + * @param month + * @return + * @throws Exception + */ + public BigDecimal inOrOutRetailPrice(String type, String subType, String month, String roleType) { + BigDecimal result= BigDecimal.ZERO; + try{ + String [] creatorArray = getCreatorArray(roleType); + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + String beginTime = Tools.firstDayOfMonth(month) + BusinessConstants.DAY_FIRST_TIME; + String endTime = Tools.lastDayOfMonth(month) + BusinessConstants.DAY_LAST_TIME; + result = depotItemMapperEx.inOrOutRetailPrice(type, subType, beginTime, endTime, creatorArray, forceFlag); + result = result.abs(); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void saveDetials(String rows, Long headerId, String actionType, HttpServletRequest request) { + //查询单据主表信息 + DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId); + //删除序列号和回收序列号 + deleteOrCancelSerialNumber(actionType, depotHead, headerId); + //删除单据的明细 + deleteDepotItemHeadId(headerId); + JSONArray rowArr = JSONArray.parseArray(rows); + if (null != rowArr && !rowArr.isEmpty()) { + //针对组装单、拆卸单校验是否存在组合件和普通子件 + checkAssembleWithMaterialType(rowArr, depotHead.getSubType()); + for (int i = 0; i < rowArr.size(); i++) { + DepotItem depotItem = new DepotItem(); + JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i)); + depotItem.setHeaderId(headerId); + String barCode = rowObj.getString("barCode"); + MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode); + if(materialExtend == null) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_IS_NOT_EXIST_MSG, barCode)); + } + depotItem.setMaterialId(materialExtend.getMaterialId()); + depotItem.setMaterialExtendId(materialExtend.getId()); + depotItem.setMaterialUnit(rowObj.getString("unit")); + Material material= commonService.getMaterial(depotItem.getMaterialId()); + if (BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber()) || + BusinessConstants.ENABLE_BATCH_NUMBER_ENABLED.equals(material.getEnableBatchNumber())) { + //组装拆卸单不能选择批号或序列号商品 + if(BusinessConstants.SUB_TYPE_ASSEMBLE.equals(depotHead.getSubType()) || + BusinessConstants.SUB_TYPE_DISASSEMBLE.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_ASSEMBLE_SELECT_ERROR_MSG, barCode)); + } + //调拨单不能选择批号或序列号商品(该场景走出库和入库单) + if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_TRANSFER_SELECT_ERROR_MSG, barCode)); + } + //盘点业务不能选择批号或序列号商品(该场景走出库和入库单) + if(BusinessConstants.SUB_TYPE_CHECK_ENTER.equals(depotHead.getSubType()) + ||BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_CHECK_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_STOCK_CHECK_ERROR_MSG, barCode)); + } + } + if (StringUtil.isExist(rowObj.get("snList"))) { + depotItem.setSnList(rowObj.getString("snList")); + if(StringUtil.isExist(rowObj.get("depotId"))) { + String [] snArray = depotItem.getSnList().split(","); + int operNum = rowObj.getInteger("operNumber"); + if(snArray.length == operNum) { + Long depotId = rowObj.getLong("depotId"); + serialNumberService.addSerialNumberByBill(depotHead.getType(), depotHead.getSubType(), + depotHead.getNumber(), materialExtend.getMaterialId(), depotId, depotItem.getSnList()); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_SN_NUMBERE_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_SN_NUMBERE_FAILED_MSG, barCode)); + } + } + } else { + //入库或出库 + if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) || + BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) { + //序列号不能为空 + if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_CODE, + String.format(ExceptionConstants.MATERIAL_SERIAL_NUMBERE_EMPTY_MSG, barCode)); + } + } + } + if (StringUtil.isExist(rowObj.get("batchNumber"))) { + depotItem.setBatchNumber(rowObj.getString("batchNumber")); + } else { + //入库或出库 + if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType()) || + BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())) { + //批号不能为空 + if (BusinessConstants.ENABLE_BATCH_NUMBER_ENABLED.equals(material.getEnableBatchNumber())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG, barCode)); + } + } + } + if (StringUtil.isExist(rowObj.get("expirationDate"))) { + depotItem.setExpirationDate(rowObj.getDate("expirationDate")); + } + if (StringUtil.isExist(rowObj.get("sku"))) { + depotItem.setSku(rowObj.getString("sku")); + } + if (StringUtil.isExist(rowObj.get("linkId"))) { + depotItem.setLinkId(rowObj.getLong("linkId")); + } + //以下进行单位换算 + Unit unitInfo = commonService.findUnit(materialExtend.getMaterialId()); //查询计量单位信息 + if (StringUtil.isExist(rowObj.get("operNumber"))) { + depotItem.setOperNumber(rowObj.getBigDecimal("operNumber")); + String unit = rowObj.get("unit").toString(); + BigDecimal oNumber = rowObj.getBigDecimal("operNumber"); + if (StringUtil.isNotEmpty(unitInfo.getName())) { + String basicUnit = unitInfo.getBasicUnit(); //基本单位 + if (unit.equals(basicUnit)) { //如果等于基本单位 + depotItem.setBasicNumber(oNumber); //数量一致 + } else if (unit.equals(unitInfo.getOtherUnit())) { //如果等于副单位 + depotItem.setBasicNumber(oNumber.multiply(unitInfo.getRatio())); //数量乘以比例 + } else if (unit.equals(unitInfo.getOtherUnitTwo())) { //如果等于副单位2 + depotItem.setBasicNumber(oNumber.multiply(unitInfo.getRatioTwo())); //数量乘以比例 + } else if (unit.equals(unitInfo.getOtherUnitThree())) { //如果等于副单位3 + depotItem.setBasicNumber(oNumber.multiply(unitInfo.getRatioThree())); //数量乘以比例 + } + } else { + depotItem.setBasicNumber(oNumber); //其他情况 + } + } + //如果数量+已完成数量>原订单数量,给出预警(判断前提是存在关联订单) + if (StringUtil.isNotEmpty(depotHead.getLinkNumber()) + && StringUtil.isExist(rowObj.get("preNumber")) && StringUtil.isExist(rowObj.get("finishNumber"))) { + if("add".equals(actionType)) { + //在新增模式进行状态赋值 + BigDecimal preNumber = rowObj.getBigDecimal("preNumber"); + BigDecimal finishNumber = rowObj.getBigDecimal("finishNumber"); + if(depotItem.getOperNumber().add(finishNumber).compareTo(preNumber)>0) { + if(!systemConfigService.getOverLinkBillFlag()) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode)); + } + } + } else if("update".equals(actionType)) { + //当前单据的类型 + String currentSubType = depotHead.getSubType(); + //在更新模式进行状态赋值 + String unit = rowObj.get("unit").toString(); + Long preHeaderId = getDepotHead(depotHead.getLinkNumber()).getId(); + //前一个单据的数量 + BigDecimal preNumber = getPreItemByHeaderIdAndMaterial(depotHead.getLinkNumber(), depotItem.getMaterialExtendId(), depotItem.getLinkId()).getOperNumber(); + //除去此单据之外的已入库|已出库 + BigDecimal realFinishNumber = getRealFinishNumber(currentSubType, depotItem.getMaterialExtendId(), depotItem.getLinkId(), preHeaderId, headerId, unitInfo, unit); + if(depotItem.getOperNumber().add(realFinishNumber).compareTo(preNumber)>0) { + if(!systemConfigService.getOverLinkBillFlag()) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode)); + } + } + } + } + if (StringUtil.isExist(rowObj.get("unitPrice"))) { + BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice"); + depotItem.setUnitPrice(unitPrice); + if(materialExtend.getLowDecimal()!=null) { + //零售或销售单价低于最低售价,进行提示 + if("零售".equals(depotHead.getSubType()) || "销售".equals(depotHead.getSubType())) { + if (unitPrice.compareTo(materialExtend.getLowDecimal()) < 0) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_UNIT_PRICE_LOW_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_UNIT_PRICE_LOW_MSG, barCode)); + } + } + } + } + //如果是销售出库、销售退货、零售出库、零售退货则给采购单价字段赋值(如果是批次商品,则要根据批号去找之前的入库价) + if(BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType()) || + BusinessConstants.SUB_TYPE_SALES_RETURN.equals(depotHead.getSubType()) || + BusinessConstants.SUB_TYPE_RETAIL.equals(depotHead.getSubType()) || + BusinessConstants.SUB_TYPE_RETAIL_RETURN.equals(depotHead.getSubType())) { + depotItem.setPurchaseUnitPrice(materialExtend.getPurchaseDecimal()); + if(StringUtil.isNotEmpty(depotItem.getBatchNumber())) { + depotItem.setPurchaseUnitPrice(getDepotItemByBatchNumber(depotItem.getBatchNumber()).getUnitPrice()); + } + } + if (StringUtil.isExist(rowObj.get("taxUnitPrice"))) { + depotItem.setTaxUnitPrice(rowObj.getBigDecimal("taxUnitPrice")); + } + if (StringUtil.isExist(rowObj.get("allPrice"))) { + depotItem.setAllPrice(rowObj.getBigDecimal("allPrice")); + } + if (StringUtil.isExist(rowObj.get("depotId"))) { + depotItem.setDepotId(rowObj.getLong("depotId")); + } else { + if(!BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType()) + && !BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_DEPOT_FAILED_MSG)); + } + } + if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + if (StringUtil.isExist(rowObj.get("anotherDepotId"))) { + if(rowObj.getLong("anotherDepotId").equals(rowObj.getLong("depotId"))) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG)); + } else { + depotItem.setAnotherDepotId(rowObj.getLong("anotherDepotId")); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG)); + } + } + if (StringUtil.isExist(rowObj.get("taxRate"))) { + depotItem.setTaxRate(rowObj.getBigDecimal("taxRate")); + } + if (StringUtil.isExist(rowObj.get("taxMoney"))) { + depotItem.setTaxMoney(rowObj.getBigDecimal("taxMoney")); + } + if (StringUtil.isExist(rowObj.get("taxLastMoney"))) { + depotItem.setTaxLastMoney(rowObj.getBigDecimal("taxLastMoney")); + } + if (StringUtil.isExist(rowObj.get("mType"))) { + depotItem.setMaterialType(rowObj.getString("mType")); + } + if (StringUtil.isExist(rowObj.get("remark"))) { + depotItem.setRemark(rowObj.getString("remark")); + } + //出库时判断库存是否充足 + if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){ + BigDecimal stock = getCurrentStockByParam(depotItem.getDepotId(),depotItem.getMaterialId()); + if(StringUtil.isNotEmpty(depotItem.getSku())) { + //对于sku商品要换个方式计算库存 + stock = getSkuStockByParam(depotItem.getDepotId(),depotItem.getMaterialExtendId(),null,null); + } + BigDecimal thisBasicNumber = depotItem.getBasicNumber()==null?BigDecimal.ZERO:depotItem.getBasicNumber(); + if(!systemConfigService.getMinusStockFlag() && stock.compareTo(thisBasicNumber)<0){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE, + String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG, material.getName())); + } + //出库时处理序列号 + if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubType())) { + //判断商品是否开启序列号,开启的售出序列号,未开启的跳过 + if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) { + //售出序列号,获得当前操作人 + User userInfo= userService.getCurrentUser(); + serialNumberService.checkAndUpdateSerialNumber(depotItem, depotHead.getNumber(), userInfo, StringUtil.toNull(depotItem.getSnList())); + } + } + } + this.insertDepotItemWithObj(depotItem); + //更新当前库存 + updateCurrentStock(depotItem); + //更新商品的价格 + updateMaterialExtendPrice(materialExtend.getId(), depotHead.getSubType(), rowObj); + } + //如果关联单据号非空则更新订单的状态,单据类型:采购入库单或销售出库单或盘点复盘单 + if(BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType()) + || BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType()) + || BusinessConstants.SUB_TYPE_REPLAY.equals(depotHead.getSubType())) { + if(StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + //单据状态:是否全部完成 2-全部完成 3-部分完成(针对订单的分批出入库) + String billStatus = getBillStatusByParam(depotHead); + changeBillStatus(depotHead, billStatus); + } + } + //如果关联单据号非空则更新订单的状态,此处针对销售订单转采购订单的场景 + if(BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType())) { + if(StringUtil.isNotEmpty(depotHead.getLinkNumber())) { + String billStatus = getBillStatusByParam(depotHead); + changeBillPurchaseStatus(depotHead, billStatus); + } + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_MSG)); + } + } + /** + * 判断单据的状态 + * 通过数组对比:原单据的商品和商品数量(汇总) 与 分批操作后单据的商品和商品数量(汇总) + * @param depotHead + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String getBillStatusByParam(DepotHead depotHead) { + String res = BusinessConstants.BILLS_STATUS_SKIPED; + //获取原单据的商品和商品数量(汇总) + List linkList = depotItemMapperEx.getLinkBillDetailMaterialSum(depotHead.getLinkNumber()); + //获取分批操作后单据的商品和商品数量(汇总) + List batchList = depotItemMapperEx.getBatchBillDetailMaterialSum(depotHead.getLinkNumber(), depotHead.getType()); + //将分批操作后的单据的商品和商品数据构造成Map + Map materialSumMap = new HashMap<>(); + for(DepotItemVo4MaterialAndSum materialAndSum : batchList) { + materialSumMap.put(materialAndSum.getMaterialExtendId(), materialAndSum.getOperNumber()); + } + for(DepotItemVo4MaterialAndSum materialAndSum : linkList) { + //过滤掉原单里面有数量为0的商品 + if(materialAndSum.getOperNumber().compareTo(BigDecimal.ZERO) != 0) { + BigDecimal materialSum = materialSumMap.get(materialAndSum.getMaterialExtendId()); + if (materialSum != null) { + if (materialSum.compareTo(materialAndSum.getOperNumber()) < 0) { + res = BusinessConstants.BILLS_STATUS_SKIPING; + } + } else { + res = BusinessConstants.BILLS_STATUS_SKIPING; + } + } + } + return res; + } + + /** + * 更新单据状态 + * @param depotHead + * @param billStatus + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void changeBillStatus(DepotHead depotHead, String billStatus) { + DepotHead depotHeadOrders = new DepotHead(); + depotHeadOrders.setStatus(billStatus); + DepotHeadExample example = new DepotHeadExample(); + List linkNumberList = StringUtil.strToStringList(depotHead.getLinkNumber()); + example.createCriteria().andNumberIn(linkNumberList); + try{ + depotHeadMapper.updateByExampleSelective(depotHeadOrders, example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } + + /** + * 更新单据状态,此处针对销售订单转采购订单的场景 + * @param depotHead + * @param billStatus + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void changeBillPurchaseStatus(DepotHead depotHead, String billStatus) { + DepotHead depotHeadOrders = new DepotHead(); + depotHeadOrders.setPurchaseStatus(billStatus); + DepotHeadExample example = new DepotHeadExample(); + List linkNumberList = StringUtil.strToStringList(depotHead.getLinkNumber()); + example.createCriteria().andNumberIn(linkNumberList); + try{ + depotHeadMapper.updateByExampleSelective(depotHeadOrders, example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } + + /** + * 根据批号查询单据明细信息 + * @param batchNumber + * @return + */ + public DepotItem getDepotItemByBatchNumber(String batchNumber) { + List depotItemList = depotItemMapperEx.getDepotItemByBatchNumber(batchNumber); + if(null != depotItemList && !depotItemList.isEmpty()){ + return depotItemList.get(0); + } else { + return new DepotItem(); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteDepotItemHeadId(Long headerId) { + try{ + //1、查询删除前的单据明细 + List depotItemList = getListByHeaderId(headerId); + //2、删除单据明细 + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId); + depotItemMapper.deleteByExample(example); + //3、计算删除之后单据明细中商品的库存 + for(DepotItem depotItem : depotItemList){ + updateCurrentStock(depotItem); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + + /** + * 删除序列号和回收序列号 + * @param actionType + * @throws Exception + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void deleteOrCancelSerialNumber(String actionType, DepotHead depotHead, Long headerId) { + if(actionType.equals("update")) { + User userInfo = userService.getCurrentUser(); + if(BusinessConstants.DEPOTHEAD_TYPE_IN.equals(depotHead.getType())){ + //入库逻辑 + String number = depotHead.getNumber(); + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andInBillNoEqualTo(number); + serialNumberService.deleteByExample(example); + } else if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){ + //出库逻辑 + DepotItemExample example = new DepotItemExample(); + example.createCriteria().andHeaderIdEqualTo(headerId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List depotItemList = depotItemMapper.selectByExample(example); + if(null != depotItemList && !depotItemList.isEmpty()){ + for (DepotItem depotItem : depotItemList){ + if(StringUtil.isNotEmpty(depotItem.getSnList())){ + serialNumberService.cancelSerialNumber(depotItem.getMaterialId(), depotHead.getNumber(), (depotItem.getBasicNumber() == null ? 0 : depotItem.getBasicNumber()).intValue(), userInfo); + } + } + } + } + } + } + + /** + * 针对组装单、拆卸单校验是否存在组合件和普通子件 + * @param rowArr + * @param subType + */ + public void checkAssembleWithMaterialType(JSONArray rowArr, String subType) { + if(BusinessConstants.SUB_TYPE_ASSEMBLE.equals(subType) || + BusinessConstants.SUB_TYPE_DISASSEMBLE.equals(subType)) { + if(rowArr.size() > 1) { + JSONObject firstRowObj = JSONObject.parseObject(rowArr.getString(0)); + JSONObject secondRowObj = JSONObject.parseObject(rowArr.getString(1)); + String firstMaterialType = firstRowObj.getString("mType"); + String secondMaterialType = secondRowObj.getString("mType"); + if(!"组合件".equals(firstMaterialType) || !"普通子件".equals(secondMaterialType)) { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_MSG)); + } + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_CODE, + String.format(ExceptionConstants.DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_MSG)); + } + } + } + + /** + * 更新商品的价格 + * @param meId + * @param subType + * @param rowObj + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateMaterialExtendPrice(Long meId, String subType, JSONObject rowObj) { + if(systemConfigService.getUpdateUnitPriceFlag()) { + if (StringUtil.isExist(rowObj.get("unitPrice"))) { + BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice"); + MaterialExtend materialExtend = new MaterialExtend(); + materialExtend.setId(meId); + if(BusinessConstants.SUB_TYPE_PURCHASE.equals(subType)) { + materialExtend.setPurchaseDecimal(unitPrice); + } + if(BusinessConstants.SUB_TYPE_SALES.equals(subType)) { + materialExtend.setWholesaleDecimal(unitPrice); + } + if(BusinessConstants.SUB_TYPE_RETAIL.equals(subType)) { + materialExtend.setCommodityDecimal(unitPrice); + } + materialExtendService.updateMaterialExtend(materialExtend); + } + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public List findStockWarningCount(Integer offset, Integer rows, String materialParam, List depotList) { + List list = null; + try{ + list =depotItemMapperEx.findStockWarningCount(offset, rows, materialParam, depotList); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int findStockWarningCountTotal(String materialParam, List depotList) { + int result = 0; + try{ + result =depotItemMapperEx.findStockWarningCountTotal(materialParam, depotList); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + /** + * 库存统计-sku + * @param depotId + * @param meId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getSkuStockByParam(Long depotId, Long meId, String beginTime, String endTime) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + List depotList = depotService.parseDepotList(depotId); + //盘点复盘后数量的变动 + BigDecimal stockCheckSum = depotItemMapperEx.getSkuStockCheckSumByDepotList(depotList, meId, forceFlag, beginTime, endTime); + DepotItemVo4Stock stockObj = depotItemMapperEx.getSkuStockByParamWithDepotList(depotList, meId, forceFlag, beginTime, endTime); + BigDecimal stockSum = BigDecimal.ZERO; + if(stockObj!=null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + stockSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal) + .subtract(outTotal).subtract(transfOutTotal).subtract(assemOutTotal).subtract(disAssemOutTotal); + } + return stockCheckSum.add(stockSum); + } + + /** + * 库存统计-单仓库 + * @param depotId + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getStockByParam(Long depotId, Long mId, String beginTime, String endTime) { + List depotList = depotService.parseDepotList(depotId); + return getStockByParamWithDepotList(depotList, mId, beginTime, endTime); + } + + /** + * 库存统计-多仓库 + * @param depotList + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public BigDecimal getStockByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + //初始库存 + BigDecimal initStock = commonService.getInitStockByMidAndDepotList(depotList, mId); + //盘点复盘后数量的变动 + BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, forceFlag, beginTime, endTime); + DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, forceFlag, beginTime, endTime); + BigDecimal stockSum = BigDecimal.ZERO; + if(stockObj!=null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + stockSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal) + .subtract(outTotal).subtract(transfOutTotal).subtract(assemOutTotal).subtract(disAssemOutTotal); + } + return initStock.add(stockCheckSum).add(stockSum); + } + + /** + * 统计时间段内的入库和出库数量-多仓库 + * @param depotList + * @param mId + * @param beginTime + * @param endTime + * @return + */ + public Map getIntervalMapByParamWithDepotList(List depotList, Long mId, String beginTime, String endTime) { + Boolean forceFlag = systemConfigService.getForceApprovalFlag(); + Map intervalMap = new HashMap<>(); + BigDecimal inSum = BigDecimal.ZERO; + BigDecimal outSum = BigDecimal.ZERO; + //盘点复盘后数量的变动 + BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, forceFlag, beginTime, endTime); + DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, forceFlag, beginTime, endTime); + if(stockObj!=null) { + BigDecimal inTotal = stockObj.getInTotal(); + BigDecimal transfInTotal = stockObj.getTransfInTotal(); + BigDecimal assemInTotal = stockObj.getAssemInTotal(); + BigDecimal disAssemInTotal = stockObj.getDisAssemInTotal(); + inSum = inTotal.add(transfInTotal).add(assemInTotal).add(disAssemInTotal); + BigDecimal outTotal = stockObj.getOutTotal(); + BigDecimal transfOutTotal = stockObj.getTransfOutTotal(); + BigDecimal assemOutTotal = stockObj.getAssemOutTotal(); + BigDecimal disAssemOutTotal = stockObj.getDisAssemOutTotal(); + outSum = outTotal.add(transfOutTotal).add(assemOutTotal).add(disAssemOutTotal); + } + if(stockCheckSum.compareTo(BigDecimal.ZERO)>0) { + inSum = inSum.add(stockCheckSum); + } else { + //盘点复盘数量为负数代表出库 + outSum = outSum.subtract(stockCheckSum); + } + intervalMap.put("inSum", inSum); + intervalMap.put("outSum", outSum); + return intervalMap; + } + + /** + * 根据单据明细来批量更新当前库存 + * @param depotItem + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateCurrentStock(DepotItem depotItem) { + updateCurrentStockFun(depotItem.getMaterialId(), depotItem.getDepotId()); + if(depotItem.getAnotherDepotId()!=null){ + updateCurrentStockFun(depotItem.getMaterialId(), depotItem.getAnotherDepotId()); + } + } + + /** + * 根据商品和仓库来更新当前库存 + * @param mId + * @param dId + */ + public void updateCurrentStockFun(Long mId, Long dId) { + if(mId!=null && dId!=null) { + MaterialCurrentStockExample example = new MaterialCurrentStockExample(); + example.createCriteria().andMaterialIdEqualTo(mId).andDepotIdEqualTo(dId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCurrentStockMapper.selectByExample(example); + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setDepotId(dId); + materialCurrentStock.setCurrentNumber(getStockByParam(dId,mId,null,null)); + if(list!=null && !list.isEmpty()) { + Long mcsId = list.get(0).getId(); + materialCurrentStock.setId(mcsId); + materialCurrentStockMapper.updateByPrimaryKeySelective(materialCurrentStock); + } else { + materialCurrentStockMapper.insertSelective(materialCurrentStock); + } + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BigDecimal getFinishNumber(Long meId, Long id, Long headerId, Unit unitInfo, String materialUnit, String linkType) { + Long linkId = id; + String goToType = ""; + DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId); + String linkNumber = depotHead.getNumber(); //订单号 + if("purchase".equals(linkType)) { + //针对以销定购的情况 + if(BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_PURCHASE_ORDER; + } + } else { + //采购订单转采购入库 + if(BusinessConstants.SUB_TYPE_PURCHASE_ORDER.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_PURCHASE; + } + //销售订单转销售出库 + if(BusinessConstants.SUB_TYPE_SALES_ORDER.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_SALES; + } + //采购入库转采购退货 + if(BusinessConstants.SUB_TYPE_PURCHASE.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_PURCHASE_RETURN; + } + //销售出库转销售退货 + if(BusinessConstants.SUB_TYPE_SALES.equals(depotHead.getSubType())) { + goToType = BusinessConstants.SUB_TYPE_SALES_RETURN; + } + } + BigDecimal count = depotItemMapperEx.getFinishNumber(meId, linkId, linkNumber, goToType); + //根据多单位情况进行数量的转换 + if(materialUnit.equals(unitInfo.getOtherUnit()) && unitInfo.getRatio()!=null && unitInfo.getRatio().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatio(), 2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitTwo()) && unitInfo.getRatioTwo()!=null && unitInfo.getRatioTwo().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatioTwo(), 2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitThree()) && unitInfo.getRatioThree()!=null && unitInfo.getRatioThree().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatioThree(), 2, BigDecimal.ROUND_HALF_UP); + } + return count; + } + + /** + * 除去此单据之外的已入库|已出库|已转采购 + * @param currentSubType + * @param meId + * @param linkId + * @param preHeaderId + * @param currentHeaderId + * @param unitInfo + * @param materialUnit + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BigDecimal getRealFinishNumber(String currentSubType, Long meId, Long linkId, Long preHeaderId, Long currentHeaderId, Unit unitInfo, String materialUnit) { + String goToType = currentSubType; + DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(preHeaderId); + String linkNumber = depotHead.getNumber(); //订单号 + BigDecimal count = depotItemMapperEx.getRealFinishNumber(meId, linkId, linkNumber, currentHeaderId, goToType); + //根据多单位情况进行数量的转换 + if(materialUnit.equals(unitInfo.getOtherUnit()) && unitInfo.getRatio()!=null && unitInfo.getRatio().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatio(),2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitTwo()) && unitInfo.getRatioTwo()!=null && unitInfo.getRatioTwo().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatioTwo(),2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitThree()) && unitInfo.getRatioThree()!=null && unitInfo.getRatioThree().compareTo(BigDecimal.ZERO)!=0) { + count = count.divide(unitInfo.getRatioThree(),2, BigDecimal.ROUND_HALF_UP); + } + return count; + } + + public List getBatchNumberList(String number, String name, Long depotId, String barCode, String batchNumber) { + List reslist = new ArrayList<>(); + List list = depotItemMapperEx.getBatchNumberList(StringUtil.toNull(number), name, depotId, barCode, batchNumber); + for(DepotItemVoBatchNumberList bn: list) { + if(bn.getTotalNum()!=null && bn.getTotalNum().compareTo(BigDecimal.ZERO)>0) { + bn.setExpirationDateStr(Tools.parseDateToStr(bn.getExpirationDate())); + if(bn.getUnitId()!=null) { + Unit unit = unitService.getUnit(bn.getUnitId()); + String commodityUnit = bn.getCommodityUnit(); + bn.setTotalNum(unitService.parseStockByUnit(bn.getTotalNum(), unit, commodityUnit)); + } + reslist.add(bn); + } + } + return reslist; + } + + public Long getCountByMaterialAndDepot(Long mId, Long depotId) { + return depotItemMapperEx.getCountByMaterialAndDepot(mId, depotId); + } + + public JSONObject parseMapByExcelData(String barCodes, List> detailList, String prefixNo) { + JSONObject map = new JSONObject(); + JSONArray arr = new JSONArray(); + List list = depotItemMapperEx.getBillItemByParam(barCodes); + Map materialMap = new HashMap<>(); + for (MaterialVo4Unit material: list) { + materialMap.put( material.getMBarCode(), material); + } + for (Map detailMap: detailList) { + JSONObject item = new JSONObject(); + String barCode = detailMap.get("barCode"); + if(StringUtil.isNotEmpty(barCode)) { + MaterialVo4Unit m = materialMap.get(barCode); + if(m!=null) { + item.put("barCode", barCode); + item.put("name", m.getName()); + item.put("standard", m.getStandard()); + if(StringUtil.isNotEmpty(m.getModel())) { + item.put("model", m.getModel()); + } + if(StringUtil.isNotEmpty(m.getColor())) { + item.put("color", m.getColor()); + } + if(StringUtil.isNotEmpty(m.getSku())) { + item.put("sku", m.getSku()); + } + BigDecimal stock = BigDecimal.ZERO; + if(StringUtil.isNotEmpty(m.getSku())){ + stock = getSkuStockByParam(null, m.getMeId(),null,null); + } else { + stock = getCurrentStockByParam(null, m.getId()); + } + item.put("stock", stock); + item.put("unit", m.getCommodityUnit()); + BigDecimal operNumber = BigDecimal.ZERO; + BigDecimal unitPrice = BigDecimal.ZERO; + BigDecimal taxRate = BigDecimal.ZERO; + if(StringUtil.isNotEmpty(detailMap.get("num"))) { + operNumber = new BigDecimal(detailMap.get("num")); + } + if(StringUtil.isNotEmpty(detailMap.get("unitPrice"))) { + unitPrice = new BigDecimal(detailMap.get("unitPrice")); + } else { + if("CGDD".equals(prefixNo)) { + unitPrice = m.getPurchaseDecimal(); + } else if("XSDD".equals(prefixNo)) { + unitPrice = m.getWholesaleDecimal(); + } + } + if(StringUtil.isNotEmpty(detailMap.get("taxRate"))) { + taxRate = new BigDecimal(detailMap.get("taxRate")); + } + String remark = detailMap.get("remark"); + item.put("operNumber", operNumber); + item.put("unitPrice", unitPrice); + BigDecimal allPrice = BigDecimal.ZERO; + if(unitPrice!=null && unitPrice.compareTo(BigDecimal.ZERO)!=0) { + allPrice = unitPrice.multiply(operNumber); + } + BigDecimal taxMoney = BigDecimal.ZERO; + if(taxRate.compareTo(BigDecimal.ZERO) != 0) { + taxMoney = taxRate.multiply(allPrice).divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_HALF_UP); + } + BigDecimal taxLastMoney = allPrice.add(taxMoney); + item.put("allPrice", allPrice); + item.put("taxRate", taxRate); + item.put("taxMoney", taxMoney); + item.put("taxLastMoney", taxLastMoney); + item.put("remark", remark); + arr.add(item); + } else { + throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_BARCODE_IS_NOT_EXIST_CODE, + String.format(ExceptionConstants.DEPOT_ITEM_BARCODE_IS_NOT_EXIST_MSG, barCode)); + } + } + } + map.put("rows", arr); + return map; + } + + public BigDecimal getLastUnitPriceByParam(Long organId, Long meId, String prefixNo) { + String type = ""; + String subType = ""; + if("XSDD".equals(prefixNo)) { + type = "其它"; + subType = "销售订单"; + } else if("XSCK".equals(prefixNo)) { + type = "出库"; + subType = "销售"; + } else if("XSTH".equals(prefixNo)) { + type = "入库"; + subType = "销售退货"; + } else if("QTCK".equals(prefixNo)) { + type = "出库"; + subType = "其它"; + } + return depotItemMapperEx.getLastUnitPriceByParam(organId, meId, type, subType); + } + + public BigDecimal getCurrentStockByParam(Long depotId, Long mId) { + BigDecimal stock = depotItemMapperEx.getCurrentStockByParam(depotId, mId); + return stock!=null? stock: BigDecimal.ZERO; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java index 7010838a..24842b67 100644 --- a/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java @@ -1,18 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialAccount; +import com.wansensoft.entities.FinancialAccount; import com.wansensoft.mappers.financial.FinancialAccountMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -21,6 +9,9 @@ *

* 账户信息 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class FinancialAccountServiceImpl extends ServiceImpl implements IFinancialAccountService { diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java index 0fe9f098..2c790023 100644 --- a/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java @@ -1,18 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialMain; +import com.wansensoft.entities.FinancialMain; import com.wansensoft.mappers.financial.FinancialMainMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -21,6 +9,9 @@ *

* 财务主表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class FinancialMainServiceImpl extends ServiceImpl implements IFinancialMainService { diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java index 77509128..769a5e03 100644 --- a/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java @@ -1,18 +1,6 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialSub; +import com.wansensoft.entities.FinancialSub; import com.wansensoft.mappers.financial.FinancialSubMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -21,6 +9,9 @@ *

* 财务子表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class FinancialSubServiceImpl extends ServiceImpl implements IFinancialSubService { diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java index bec89a51..c83afaf4 100644 --- a/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialAccount; +import com.wansensoft.entities.FinancialAccount; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 账户信息 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IFinancialAccountService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java index a19769d5..189297ee 100644 --- a/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialMain; +import com.wansensoft.entities.FinancialMain; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 财务主表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IFinancialMainService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java index 0871d586..b38f279c 100644 --- a/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.financial; -import com.wansensoft.entities.financial.FinancialSub; +import com.wansensoft.entities.FinancialSub; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 财务子表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IFinancialSubService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/functions/FunctionComponent.java b/service/src/main/java/com/wansensoft/service/functions/FunctionComponent.java new file mode 100644 index 00000000..31f27e86 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/functions/FunctionComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "function_component") +@FunctionResource +public class FunctionComponent implements ICommonQuery { + + private final FunctionService functionService; + + public FunctionComponent(FunctionService functionService) { + this.functionService = functionService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return functionService.getFunction(id); + } + + @Override + public List select(Map map)throws Exception { + return getFunctionsList(map); + } + + private List getFunctionsList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String order = QueryUtils.order(map); + return functionService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + return functionService.countFunction(name, type); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return functionService.insertFunction(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return functionService.updateFunction(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return functionService.deleteFunction(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return functionService.batchDeleteFunction(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return functionService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/functions/FunctionResource.java b/service/src/main/java/com/wansensoft/service/functions/FunctionResource.java new file mode 100644 index 00000000..b73b325c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/functions/FunctionResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.functions; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "function") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface FunctionResource { +} diff --git a/service/src/main/java/com/wansensoft/service/functions/FunctionService.java b/service/src/main/java/com/wansensoft/service/functions/FunctionService.java new file mode 100644 index 00000000..e4c0236c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/functions/FunctionService.java @@ -0,0 +1,42 @@ +package com.wansensoft.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.function.Function; +import com.wansensoft.entities.function.FunctionEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface FunctionService extends IService { + + Function getFunction(long id); + + List getFunctionListByIds(String ids); + + List getFunction(); + + List select(String name, String type, int offset, int rows); + + Long countFunction(String name, String type); + + int insertFunction(JSONObject obj, HttpServletRequest request); + + int updateFunction(JSONObject obj, HttpServletRequest request); + + int deleteFunction(Long id, HttpServletRequest request); + + int batchDeleteFunction(String ids, HttpServletRequest request); + + int batchDeleteFunctionByIds(String ids); + + int checkIsNameExist(Long id, String name); + + int checkIsNumberExist(Long id, String number); + + List getRoleFunction(String pNumber); + + List findRoleFunction(String pNumber); + + List findByIds(String functionsIds); +} diff --git a/service/src/main/java/com/wansensoft/service/functions/FunctionServiceImpl.java b/service/src/main/java/com/wansensoft/service/functions/FunctionServiceImpl.java new file mode 100644 index 00000000..f91f8e84 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/functions/FunctionServiceImpl.java @@ -0,0 +1,246 @@ +package com.wansensoft.service.functions; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.function.Function; +import com.wansensoft.entities.function.FunctionEx; +import com.wansensoft.entities.function.FunctionExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.function.FunctionMapper; +import com.wansensoft.mappers.function.FunctionMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.systemConfig.SystemConfigService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class FunctionServiceImpl extends ServiceImpl implements FunctionService{ + private Logger logger = LoggerFactory.getLogger(FunctionServiceImpl.class); + + private final FunctionMapper functionsMapper; + private final FunctionMapperEx functionMapperEx; + private final CommonService commonService; + private final SystemConfigService systemConfigService; + private final LogService logService; + + public FunctionServiceImpl(FunctionMapper functionsMapper, FunctionMapperEx functionMapperEx, CommonService commonService, SystemConfigService systemConfigService, LogService logService) { + this.functionsMapper = functionsMapper; + this.functionMapperEx = functionMapperEx; + this.commonService = commonService; + this.systemConfigService = systemConfigService; + this.logService = logService; + } + + public Function getFunction(long id) { + Function result=null; + try{ + result=functionsMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getFunctionListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + FunctionExample example = new FunctionExample(); + example.createCriteria().andIdIn(idList); + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getFunction() { + FunctionExample example = new FunctionExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, String type, int offset, int rows) { + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + list = functionMapperEx.selectByConditionFunction(name, type, offset, rows); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countFunction(String name, String type) { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = functionMapperEx.countsByFunction(name, type); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertFunction(JSONObject obj, HttpServletRequest request) { + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + functions.setState(false); + functions.setType("电脑版"); + result = functionsMapper.insertSelective(functions); + logService.insertLog("功能", + BusinessConstants.LOG_OPERATION_TYPE_ADD + functions.getName(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateFunction(JSONObject obj, HttpServletRequest request) { + Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = functionsMapper.updateByPrimaryKeySelective(functions); + logService.insertLog("功能", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + functions.getName(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteFunction(Long id, HttpServletRequest request) { + return batchDeleteFunctionByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunction(String ids, HttpServletRequest request) { + return batchDeleteFunctionByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteFunctionByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getFunctionListByIds(ids); + for(Function functions: list){ + sb.append("[").append(functions.getName()).append("]"); + } + User userInfo= commonService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = functionMapperEx.batchDeleteFunctionByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + logService.insertLog("功能", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + FunctionExample example = new FunctionExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public int checkIsNumberExist(Long id, String number) { + FunctionExample example = new FunctionExample(); + example.createCriteria().andIdNotEqualTo(id).andNumberEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List getRoleFunction(String pNumber) { + FunctionExample example = new FunctionExample(); + example.createCriteria().andEnabledEqualTo(true).andParentNumberEqualTo(pNumber) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("Sort"); + List list=null; + try{ + list = functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findRoleFunction(String pNumber) { + List list=null; + try{ + boolean multiLevelApprovalFlag = systemConfigService.getMultiLevelApprovalFlag(); + FunctionExample example = new FunctionExample(); + FunctionExample.Criteria criteria = example.createCriteria(); + criteria.andEnabledEqualTo(true).andParentNumberEqualTo(pNumber) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + if("0".equals(pNumber)) { + if(!multiLevelApprovalFlag) { + criteria.andUrlNotEqualTo("/workflow"); + } + } + example.setOrderByClause("Sort"); + list =functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByIds(String functionsIds) { + List idList = StringUtil.strToLongList(functionsIds); + FunctionExample example = new FunctionExample(); + example.createCriteria().andEnabledEqualTo(true).andIdIn(idList).andPushBtnIsNotNull().andPushBtnNotEqualTo("") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("Sort asc"); + List list=null; + try{ + list =functionsMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } +} diff --git a/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemComponent.java b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemComponent.java new file mode 100644 index 00000000..f8e4cbf3 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemComponent.java @@ -0,0 +1,77 @@ +package com.wansensoft.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@InOutItemResource +public class InOutItemComponent implements ICommonQuery { + + private final InOutItemService inOutItemService; + + public InOutItemComponent(InOutItemService inOutItemService) { + this.inOutItemService = inOutItemService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return inOutItemService.getInOutItem(id); + } + + @Override + public List select(Map map)throws Exception { + return getFunctionsList(map); + } + + private List getFunctionsList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String remark = StringUtil.getInfo(search, "remark"); + String order = QueryUtils.order(map); + return inOutItemService.select(name, type, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String remark = StringUtil.getInfo(search, "remark"); + return inOutItemService.countInOutItem(name, type, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return inOutItemService.insertInOutItem(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return inOutItemService.updateInOutItem(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return inOutItemService.deleteInOutItem(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return inOutItemService.batchDeleteInOutItem(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return inOutItemService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemResource.java b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemResource.java new file mode 100644 index 00000000..6e9f926b --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.inOutItem; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "inOutItem") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface InOutItemResource { +} diff --git a/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemService.java b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemService.java new file mode 100644 index 00000000..a3e29e25 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemService.java @@ -0,0 +1,37 @@ +package com.wansensoft.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.inOutItem.InOutItem; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface InOutItemService extends IService { + + InOutItem getInOutItem(long id); + + List getInOutItemListByIds(String ids); + + List getInOutItem(); + + List select(String name, String type, String remark, int offset, int rows); + + Long countInOutItem(String name, String type, String remark); + + int insertInOutItem(JSONObject obj, HttpServletRequest request); + + int updateInOutItem(JSONObject obj, HttpServletRequest request); + + int deleteInOutItem(Long id, HttpServletRequest request); + + int batchDeleteInOutItem(String ids, HttpServletRequest request); + + int batchDeleteInOutItemByIds(String ids); + + int checkIsNameExist(Long id, String name); + + List findBySelect(String type); + + int batchSetStatus(Boolean status, String ids); +} diff --git a/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemServiceImpl.java b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemServiceImpl.java new file mode 100644 index 00000000..9755294e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/inOutItem/InOutItemServiceImpl.java @@ -0,0 +1,233 @@ +package com.wansensoft.service.inOutItem; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.AccountItem; +import com.wansensoft.entities.inOutItem.InOutItem; +import com.wansensoft.entities.inOutItem.InOutItemExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.account.AccountItemMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.log.LogServiceImpl; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.user.UserServiceImpl; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.inOutItem.InOutItemMapper; +import com.wansensoft.mappers.inOutItem.InOutItemMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class InOutItemServiceImpl extends ServiceImpl implements InOutItemService{ + private Logger logger = LoggerFactory.getLogger(InOutItemServiceImpl.class); + + private final InOutItemMapper inOutItemMapper; + private final InOutItemMapperEx inOutItemMapperEx; + private final UserService userService; + private final LogService logService; + private final AccountItemMapperEx accountItemMapperEx; + + public InOutItemServiceImpl(InOutItemMapper inOutItemMapper, InOutItemMapperEx inOutItemMapperEx, UserService userService, LogService logService, AccountItemMapperEx accountItemMapperEx) { + this.inOutItemMapper = inOutItemMapper; + this.inOutItemMapperEx = inOutItemMapperEx; + this.userService = userService; + this.logService = logService; + this.accountItemMapperEx = accountItemMapperEx; + } + + public InOutItem getInOutItem(long id) { + InOutItem result=null; + try{ + result=inOutItemMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getInOutItemListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andIdIn(idList); + list = inOutItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getInOutItem() { + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, String type, String remark, int offset, int rows) { + List list=null; + try{ + list=inOutItemMapperEx.selectByConditionInOutItem(name, type, remark, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countInOutItem(String name, String type, String remark) { + Long result=null; + try{ + result=inOutItemMapperEx.countsByInOutItem(name, type, remark); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertInOutItem(JSONObject obj, HttpServletRequest request) { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + inOutItem.setEnabled(true); + result=inOutItemMapper.insertSelective(inOutItem); + logService.insertLog("收支项目", + BusinessConstants.LOG_OPERATION_TYPE_ADD + inOutItem.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateInOutItem(JSONObject obj, HttpServletRequest request) { + InOutItem inOutItem = JSONObject.parseObject(obj.toJSONString(), InOutItem.class); + int result=0; + try{ + result=inOutItemMapper.updateByPrimaryKeySelective(inOutItem); + logService.insertLog("收支项目", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + inOutItem.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteInOutItem(Long id, HttpServletRequest request) { + return batchDeleteInOutItemByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItem(String ids, HttpServletRequest request) { + return batchDeleteInOutItemByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteInOutItemByIds(String ids) { + int result = 0; + String [] idArray=ids.split(","); + //校验财务子表 jsh_accountitem + List accountItemList=null; + try{ + accountItemList=accountItemMapperEx.getAccountItemListByInOutItemIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(accountItemList!=null&&accountItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,InOutItemIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验通过执行删除操作 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getInOutItemListByIds(ids); + for(InOutItem inOutItem: list){ + sb.append("[").append(inOutItem.getName()).append("]"); + } + logService.insertLog("收支项目", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + try{ + result=inOutItemMapperEx.batchDeleteInOutItemByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + + return list==null?0:list.size(); + } + + public List findBySelect(String type) { + InOutItemExample example = new InOutItemExample(); + if (type.equals("in")) { + example.createCriteria().andTypeEqualTo("收入").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else if (type.equals("out")) { + example.createCriteria().andTypeEqualTo("支出").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + example.createCriteria().andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + example.setOrderByClause("sort asc, id desc"); + List list = null; + try{ + list=inOutItemMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("收支项目", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List inOutItemIds = StringUtil.strToLongList(ids); + InOutItem inOutItem = new InOutItem(); + inOutItem.setEnabled(status); + InOutItemExample example = new InOutItemExample(); + example.createCriteria().andIdIn(inOutItemIds); + int result=0; + try{ + result = inOutItemMapper.updateByExampleSelective(inOutItem, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/log/LogComponent.java b/service/src/main/java/com/wansensoft/service/log/LogComponent.java new file mode 100644 index 00000000..aee67139 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/log/LogComponent.java @@ -0,0 +1,85 @@ +package com.wansensoft.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "log_component") +@LogResource +public class LogComponent implements ICommonQuery { + + private final LogService logService; + + public LogComponent(LogService logService) { + this.logService = logService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return logService.getLog(id); + } + + @Override + public List select(Map map)throws Exception { + return getLogList(map); + } + + private List getLogList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String operation = StringUtil.getInfo(search, "operation"); + String userInfo = StringUtil.getInfo(search, "userInfo"); + String clientIp = StringUtil.getInfo(search, "clientIp"); + Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String content = StringUtil.getInfo(search, "content"); + return logService.select(operation, userInfo, clientIp, status, beginTime, endTime, content, + QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String operation = StringUtil.getInfo(search, "operation"); + String userInfo = StringUtil.getInfo(search, "userInfo"); + String clientIp = StringUtil.getInfo(search, "clientIp"); + Integer status = StringUtil.parseInteger(StringUtil.getInfo(search, "status")); + String beginTime = StringUtil.getInfo(search, "beginTime"); + String endTime = StringUtil.getInfo(search, "endTime"); + String content = StringUtil.getInfo(search, "content"); + return logService.countLog(operation, userInfo, clientIp, status, beginTime, endTime, content); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return logService.insertLog(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return logService.updateLog(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return logService.deleteLog(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return logService.batchDeleteLog(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/log/LogResource.java b/service/src/main/java/com/wansensoft/service/log/LogResource.java new file mode 100644 index 00000000..fc928e46 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/log/LogResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.log; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "log") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface LogResource { +} diff --git a/service/src/main/java/com/wansensoft/service/log/LogService.java b/service/src/main/java/com/wansensoft/service/log/LogService.java new file mode 100644 index 00000000..0149d103 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/log/LogService.java @@ -0,0 +1,33 @@ +package com.wansensoft.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.log.Log; +import com.wansensoft.vo.LogVo4List; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface LogService extends IService { + Log getLog(long id); + + List getLog(); + + List select(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content, int offset, int rows); + + Long countLog(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content); + + int insertLog(JSONObject obj, HttpServletRequest request); + + int updateLog(JSONObject obj, HttpServletRequest request); + + int deleteLog(Long id, HttpServletRequest request); + + int batchDeleteLog(String ids, HttpServletRequest request); + + void insertLog(String moduleName, String content, HttpServletRequest request); + + void insertLogWithUserId(Long userId, Long tenantId, String moduleName, String content, HttpServletRequest request); +} diff --git a/service/src/main/java/com/wansensoft/service/log/LogServiceImpl.java b/service/src/main/java/com/wansensoft/service/log/LogServiceImpl.java new file mode 100644 index 00000000..dfa5272c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/log/LogServiceImpl.java @@ -0,0 +1,191 @@ +package com.wansensoft.service.log; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.log.Log; +import com.wansensoft.entities.log.LogExample; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.log.LogMapper; +import com.wansensoft.mappers.log.LogMapperEx; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.vo.LogVo4List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +import static com.wansensoft.utils.Tools.getLocalIp; + +@Service +public class LogServiceImpl extends ServiceImpl implements LogService { + private Logger logger = LoggerFactory.getLogger(LogServiceImpl.class); + + private final LogMapper logMapper; + private final LogMapperEx logMapperEx; + private final CommonService commonService; + private final RedisService redisService; + + public LogServiceImpl(LogMapper logMapper, LogMapperEx logMapperEx, CommonService commonService, RedisService redisService) { + this.logMapper = logMapper; + this.logMapperEx = logMapperEx; + this.commonService = commonService; + this.redisService = redisService; + } + + public Log getLog(long id) { + Log result=null; + try{ + result=logMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getLog() { + LogExample example = new LogExample(); + List list=null; + try{ + list=logMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content, int offset, int rows) { + List list=null; + try{ + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + list=logMapperEx.selectByConditionLog(operation, userInfo, clientIp, status, beginTime, endTime, + content, offset, rows); + if (null != list) { + for (LogVo4List log : list) { + log.setCreateTimeStr(Tools.getCenternTime(log.getCreateTime())); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countLog(String operation, String userInfo, String clientIp, Integer status, String beginTime, String endTime, + String content) { + Long result=null; + try{ + beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME); + endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME); + result=logMapperEx.countsByLog(operation, userInfo, clientIp, status, beginTime, endTime, content); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertLog(JSONObject obj, HttpServletRequest request) { + Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); + int result=0; + try{ + result=logMapper.insertSelective(log); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateLog(JSONObject obj, HttpServletRequest request) { + Log log = JSONObject.parseObject(obj.toJSONString(), Log.class); + int result=0; + try{ + result=logMapper.updateByPrimaryKeySelective(log); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteLog(Long id, HttpServletRequest request) { + int result=0; + try{ + result=logMapper.deleteByPrimaryKey(id); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteLog(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + LogExample example = new LogExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=logMapper.deleteByExample(example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public void insertLog(String moduleName, String content, HttpServletRequest request) { + try{ + Long userId = commonService.getUserId(request); + if(userId!=null) { + String clientIp = getLocalIp(request); + String createTime = Tools.getNow3(); + Long count = logMapperEx.getCountByIpAndDate(userId, moduleName, clientIp, createTime); + if(count > 0) { + //如果某个用户某个IP在同1秒内连续操作两遍,此时需要删除该redis记录,使其退出,防止恶意攻击 + redisService.deleteObjectByUserAndIp(userId, clientIp); + } else { + Log log = new Log(); + log.setUserId(userId); + log.setOperation(moduleName); + log.setClientIp(getLocalIp(request)); + log.setCreateTime(new Date()); + Byte status = 0; + log.setStatus(status); + log.setContent(content); + logMapper.insertSelective(log); + } + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + + public void insertLogWithUserId(Long userId, Long tenantId, String moduleName, String content, HttpServletRequest request) { + try{ + if(userId!=null) { + Log log = new Log(); + log.setUserId(userId); + log.setOperation(moduleName); + log.setClientIp(getLocalIp(request)); + log.setCreateTime(new Date()); + Byte status = 0; + log.setStatus(status); + log.setContent(content); + log.setTenantId(tenantId); + logMapperEx.insertLogWithUserId(log); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } +} diff --git a/service/src/main/java/com/wansensoft/service/material/MaterialComponent.java b/service/src/main/java/com/wansensoft/service/material/MaterialComponent.java new file mode 100644 index 00000000..99310d2d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/material/MaterialComponent.java @@ -0,0 +1,96 @@ +package com.wansensoft.service.material; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service(value = "material_component") +@MaterialResource +public class MaterialComponent implements ICommonQuery { + + private final MaterialService materialService; + + public MaterialComponent(MaterialService materialService) { + this.materialService = materialService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return materialService.getMaterial(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String categoryId = StringUtil.getInfo(search, "categoryId"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + String color = StringUtil.getInfo(search, "color"); + String materialOther = StringUtil.getInfo(search, "materialOther"); + String weight = StringUtil.getInfo(search, "weight"); + String expiryNum = StringUtil.getInfo(search, "expiryNum"); + String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber"); + String enableBatchNumber = StringUtil.getInfo(search, "enableBatchNumber"); + String position = StringUtil.getInfo(search, "position"); + String enabled = StringUtil.getInfo(search, "enabled"); + String remark = StringUtil.getInfo(search, "remark"); + String mpList = StringUtil.getInfo(search, "mpList"); + return materialService.select(materialParam, color, materialOther, weight, expiryNum, + enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String categoryId = StringUtil.getInfo(search, "categoryId"); + String materialParam = StringUtil.getInfo(search, "materialParam"); + String color = StringUtil.getInfo(search, "color"); + String materialOther = StringUtil.getInfo(search, "materialOther"); + String weight = StringUtil.getInfo(search, "weight"); + String expiryNum = StringUtil.getInfo(search, "expiryNum"); + String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber"); + String enableBatchNumber = StringUtil.getInfo(search, "enableBatchNumber"); + String position = StringUtil.getInfo(search, "position"); + String enabled = StringUtil.getInfo(search, "enabled"); + String remark = StringUtil.getInfo(search, "remark"); + String mpList = StringUtil.getInfo(search, "mpList"); + return materialService.countMaterial(materialParam, color, materialOther, weight, expiryNum, + enableSerialNumber, enableBatchNumber, position, enabled, remark, categoryId, mpList); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialService.insertMaterial(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialService.updateMaterial(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialService.deleteMaterial(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialService.batchDeleteMaterial(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/material/MaterialResource.java b/service/src/main/java/com/wansensoft/service/material/MaterialResource.java new file mode 100644 index 00000000..6052bea5 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/material/MaterialResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.material; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "material") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialResource { +} diff --git a/service/src/main/java/com/wansensoft/service/material/MaterialService.java b/service/src/main/java/com/wansensoft/service/material/MaterialService.java new file mode 100644 index 00000000..3e1fd467 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/material/MaterialService.java @@ -0,0 +1,141 @@ +package com.wansensoft.service.material; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.material.*; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.user.User; +import com.wansensoft.utils.BaseResponseInfo; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jxl.Sheet; +import org.springframework.web.multipart.MultipartFile; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface MaterialService extends IService { + + Material getMaterial(long id); + + List getMaterialListByIds(String ids); + + List getMaterial(); + + List select(String materialParam, String color, String materialOther, String weight, String expiryNum, + String enableSerialNumber, String enableBatchNumber, String position, String enabled, + String remark, String categoryId, String mpList, int offset, int rows); + + Long countMaterial(String materialParam, String color, String materialOther, String weight, String expiryNum, + String enableSerialNumber, String enableBatchNumber, String position, String enabled, + String remark, String categoryId,String mpList); + + int insertMaterial(JSONObject obj, HttpServletRequest request); + + int updateMaterial(JSONObject obj, HttpServletRequest request); + + int deleteMaterial(Long id, HttpServletRequest request); + + int batchDeleteMaterial(String ids, HttpServletRequest request); + + int batchDeleteMaterialByIds(String ids); + + int checkIsNameExist(Long id, String name); + + int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs, + String otherField1, String otherField2, String otherField3, String unit, Long unitId); + + int batchSetStatus(Boolean status, String ids); + + Unit findUnit(Long mId); + + List findById(Long id); + + List findByIdWithBarCode(Long meId); + + List getListByParentId(Long parentId); + + List getIdListByParentId(List idList, Long parentId); + + JSONArray getMaterialByParam(String materialParam); + + List findBySelectWithBarCode(Long categoryId, String q, String enableSerialNumber, + String enableBatchNumber, Integer offset, Integer rows); + + int findBySelectWithBarCodeCount(Long categoryId, String q, String enableSerialNumber, + String enableBatchNumber); + + void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight, + String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber, + String remark, HttpServletResponse response); + + BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request); + + void batchCheckExistMaterialListByParam(List mList, String name, String standard, + String model, String color, String unit, String sku); + + void batchCheckExistBarCodeByParam(List mList, + String barCode, String manyBarCode); + + void insertOrUpdateMaterialExtend(JSONObject materialExObj, String type, String defaultFlag, Long mId, User user); + + String getBasicBarCode(MaterialWithInitStock m); + + void insertInitialStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock, BigDecimal lowSafeStock, BigDecimal highSafeStock); + + void insertCurrentStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock); + + void batchDeleteInitialStockByMaterialList(List mIdList); + + void batchDeleteCurrentStockByMaterialList(List mIdList); + + List getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows); + + Long getMaterialEnableSerialNumberCount(String q); + + BigDecimal parseBigDecimalEx(String str); + + BigDecimal parsePrice(String price, String ratio); + + BigDecimal getInitStockByMidAndDepotList(List depotList, Long materialId); + + BigDecimal getInitStock(Long materialId, Long depotId); + + BigDecimal getCurrentStockByMaterialIdAndDepotId(Long materialId, Long depotId); + + Map getCurrentStockMapByMaterialList(List list); + + MaterialInitialStock getSafeStock(Long materialId, Long depotId); + + List getMaterialByMeId(Long meId); + + String getMaxBarCode(); + + List getMaterialNameList(); + + List getMaterialByBarCode(String barCode); + + List getMaterialByBarCodeAndWithOutMId(String barCode, Long mId); + + List getInitialStockWithMaterial(List depotList); + + List getListWithStock(List depotList, List idList, String position, String materialParam, Integer zeroStock, + String column, String order, Integer offset, Integer rows); + + int getListWithStockCount(List depotList, List idList, String position, String materialParam, Integer zeroStock); + + MaterialVo4Unit getTotalStockAndPrice(List depotList, List idList, String position, String materialParam); + + String getBigUnitStock(BigDecimal stock, Long unitId); + + String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m); + + int batchSetMaterialCurrentStock(String ids); + + int batchUpdate(JSONObject jsonObject); + + MaterialExtend getMaterialExtendBySerialNumber(String serialNumber); +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/material/MaterialServiceImpl.java b/service/src/main/java/com/wansensoft/service/material/MaterialServiceImpl.java new file mode 100644 index 00000000..bca74306 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/material/MaterialServiceImpl.java @@ -0,0 +1,1383 @@ +package com.wansensoft.service.material; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.depot.Depot; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.material.*; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.depot.DepotItemMapperEx; +import com.wansensoft.service.depot.DepotService; +import com.wansensoft.service.depotItem.DepotItemService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.materialCategory.MaterialCategoryService; +import com.wansensoft.service.materialExtend.MaterialExtendService; +import com.wansensoft.service.unit.UnitService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.material.*; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ExcelUtils; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.MaterialVoSearch; +import jxl.Sheet; +import jxl.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + +@Service +public class MaterialServiceImpl extends ServiceImpl implements MaterialService{ + private Logger logger = LoggerFactory.getLogger(MaterialServiceImpl.class); + + private final MaterialMapper materialMapper; + private final MaterialExtendMapper materialExtendMapper; + private final MaterialMapperEx materialMapperEx; + private final MaterialCategoryMapperEx materialCategoryMapperEx; + private final MaterialExtendMapperEx materialExtendMapperEx; + private final LogService logService; + private final UserService userService; + private final DepotItemMapperEx depotItemMapperEx; + private final DepotItemService depotItemService; + private final MaterialCategoryService materialCategoryService; + private final UnitService unitService; + private final MaterialInitialStockMapper materialInitialStockMapper; + private final MaterialInitialStockMapperEx materialInitialStockMapperEx; + private final MaterialCurrentStockMapper materialCurrentStockMapper; + private final MaterialCurrentStockMapperEx materialCurrentStockMapperEx; + private final DepotService depotService; + private final MaterialExtendService materialExtendService; + + @Value(value="${file.uploadType}") + private Long fileUploadType; + + public MaterialServiceImpl(MaterialMapper materialMapper, MaterialExtendMapper materialExtendMapper, MaterialMapperEx materialMapperEx, MaterialCategoryMapperEx materialCategoryMapperEx, MaterialExtendMapperEx materialExtendMapperEx, LogService logService, UserService userService, DepotItemMapperEx depotItemMapperEx, DepotItemService depotItemService, MaterialCategoryService materialCategoryService, UnitService unitService, MaterialInitialStockMapper materialInitialStockMapper, MaterialInitialStockMapperEx materialInitialStockMapperEx, MaterialCurrentStockMapper materialCurrentStockMapper, MaterialCurrentStockMapperEx materialCurrentStockMapperEx, DepotService depotService, MaterialExtendService materialExtendService) { + this.materialMapper = materialMapper; + this.materialExtendMapper = materialExtendMapper; + this.materialMapperEx = materialMapperEx; + this.materialCategoryMapperEx = materialCategoryMapperEx; + this.materialExtendMapperEx = materialExtendMapperEx; + this.logService = logService; + this.userService = userService; + this.depotItemMapperEx = depotItemMapperEx; + this.depotItemService = depotItemService; + this.materialCategoryService = materialCategoryService; + this.unitService = unitService; + this.materialInitialStockMapper = materialInitialStockMapper; + this.materialInitialStockMapperEx = materialInitialStockMapperEx; + this.materialCurrentStockMapper = materialCurrentStockMapper; + this.materialCurrentStockMapperEx = materialCurrentStockMapperEx; + this.depotService = depotService; + this.materialExtendService = materialExtendService; + } + + public Material getMaterial(long id) { + Material result=null; + try{ + result=materialMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdIn(idList); + list = materialMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getMaterial() { + MaterialExample example = new MaterialExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=materialMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String materialParam, String color, String materialOther, String weight, String expiryNum, + String enableSerialNumber, String enableBatchNumber, String position, String enabled, + String remark, String categoryId, String mpList, int offset, int rows) { + String[] mpArr = new String[]{}; + if(StringUtil.isNotEmpty(mpList)){ + mpArr= mpList.split(","); + } + List resList = new ArrayList<>(); + List list =null; + try{ + List idList = new ArrayList<>(); + if(StringUtil.isNotEmpty(categoryId)){ + idList = getListByParentId(Long.parseLong(categoryId)); + } + list= materialMapperEx.selectByConditionMaterial(materialParam, color, materialOther, weight, expiryNum, + enableSerialNumber, enableBatchNumber, position, enabled, remark, idList, mpList, offset, rows); + if (null != list && list.size()>0) { + Map currentStockMap = getCurrentStockMapByMaterialList(list); + for (MaterialVo4Unit m : list) { + if(fileUploadType == 2) { + m.setImgSmall("small"); + m.setImgLarge("large"); + } + m.setMaterialOther(getMaterialOtherByParam(mpArr, m)); + m.setStock(currentStockMap.get(m.getId())!=null? currentStockMap.get(m.getId()): BigDecimal.ZERO); + m.setBigUnitStock(getBigUnitStock(m.getStock(), m.getUnitId())); + resList.add(m); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + public Long countMaterial(String materialParam, String color, String materialOther, String weight, String expiryNum, + String enableSerialNumber, String enableBatchNumber, String position, String enabled, + String remark, String categoryId,String mpList) { + Long result =null; + try{ + List idList = new ArrayList<>(); + if(StringUtil.isNotEmpty(categoryId)){ + idList = getListByParentId(Long.parseLong(categoryId)); + } + result= materialMapperEx.countsByMaterial(materialParam, color, materialOther, weight, expiryNum, + enableSerialNumber, enableBatchNumber, position, enabled, remark, idList, mpList); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterial(JSONObject obj, HttpServletRequest request) { + Material m = JSONObject.parseObject(obj.toJSONString(), Material.class); + m.setEnabled(true); + try{ + materialMapperEx.insertSelectiveEx(m); + Long mId = m.getId(); + materialExtendService.saveDetials(obj, obj.getString("sortList"), mId, "insert"); + if(obj.get("stock")!=null) { + JSONArray stockArr = obj.getJSONArray("stock"); + for (int i = 0; i < stockArr.size(); i++) { + JSONObject jsonObj = stockArr.getJSONObject(i); + if(jsonObj.get("id")!=null && jsonObj.get("initStock")!=null) { + String number = jsonObj.getString("initStock"); + BigDecimal lowSafeStock = null; + BigDecimal highSafeStock = null; + if(jsonObj.get("lowSafeStock")!=null) { + lowSafeStock = jsonObj.getBigDecimal("lowSafeStock"); + } + if(jsonObj.get("highSafeStock")!=null) { + highSafeStock = jsonObj.getBigDecimal("highSafeStock"); + } + Long depotId = jsonObj.getLong("id"); + if(StringUtil.isNotEmpty(number) && Double.parseDouble(number)>0 || lowSafeStock!=null || highSafeStock!=null) { + insertInitialStockByMaterialAndDepot(depotId, mId, parseBigDecimalEx(number), lowSafeStock, highSafeStock); + insertCurrentStockByMaterialAndDepot(depotId, mId, parseBigDecimalEx(number)); + } + } + } + } + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_ADD + m.getName(), request); + return 1; + } + catch (BusinessRunTimeException ex) { + throw new BusinessRunTimeException(ex.getCode(), ex.getMessage()); + } + catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterial(JSONObject obj, HttpServletRequest request) { + Material material = JSONObject.parseObject(obj.toJSONString(), Material.class); + try{ + materialMapper.updateByPrimaryKeySelective(material); + if(material.getUnitId() == null) { + materialMapperEx.setUnitIdToNull(material.getId()); + } + if(material.getExpiryNum() == null) { + materialMapperEx.setExpiryNumToNull(material.getId()); + } + materialExtendService.saveDetials(obj, obj.getString("sortList"),material.getId(), "update"); + if(obj.get("stock")!=null) { + JSONArray stockArr = obj.getJSONArray("stock"); + for (int i = 0; i < stockArr.size(); i++) { + JSONObject jsonObj = stockArr.getJSONObject(i); + if (jsonObj.get("id") != null && jsonObj.get("initStock") != null) { + String number = jsonObj.getString("initStock"); + BigDecimal lowSafeStock = null; + BigDecimal highSafeStock = null; + if(jsonObj.get("lowSafeStock")!=null) { + lowSafeStock = jsonObj.getBigDecimal("lowSafeStock"); + } + if(jsonObj.get("highSafeStock")!=null) { + highSafeStock = jsonObj.getBigDecimal("highSafeStock"); + } + Long depotId = jsonObj.getLong("id"); + //初始库存-先清除再插入 + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(material.getId()).andDepotIdEqualTo(depotId); + materialInitialStockMapper.deleteByExample(example); + if (StringUtil.isNotEmpty(number) || lowSafeStock!=null || highSafeStock!=null) { + insertInitialStockByMaterialAndDepot(depotId, material.getId(), parseBigDecimalEx(number), lowSafeStock, highSafeStock); + } + //更新当前库存 + depotItemService.updateCurrentStockFun(material.getId(), depotId); + } + } + } + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + material.getName(), request); + return 1; + }catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterial(Long id, HttpServletRequest request) { + return batchDeleteMaterialByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterial(String ids, HttpServletRequest request) { + return batchDeleteMaterialByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialByIds(String ids) { + String [] idArray=ids.split(","); + //校验单据子表 jsh_depot_item + List depotItemList =null; + try{ + depotItemList= depotItemMapperEx.getDepotItemListListByMaterialIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(depotItemList!=null&&depotItemList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,MaterialIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getMaterialListByIds(ids); + for(Material material: list){ + sb.append("[").append(material.getName()).append("]"); + } + logService.insertLog("商品", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + //逻辑删除商品 + materialMapperEx.batchDeleteMaterialByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + //逻辑删除商品价格扩展 + materialExtendMapperEx.batchDeleteMaterialExtendByMIds(idArray); + return 1; + }catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + public int checkIsNameExist(Long id, String name) { + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list= materialMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public int checkIsExist(Long id, String name, String model, String color, String standard, String mfrs, + String otherField1, String otherField2, String otherField3, String unit, Long unitId) { + return materialMapperEx.checkIsExist(id, name, model, color, standard, mfrs, otherField1, + otherField2, otherField3, unit, unitId); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List materialIds = StringUtil.strToLongList(ids); + Material material = new Material(); + material.setEnabled(status); + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdIn(materialIds); + int result =0; + try{ + result= materialMapper.updateByExampleSelective(material, example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public Unit findUnit(Long mId){ + Unit unit = new Unit(); + try{ + List list = materialMapperEx.findUnitList(mId); + if(list!=null && !list.isEmpty()) { + unit = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return unit; + } + + public List findById(Long id) { + List list =null; + try{ + list= materialMapperEx.findById(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByIdWithBarCode(Long meId) { + List list =null; + try{ + list= materialMapperEx.findByIdWithBarCode(meId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getListByParentId(Long parentId) { + List idList = new ArrayList(); + List list = materialCategoryMapperEx.getListByParentId(parentId); + idList.add(parentId); + if(list!=null && list.size()>0) { + getIdListByParentId(idList, parentId); + } + return idList; + } + + public List getIdListByParentId(List idList, Long parentId) { + List list = materialCategoryMapperEx.getListByParentId(parentId); + if(list!=null && list.size()>0) { + for(MaterialCategory mc : list){ + idList.add(mc.getId()); + getIdListByParentId(idList, mc.getId()); + } + } + return idList; + } + + public JSONArray getMaterialByParam(String materialParam) { + JSONArray arr = new JSONArray(); + List list = materialMapperEx.getMaterialByParam(materialParam); + for(MaterialVoSearch item: list) { + JSONObject obj = new JSONObject(); + StringBuilder sb = new StringBuilder(); + sb.append(item.getBarCode()); + sb.append("_").append(item.getName()); + if(StringUtil.isNotEmpty(item.getStandard())) { + sb.append("(").append(item.getStandard()).append(")"); + } + if(StringUtil.isNotEmpty(item.getModel())) { + sb.append("(").append(item.getModel()).append(")"); + } + if(StringUtil.isNotEmpty(item.getColor())) { + sb.append("(").append(item.getColor()).append(")"); + } + if(StringUtil.isNotEmpty(item.getUnit())) { + sb.append("(").append(item.getUnit()).append(")"); + } + obj.put("barCode", item.getBarCode()); + obj.put("materialStr", sb.toString()); + arr.add(obj); + } + return arr; + } + + public List findBySelectWithBarCode(Long categoryId, String q, String enableSerialNumber, + String enableBatchNumber, Integer offset, Integer rows) { + List list =null; + try{ + List idList = new ArrayList<>(); + if(categoryId!=null){ + Long parentId = categoryId; + idList = getListByParentId(parentId); + } + if(StringUtil.isNotEmpty(q)) { + q = q.replace("'", ""); + q = q.trim(); + } + list= materialMapperEx.findBySelectWithBarCode(idList, q, enableSerialNumber, enableBatchNumber, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public int findBySelectWithBarCodeCount(Long categoryId, String q, String enableSerialNumber, + String enableBatchNumber) { + int result=0; + try{ + List idList = new ArrayList<>(); + if(categoryId!=null){ + Long parentId = categoryId; + idList = getListByParentId(parentId); + } + if(StringUtil.isNotEmpty(q)) { + q = q.replace("'", ""); + } + result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, enableSerialNumber, enableBatchNumber); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public void exportExcel(String categoryId, String materialParam, String color, String materialOther, String weight, + String expiryNum, String enabled, String enableSerialNumber, String enableBatchNumber, + String remark, HttpServletResponse response) { + List idList = new ArrayList<>(); + if(StringUtil.isNotEmpty(categoryId)){ + idList = getListByParentId(Long.parseLong(categoryId)); + } + //查询商品主条码相关列表 + List dataList = materialMapperEx.exportExcel(materialParam, color, materialOther, weight, expiryNum, enabled, enableSerialNumber, + enableBatchNumber, remark, idList); + //查询商品副条码相关列表 + Map otherMaterialMap = new HashMap<>(); + List otherDataList = materialMapperEx.getOtherMaterialList(); + for(MaterialExtend me: otherDataList) { + otherMaterialMap.put(me.getMaterialId(), me); + } + String nameStr = "名称*,规格,型号,颜色,类别,基础重量(kg),保质期(天),基本单位*,副单位,基本条码*,副条码,比例,多属性," + + "采购价,零售价,销售价,最低售价,状态*,序列号,批号,仓位货架,制造商,自定义1,自定义2,自定义3,备注"; + List nameList = StringUtil.strToStringList(nameStr); + //仓库列表 + List depotList = depotService.getAllList(); + if (nameList != null) { + for(Depot depot: depotList) { + nameList.add(depot.getName()); + } + } + //期初库存缓存 + List misList = materialInitialStockMapperEx.getListExceptZero(); + Map misMap = new HashMap<>(); + if (misList != null) { + for (MaterialInitialStock mis : misList) { + misMap.put(mis.getMaterialId() + "_" + mis.getDepotId(), mis.getNumber()); + } + } + String[] names = StringUtil.listToStringArray(nameList); + String title = "商品信息"; + List objects = new ArrayList<>(); + if (null != dataList) { + for (MaterialVo4Unit m : dataList) { + String[] objs = new String[100]; + objs[0] = m.getName(); + objs[1] = m.getStandard(); + objs[2] = m.getModel(); + objs[3] = m.getColor(); + objs[4] = m.getCategoryName(); + objs[5] = m.getWeight() == null ? "" : m.getWeight().setScale(3, BigDecimal.ROUND_HALF_UP).toString(); + objs[6] = m.getExpiryNum() == null ? "" : m.getExpiryNum().toString(); + objs[7] = m.getCommodityUnit(); + objs[8] = otherMaterialMap.get(m.getId()) == null ? "" : otherMaterialMap.get(m.getId()).getCommodityUnit(); + objs[9] = m.getMBarCode(); + objs[10] = otherMaterialMap.get(m.getId()) == null ? "" : otherMaterialMap.get(m.getId()).getBarCode(); + objs[11] = m.getRatio() == null ? "" : m.getRatio().toString(); + objs[12] = m.getSku(); + objs[13] = m.getPurchaseDecimal() == null ? "" : m.getPurchaseDecimal().setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + objs[14] = m.getCommodityDecimal() == null ? "" : m.getCommodityDecimal().setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + objs[15] = m.getWholesaleDecimal() == null ? "" : m.getWholesaleDecimal().setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + objs[16] = m.getLowDecimal() == null ? "" : m.getLowDecimal().setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + objs[17] = m.getEnabled() ? "1" : "0"; + objs[18] = m.getEnableSerialNumber(); + objs[19] = m.getEnableBatchNumber(); + objs[20] = m.getPosition(); + objs[21] = m.getMfrs(); + objs[22] = m.getOtherField1(); + objs[23] = m.getOtherField2(); + objs[24] = m.getOtherField3(); + objs[25] = m.getRemark(); + //仓库期初库存 + int i = 26; + for(Depot depot: depotList) { + BigDecimal number = misMap.get(m.getId() + "_" + depot.getId()); + objs[i] = number == null ? "0" : number.setScale(2, BigDecimal.ROUND_HALF_UP).toString(); + i++; + } + objects.add(objs); + } + } + try { + File file = ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + ExcelUtils.downloadExcel(file, file.getName(), response); + }catch (Exception e) { + e.printStackTrace(); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BaseResponseInfo importExcel(MultipartFile file, HttpServletRequest request) { + BaseResponseInfo info = new BaseResponseInfo(); + try { + Long beginTime = System.currentTimeMillis(); + //文件扩展名只能为xls + String fileName = file.getOriginalFilename(); + if(StringUtil.isNotEmpty(fileName)) { + String fileExt = fileName.substring(fileName.indexOf(".")+1); + if(!"xls".equals(fileExt)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXTENSION_ERROR_CODE, + ExceptionConstants.MATERIAL_EXTENSION_ERROR_MSG); + } + } + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //获取真实的行数,剔除掉空白行 + int rightRows = ExcelUtils.getRightRows(src); + List depotList= depotService.getDepot(); + int depotCount = depotList.size(); + Map depotMap = parseDepotToMap(depotList); + User user = userService.getCurrentUser(); + List mList = new ArrayList<>(); + //单次导入超出1000条 + if(rightRows > 1002) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_IMPORT_OVER_LIMIT_CODE, + String.format(ExceptionConstants.MATERIAL_IMPORT_OVER_LIMIT_MSG)); + } + for (int i = 2; i < rightRows; i++) { + String name = ExcelUtils.getContent(src, i, 0); //名称 + String standard = ExcelUtils.getContent(src, i, 1); //规格 + String model = ExcelUtils.getContent(src, i, 2); //型号 + String color = ExcelUtils.getContent(src, i, 3); //颜色 + String categoryName = ExcelUtils.getContent(src, i, 4); //类别 + String weight = ExcelUtils.getContent(src, i, 5); //基础重量(kg) + String expiryNum = ExcelUtils.getContent(src, i, 6); //保质期(天) + String unit = ExcelUtils.getContent(src, i, 7); //基本单位 + //名称为空 + if(StringUtil.isEmpty(name)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NAME_EMPTY_CODE, + String.format(ExceptionConstants.MATERIAL_NAME_EMPTY_MSG, i+1)); + } + //名称长度超出 + if(name.length()>100) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NAME_OVER_CODE, + String.format(ExceptionConstants.MATERIAL_NAME_OVER_MSG, i+1)); + } + //规格长度超出 + if(StringUtil.isNotEmpty(standard) && standard.length()>100) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STANDARD_OVER_CODE, + String.format(ExceptionConstants.MATERIAL_STANDARD_OVER_MSG, i+1)); + } + //型号长度超出 + if(StringUtil.isNotEmpty(model) && model.length()>100) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_MODEL_OVER_CODE, + String.format(ExceptionConstants.MATERIAL_MODEL_OVER_MSG, i+1)); + } + //基本单位为空 + if(StringUtil.isEmpty(unit)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_EMPTY_CODE, + String.format(ExceptionConstants.MATERIAL_UNIT_EMPTY_MSG, i+1)); + } + MaterialWithInitStock m = new MaterialWithInitStock(); + m.setName(name); + m.setStandard(standard); + m.setModel(model); + m.setColor(color); + Long categoryId = materialCategoryService.getCategoryIdByName(categoryName); + if(null!=categoryId){ + m.setCategoryId(categoryId); + } + if(StringUtil.isNotEmpty(weight)) { + //校验基础重量是否是数字(含小数) + if(!StringUtil.isPositiveBigDecimal(weight)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_WEIGHT_NOT_DECIMAL_CODE, + String.format(ExceptionConstants.MATERIAL_WEIGHT_NOT_DECIMAL_MSG, i+1)); + } + m.setWeight(new BigDecimal(weight)); + } + if(StringUtil.isNotEmpty(expiryNum)) { + //校验保质期是否是正整数 + if(!StringUtil.isPositiveLong(expiryNum)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXPIRY_NUM_NOT_INTEGER_CODE, + String.format(ExceptionConstants.MATERIAL_EXPIRY_NUM_NOT_INTEGER_MSG, i+1)); + } + m.setExpiryNum(Integer.parseInt(expiryNum)); + } + String manyUnit = ExcelUtils.getContent(src, i, 8); //副单位 + String barCode = ExcelUtils.getContent(src, i, 9); //基础条码 + String manyBarCode = ExcelUtils.getContent(src, i, 10); //副条码 + String ratio = ExcelUtils.getContent(src, i, 11); //比例 + String sku = ExcelUtils.getContent(src, i, 12); //多属性 + String purchaseDecimal = ExcelUtils.getContent(src, i, 13); //采购价 + String commodityDecimal = ExcelUtils.getContent(src, i, 14); //零售价 + String wholesaleDecimal = ExcelUtils.getContent(src, i, 15); //销售价 + String lowDecimal = ExcelUtils.getContent(src, i, 16); //最低售价 + String enabled = ExcelUtils.getContent(src, i, 17); //状态 + String enableSerialNumber = ExcelUtils.getContent(src, i, 18); //序列号 + String enableBatchNumber = ExcelUtils.getContent(src, i, 19); //批号 + String position = ExcelUtils.getContent(src, i, 20); //仓位货架 + String mfrs = ExcelUtils.getContent(src, i, 21); //制造商 + String otherField1 = ExcelUtils.getContent(src, i, 22); //自定义1 + String otherField2 = ExcelUtils.getContent(src, i, 23); //自定义2 + String otherField3 = ExcelUtils.getContent(src, i, 24); //自定义3 + String remark = ExcelUtils.getContent(src, i, 25); //备注 + m.setPosition(StringUtil.isNotEmpty(position)?position:null); + m.setMfrs(StringUtil.isNotEmpty(mfrs)?mfrs:null); + m.setOtherField1(StringUtil.isNotEmpty(otherField1)?otherField1:null); + m.setOtherField2(StringUtil.isNotEmpty(otherField2)?otherField2:null); + m.setOtherField3(StringUtil.isNotEmpty(otherField3)?otherField3:null); + m.setRemark(remark); + //状态格式错误 + if(!"1".equals(enabled) && !"0".equals(enabled)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLED_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_ENABLED_ERROR_MSG, i+1)); + } + //校验基础条码长度为4到40位 + if(!StringUtil.checkBarCodeLength(barCode)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, barCode)); + } + //校验副条码长度为4到40位 + if(StringUtil.isNotEmpty(manyBarCode) && !StringUtil.checkBarCodeLength(manyBarCode)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, manyBarCode)); + } + // 批量校验excel中有无重复商品,是指名称、规格、型号、颜色、单位、多属性 + batchCheckExistMaterialListByParam(mList, name, standard, model, color, unit, sku); + //批量校验excel中有无重复条码 + batchCheckExistBarCodeByParam(mList, barCode, manyBarCode); + JSONObject materialExObj = new JSONObject(); + JSONObject basicObj = new JSONObject(); + basicObj.put("barCode", barCode); + basicObj.put("commodityUnit", unit); + basicObj.put("sku", sku); + basicObj.put("purchaseDecimal", purchaseDecimal); + basicObj.put("commodityDecimal", commodityDecimal); + basicObj.put("wholesaleDecimal", wholesaleDecimal); + basicObj.put("lowDecimal", lowDecimal); + materialExObj.put("basic", basicObj); + if(StringUtil.isNotEmpty(manyUnit) && StringUtil.isNotEmpty(ratio)){ //多单位 + //校验比例是否是数字(含小数) + if(!StringUtil.isPositiveBigDecimal(ratio.trim())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_RATIO_NOT_INTEGER_CODE, + String.format(ExceptionConstants.MATERIAL_RATIO_NOT_INTEGER_MSG, i+1)); + } + Long unitId = unitService.getUnitIdByParam(unit, manyUnit, new BigDecimal(ratio.trim())); + if(unitId != null) { + m.setUnitId(unitId); + } else { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_MATE_CODE, + String.format(ExceptionConstants.MATERIAL_UNIT_MATE_MSG, manyBarCode)); + } + JSONObject otherObj = new JSONObject(); + otherObj.put("barCode", manyBarCode); + otherObj.put("commodityUnit", manyUnit); + otherObj.put("purchaseDecimal", parsePrice(purchaseDecimal,ratio)); + otherObj.put("commodityDecimal", parsePrice(commodityDecimal,ratio)); + otherObj.put("wholesaleDecimal", parsePrice(wholesaleDecimal,ratio)); + otherObj.put("lowDecimal", parsePrice(lowDecimal,ratio)); + materialExObj.put("other", otherObj); + } else { + m.setUnit(unit); + } + m.setMaterialExObj(materialExObj); + m.setEnabled("1".equals(enabled)); + if(StringUtil.isNotEmpty(enableSerialNumber) && "1".equals(enableSerialNumber)) { + m.setEnableSerialNumber("1"); + } else { + m.setEnableSerialNumber("0"); + } + if(StringUtil.isNotEmpty(enableBatchNumber) && "1".equals(enableBatchNumber)) { + m.setEnableBatchNumber("1"); + } else { + m.setEnableBatchNumber("0"); + } + if("1".equals(enableSerialNumber) && "1".equals(enableBatchNumber)) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_CODE, + String.format(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_MSG, barCode)); + } + m.setStockMap(getStockMapCache(src, depotCount, depotMap, i)); + mList.add(m); + } + List deleteInitialStockMaterialIdList = new ArrayList<>(); + List deleteCurrentStockMaterialIdList = new ArrayList<>(); + List insertInitialStockMaterialList = new ArrayList<>(); + List insertCurrentStockMaterialList = new ArrayList<>(); + //防止初始库存和当前库存出现重复 + Map materialDepotInitialMap = new HashMap<>(); + Map materialDepotCurrentMap = new HashMap<>(); + for(MaterialWithInitStock m: mList) { + Long mId = 0L; + //判断该商品是否存在,如果不存在就新增,如果存在就更新 + String basicBarCode = getBasicBarCode(m); + List materials = getMaterialListByParam(m.getName(),m.getStandard(),m.getModel(),m.getColor(),m.getUnit(),m.getUnitId(), basicBarCode); + if(materials.isEmpty()) { + materialMapperEx.insertSelectiveEx(m); + mId = m.getId(); + } else { + mId = materials.get(0).getId(); + String materialJson = JSON.toJSONString(m); + Material material = JSONObject.parseObject(materialJson, Material.class); + material.setId(mId); + materialMapper.updateByPrimaryKeySelective(material); + } + //给商品新增或更新条码与价格相关信息 + JSONObject materialExObj = m.getMaterialExObj(); + insertOrUpdateMaterialExtend(materialExObj, "basic", "1", mId, user); + insertOrUpdateMaterialExtend(materialExObj, "other", "0", mId, user); + //给商品更新库存 + Map stockMap = m.getStockMap(); + for(Depot depot: depotList){ + Long depotId = depot.getId(); + String materialDepotKey = mId + "_" + depotId; + BigDecimal stock = stockMap.get(depot.getId()); + //新增初始库存 + if(stock!=null && stock.compareTo(BigDecimal.ZERO)!=0) { + String basicStr = materialExObj.getString("basic"); + MaterialExtend materialExtend = JSONObject.parseObject(basicStr, MaterialExtend.class); + if(StringUtil.isNotEmpty(materialExtend.getSku())) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE, + String.format(ExceptionConstants.MATERIAL_SKU_BEGIN_STOCK_FAILED_MSG, materialExtend.getBarCode())); + } + if(materialDepotInitialMap.get(materialDepotKey)==null) { + MaterialInitialStock materialInitialStock = new MaterialInitialStock(); + materialInitialStock.setMaterialId(mId); + materialInitialStock.setDepotId(depotId); + materialInitialStock.setNumber(stock); + insertInitialStockMaterialList.add(materialInitialStock); + deleteInitialStockMaterialIdList.add(mId); + materialDepotInitialMap.put(materialDepotKey, materialDepotKey); + } + } + //新增或更新当前库存 + Long billCount = depotItemService.getCountByMaterialAndDepot(mId, depotId); + if(billCount == 0) { + if(stock!=null && stock.compareTo(BigDecimal.ZERO)!=0) { + if(materialDepotCurrentMap.get(materialDepotKey)==null) { + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setDepotId(depotId); + materialCurrentStock.setCurrentNumber(stock); + insertCurrentStockMaterialList.add(materialCurrentStock); + deleteCurrentStockMaterialIdList.add(mId); + materialDepotCurrentMap.put(materialDepotKey, materialDepotKey); + } + } + } else { + BigDecimal initStock = getInitStock(mId, depotId); + BigDecimal currentNumber = getCurrentStockByMaterialIdAndDepotId(mId, depotId); + //当前库存的更新:减去初始库存,再加上导入的新初始库存 + if(currentNumber!=null && initStock!=null && stock!=null) { + currentNumber = currentNumber.subtract(initStock).add(stock); + } + if(materialDepotCurrentMap.get(materialDepotKey)==null) { + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setDepotId(depotId); + materialCurrentStock.setCurrentNumber(currentNumber); + insertCurrentStockMaterialList.add(materialCurrentStock); + deleteCurrentStockMaterialIdList.add(mId); + materialDepotCurrentMap.put(materialDepotKey, materialDepotKey); + } + } + } + } + //批量更新库存,先删除后新增 + if(!insertInitialStockMaterialList.isEmpty()) { + batchDeleteInitialStockByMaterialList(deleteInitialStockMaterialIdList); + materialInitialStockMapperEx.batchInsert(insertInitialStockMaterialList); + } + if(!insertCurrentStockMaterialList.isEmpty()) { + batchDeleteCurrentStockByMaterialList(deleteCurrentStockMaterialIdList); + materialCurrentStockMapperEx.batchInsert(insertCurrentStockMaterialList); + } + logService.insertLog("商品", + BusinessConstants.LOG_OPERATION_TYPE_IMPORT + mList.size() + BusinessConstants.LOG_DATA_UNIT, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + Long endTime = System.currentTimeMillis(); + logger.info("导入耗时:{}", endTime-beginTime); + info.code = 200; + info.data = "导入成功"; + } catch (BusinessRunTimeException e) { + info.code = e.getCode(); + info.data = e.getData().get("message"); + } catch (Exception e) { + info.code = 500; + info.data = "导入失败"; + } + return info; + } + + private Map parseDepotToMap(List depotList) { + Map map = new HashMap<>(); + for(Depot depot: depotList) { + map.put(depot.getName(), depot.getId()); + } + return map; + } + + /** + * 缓存各个仓库的库存信息 + * @param src + * @param depotCount + * @param depotMap + * @param i + * @return + * @throws Exception + */ + private Map getStockMapCache(Sheet src, int depotCount, Map depotMap, int i) { + Map stockMap = new HashMap<>(); + for(int j = 1; j<= depotCount; j++) { + int col = 25 + j; + if(col < src.getColumns()){ + String depotName = ExcelUtils.getContent(src, 1, col); //获取仓库名称 + if(StringUtil.isNotEmpty(depotName)) { + Long depotId = depotMap.get(depotName); + if(depotId!=null && depotId!=0L){ + String stockStr = ExcelUtils.getContent(src, i, col); + if(StringUtil.isNotEmpty(stockStr)) { + stockMap.put(depotId, parseBigDecimalEx(stockStr)); + } + } + } + } + } + return stockMap; + } + + /** + * 批量校验excel中有无重复商品,是指名称、规格、型号、颜色、单位 + * @param mList + */ + public void batchCheckExistMaterialListByParam(List mList, String name, String standard, + String model, String color, String unit, String sku) { + for(MaterialWithInitStock material: mList){ + String materialSku = ""; + JSONObject materialExObj = material.getMaterialExObj(); + if(materialExObj!=null && materialExObj.get("basic")!=null) { + JSONObject basicObj = materialExObj.getJSONObject("basic"); + if(basicObj!=null && materialExObj.get("sku")!=null) { + materialSku = basicObj.getString("sku"); + } + } + if(name.equals(material.getName()) && + standard.equals(material.getStandard()) && + model.equals(material.getModel()) && + color.equals(material.getColor()) && + unit.equals(material.getUnit()) && + sku.equals(materialSku)) { + String info = name + "-" + standard + "-" + model + "-" + color + "-" + unit + "-" + sku; + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXCEL_IMPORT_EXIST_CODE, + String.format(ExceptionConstants.MATERIAL_EXCEL_IMPORT_EXIST_MSG, info)); + } + } + } + + /** + * 批量校验excel中有无重复条码 + * @param mList + */ + public void batchCheckExistBarCodeByParam(List mList, + String barCode, String manyBarCode) { + for(MaterialWithInitStock material: mList){ + JSONObject materialExObj = material.getMaterialExObj(); + String basicBarCode = ""; + String otherBarCode = ""; + if(materialExObj.get("basic")!=null) { + JSONObject basicObj = materialExObj.getJSONObject("basic"); + basicBarCode = basicObj.getString("barCode"); + } + if(materialExObj.get("other")!=null) { + JSONObject otherObj = materialExObj.getJSONObject("other"); + otherBarCode = otherObj.getString("barCode"); + } + if(barCode.equals(basicBarCode) || barCode.equals(otherBarCode)){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_CODE, + String.format(ExceptionConstants.MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_MSG, barCode)); + } + if(StringUtil.isNotEmpty(manyBarCode)) { + if(manyBarCode.equals(basicBarCode) || manyBarCode.equals(otherBarCode)){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_CODE, + String.format(ExceptionConstants.MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_MSG, manyBarCode)); + } + } + } + } + + /** + * 给商品新增或更新条码与价格相关信息 + * @param materialExObj + * @param type + * @param defaultFlag + * @param mId + * @param user + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void insertOrUpdateMaterialExtend(JSONObject materialExObj, String type, String defaultFlag, Long mId, User user) { + if(StringUtil.isExist(materialExObj.get(type))){ + String basicStr = materialExObj.getString(type); + MaterialExtend materialExtend = JSONObject.parseObject(basicStr, MaterialExtend.class); + materialExtend.setMaterialId(mId); + materialExtend.setDefaultFlag(defaultFlag); + materialExtend.setCreateTime(new Date()); + materialExtend.setUpdateTime(System.currentTimeMillis()); + materialExtend.setCreateSerial(user.getLoginName()); + materialExtend.setUpdateSerial(user.getLoginName()); + Long meId = 0L; + if(StringUtil.isNotEmpty(materialExtend.getSku())){ + //含sku的商品,特殊逻辑 + meId = materialExtendService.selectIdByMaterialIdAndBarCode(mId, materialExtend.getBarCode()); + List meList = materialExtendService.getListByMaterialIdAndDefaultFlagAndBarCode(mId, "1", materialExtend.getBarCode()); + if(meList.isEmpty()) { + materialExtend.setDefaultFlag("1"); + } else { + materialExtend.setDefaultFlag("0"); + } + } else { + meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, defaultFlag); + } + if(meId==0L){ + materialExtendMapper.insertSelective(materialExtend); + } else { + materialExtend.setId(meId); + materialExtendMapper.updateByPrimaryKeySelective(materialExtend); + //如果金额为空,此处单独置空 + materialExtendMapperEx.specialUpdatePrice(materialExtend); + } + } + } + + public String getBasicBarCode(MaterialWithInitStock m) { + String barCode = ""; + JSONObject materialExObj = m.getMaterialExObj(); + if(StringUtil.isExist(materialExObj.get("basic"))) { + String basicStr = materialExObj.getString("basic"); + MaterialExtend basicMaterialExtend = JSONObject.parseObject(basicStr, MaterialExtend.class); + barCode = basicMaterialExtend.getBarCode(); + } + return barCode; + } + + /** + * 根据条件返回产品列表 + * @param name + * @param standard + * @param model + * @param color + * @param unit + * @param unitId + * @return + */ + private List getMaterialListByParam(String name, String standard, String model, String color, String unit, Long unitId, String basicBarCode) { + List list = new ArrayList<>(); + MaterialExample example = new MaterialExample(); + MaterialExample.Criteria criteria = example.createCriteria(); + criteria.andNameEqualTo(name); + if (StringUtil.isNotEmpty(model)) { + criteria.andModelEqualTo(model); + } + if (StringUtil.isNotEmpty(color)) { + criteria.andColorEqualTo(color); + } + if (StringUtil.isNotEmpty(standard)) { + criteria.andStandardEqualTo(standard); + } + if (StringUtil.isNotEmpty(unit)) { + criteria.andUnitEqualTo(unit); + } + if (unitId !=null) { + criteria.andUnitIdEqualTo(unitId); + } + criteria.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = materialMapper.selectByExample(example); + if(list.isEmpty()) { + //如果通过组合条件没有查到该商品,则通过条码再查一次 + MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(basicBarCode); + if(materialExtend != null && materialExtend.getMaterialId()!=null) { + Material material = new Material(); + material.setId(materialExtend.getMaterialId()); + list.add(material); + } + } + return list; + } + + /** + * 写入初始库存 + * @param depotId + * @param mId + * @param stock + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void insertInitialStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock, BigDecimal lowSafeStock, BigDecimal highSafeStock) { + MaterialInitialStock materialInitialStock = new MaterialInitialStock(); + materialInitialStock.setDepotId(depotId); + materialInitialStock.setMaterialId(mId); + stock = stock == null? BigDecimal.ZERO: stock; + materialInitialStock.setNumber(stock); + if(lowSafeStock!=null) { + materialInitialStock.setLowSafeStock(lowSafeStock); + } + if(highSafeStock!=null) { + materialInitialStock.setHighSafeStock(highSafeStock); + } + materialInitialStockMapper.insertSelective(materialInitialStock); //存入初始库存 + } + + /** + * 写入当前库存 + * @param depotId + * @param mId + * @param stock + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void insertCurrentStockByMaterialAndDepot(Long depotId, Long mId, BigDecimal stock) { + MaterialCurrentStock materialCurrentStock = new MaterialCurrentStock(); + materialCurrentStock.setDepotId(depotId); + materialCurrentStock.setMaterialId(mId); + materialCurrentStock.setCurrentNumber(stock); + materialCurrentStockMapper.insertSelective(materialCurrentStock); //存入初始库存 + } + + /** + * 批量删除初始库存 + * @param mIdList + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void batchDeleteInitialStockByMaterialList(List mIdList) { + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdIn(mIdList); + materialInitialStockMapper.deleteByExample(example); + } + + /** + * 批量删除当前库存 + * @param mIdList + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void batchDeleteCurrentStockByMaterialList(List mIdList) { + MaterialCurrentStockExample example = new MaterialCurrentStockExample(); + example.createCriteria().andMaterialIdIn(mIdList); + materialCurrentStockMapper.deleteByExample(example); + } + + public List getMaterialEnableSerialNumberList(String q, Integer offset, Integer rows) { + List list =null; + try{ + list= materialMapperEx.getMaterialEnableSerialNumberList(q, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long getMaterialEnableSerialNumberCount(String q) { + Long count =null; + try{ + count= materialMapperEx.getMaterialEnableSerialNumberCount(q); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return count; + } + + public BigDecimal parseBigDecimalEx(String str) { + if(!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + public BigDecimal parsePrice(String price, String ratio) { + if(StringUtil.isEmpty(price) || StringUtil.isEmpty(ratio)) { + return BigDecimal.ZERO; + } else { + BigDecimal pr=new BigDecimal(price); + BigDecimal r=new BigDecimal(ratio); + return pr.multiply(r); + } + } + + /** + * 根据商品获取初始库存-多仓库 + * @param depotList + * @param materialId + * @return + */ + public BigDecimal getInitStockByMidAndDepotList(List depotList, Long materialId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialInitialStockExample example = new MaterialInitialStockExample(); + if(depotList!=null && !depotList.isEmpty()) { + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdIn(depotList) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + example.createCriteria().andMaterialIdEqualTo(materialId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list = materialInitialStockMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + for(MaterialInitialStock ms: list) { + if(ms!=null) { + stock = stock.add(ms.getNumber()); + } + } + } + return stock; + } + + /** + * 根据商品和仓库获取初始库存 + * @param materialId + * @param depotId + * @return + */ + public BigDecimal getInitStock(Long materialId, Long depotId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialInitialStockMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + stock = list.get(0).getNumber(); + } + return stock; + } + + /** + * 根据商品和仓库获取当前库存 + * @param materialId + * @param depotId + * @return + */ + public BigDecimal getCurrentStockByMaterialIdAndDepotId(Long materialId, Long depotId) { + BigDecimal stock = BigDecimal.ZERO; + MaterialCurrentStockExample example = new MaterialCurrentStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCurrentStockMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + stock = list.get(0).getCurrentNumber(); + } else { + stock = getInitStock(materialId,depotId); + } + return stock; + } + + /** + * 根据商品列表获取当前库存Map + * @param list + * @return + */ + public Map getCurrentStockMapByMaterialList(List list) { + Map map = new HashMap<>(); + List materialIdList = new ArrayList<>(); + for(MaterialVo4Unit materialVo4Unit: list) { + materialIdList.add(materialVo4Unit.getId()); + } + List mcsList = materialCurrentStockMapperEx.getCurrentStockMapByIdList(materialIdList); + for(MaterialCurrentStock materialCurrentStock: mcsList) { + map.put(materialCurrentStock.getMaterialId(), materialCurrentStock.getCurrentNumber()); + } + return map; + } + + /** + * 根据商品和仓库获取安全库存信息 + * @param materialId + * @param depotId + * @return + */ + public MaterialInitialStock getSafeStock(Long materialId, Long depotId) { + MaterialInitialStock materialInitialStock = new MaterialInitialStock(); + MaterialInitialStockExample example = new MaterialInitialStockExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDepotIdEqualTo(depotId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialInitialStockMapper.selectByExample(example); + if(list!=null && list.size()>0) { + materialInitialStock = list.get(0); + } + return materialInitialStock; + } + + public List getMaterialByMeId(Long meId) { + List result = new ArrayList(); + try{ + if(meId!=null) { + result= materialMapperEx.getMaterialByMeId(meId); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public String getMaxBarCode() { + String maxBarCodeOld = materialMapperEx.getMaxBarCode(); + if(StringUtil.isNotEmpty(maxBarCodeOld)) { + return Long.parseLong(maxBarCodeOld)+""; + } else { + return "1000"; + } + } + + public List getMaterialNameList() { + return materialMapperEx.getMaterialNameList(); + } + + public List getMaterialByBarCode(String barCode) { + String [] barCodeArray=barCode.split(","); + return materialMapperEx.getMaterialByBarCode(barCodeArray); + } + + public List getMaterialByBarCodeAndWithOutMId(String barCode, Long mId) { + String [] barCodeArray=barCode.split(","); + return materialMapperEx.getMaterialByBarCodeAndWithOutMId(barCodeArray, mId); + } + + public List getInitialStockWithMaterial(List depotList) { + return materialMapperEx.getInitialStockWithMaterial(depotList); + } + + public List getListWithStock(List depotList, List idList, String position, String materialParam, Integer zeroStock, + String column, String order, Integer offset, Integer rows) { + Map initialStockMap = new HashMap<>(); + List initialStockList = getInitialStockWithMaterial(depotList); + for (MaterialInitialStockWithMaterial mism: initialStockList) { + initialStockMap.put(mism.getMaterialId(), mism.getNumber()); + } + List dataList = materialMapperEx.getListWithStock(depotList, idList, position, materialParam, zeroStock, column, order, offset, rows); + for(MaterialVo4Unit item: dataList) { + item.setUnitName(null!=item.getUnitId()?item.getUnitName() + "[多单位]":item.getUnitName()); + item.setInitialStock(null!=initialStockMap.get(item.getId())?initialStockMap.get(item.getId()):BigDecimal.ZERO); + item.setBigUnitStock(getBigUnitStock(item.getCurrentStock(), item.getUnitId())); + if(fileUploadType == 2) { + item.setImgSmall("small"); + item.setImgLarge("large"); + } + } + return dataList; + } + + public int getListWithStockCount(List depotList, List idList, String position, String materialParam, Integer zeroStock) { + return materialMapperEx.getListWithStockCount(depotList, idList, position, materialParam, zeroStock); + } + + public MaterialVo4Unit getTotalStockAndPrice(List depotList, List idList, String position, String materialParam) { + return materialMapperEx.getTotalStockAndPrice(depotList, idList, position, materialParam); + } + + /** + * 将小单位的库存换算为大单位的库存 + * @param stock + * @param unitId + * @return + * @throws Exception + */ + public String getBigUnitStock(BigDecimal stock, Long unitId) { + String bigUnitStock = ""; + if(null!= unitId) { + Unit unit = unitService.getUnit(unitId); + if(unit.getRatio()!=null && unit.getRatio().compareTo(BigDecimal.ZERO)!=0 && stock!=null) { + bigUnitStock = stock.divide(unit.getRatio(),2,BigDecimal.ROUND_HALF_UP) + unit.getOtherUnit(); + } + } + return bigUnitStock; + } + + /** + * 构造扩展信息 + * @param mpArr + * @param m + * @return + */ + public String getMaterialOtherByParam(String[] mpArr, MaterialVo4Unit m) { + String materialOther = ""; + for (int i = 0; i < mpArr.length; i++) { + if (mpArr[i].equals("制造商")) { + materialOther = materialOther + ((m.getMfrs() == null || m.getMfrs().equals("")) ? "" : "(" + m.getMfrs() + ")"); + } + if (mpArr[i].equals("自定义1")) { + materialOther = materialOther + ((m.getOtherField1() == null || m.getOtherField1().equals("")) ? "" : "(" + m.getOtherField1() + ")"); + } + if (mpArr[i].equals("自定义2")) { + materialOther = materialOther + ((m.getOtherField2() == null || m.getOtherField2().equals("")) ? "" : "(" + m.getOtherField2() + ")"); + } + if (mpArr[i].equals("自定义3")) { + materialOther = materialOther + ((m.getOtherField3() == null || m.getOtherField3().equals("")) ? "" : "(" + m.getOtherField3() + ")"); + } + } + return materialOther; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetMaterialCurrentStock(String ids) { + int res = 0; + List idList = StringUtil.strToLongList(ids); + List depotList = depotService.getAllList(); + for(Long mId: idList) { + for(Depot depot: depotList) { + depotItemService.updateCurrentStockFun(mId, depot.getId()); + res = 1; + } + } + return res; + } + + public int batchUpdate(JSONObject jsonObject) { + String ids = jsonObject.getString("ids"); + String materialStr = jsonObject.getString("material"); + List idList = StringUtil.strToLongList(ids); + Material material = JSONObject.parseObject(materialStr, Material.class); + MaterialExample example = new MaterialExample(); + example.createCriteria().andIdIn(idList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return materialMapper.updateByExampleSelective(material, example); + } + + public MaterialExtend getMaterialExtendBySerialNumber(String serialNumber) { + return materialMapperEx.getMaterialExtendBySerialNumber(serialNumber); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeComponent.java b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeComponent.java new file mode 100644 index 00000000..b51fb6b2 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeComponent.java @@ -0,0 +1,72 @@ +package com.wansensoft.service.materialAttribute; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@MaterialAttributeResource +public class MaterialAttributeComponent implements ICommonQuery { + + private final MaterialAttributeService materialAttributeService; + + public MaterialAttributeComponent(MaterialAttributeService materialAttributeService) { + this.materialAttributeService = materialAttributeService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return materialAttributeService.getMaterialAttribute(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String attributeName = StringUtil.getInfo(search, "attributeName"); + return materialAttributeService.select(attributeName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String attributeField = StringUtil.getInfo(search, "attributeField"); + return materialAttributeService.countMaterialAttribute(attributeField); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialAttributeService.insertMaterialAttribute(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialAttributeService.updateMaterialAttribute(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialAttributeService.deleteMaterialAttribute(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialAttributeService.batchDeleteMaterialAttribute(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialAttributeService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeResource.java b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeResource.java new file mode 100644 index 00000000..a1fa54bf --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.materialAttribute; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "materialAttribute") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialAttributeResource { +} diff --git a/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeService.java b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeService.java new file mode 100644 index 00000000..e876bec0 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeService.java @@ -0,0 +1,36 @@ +package com.wansensoft.service.materialAttribute; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.material.MaterialAttribute; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface MaterialAttributeService extends IService { + + MaterialAttribute getMaterialAttribute(long id); + + List getMaterialAttribute(); + + List select(String attributeName, int offset, int rows); + + Long countMaterialAttribute(String attributeField); + + int insertMaterialAttribute(JSONObject obj, HttpServletRequest request); + + int updateMaterialAttribute(JSONObject obj, HttpServletRequest request); + + int deleteMaterialAttribute(Long id, HttpServletRequest request); + + int batchDeleteMaterialAttribute(String ids, HttpServletRequest request); + + int batchDeleteMaterialAttributeByIds(String ids); + + int checkIsNameExist(Long id, String name); + + JSONArray getValueArrById(Long id); + + MaterialAttribute getInfoById(Long id); +} diff --git a/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeServiceImpl.java b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeServiceImpl.java new file mode 100644 index 00000000..3aaaf264 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialAttribute/MaterialAttributeServiceImpl.java @@ -0,0 +1,174 @@ +package com.wansensoft.service.materialAttribute; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.material.MaterialAttribute; +import com.wansensoft.entities.material.MaterialAttributeExample; +import com.wansensoft.mappers.material.MaterialAttributeMapper; +import com.wansensoft.mappers.material.MaterialAttributeMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +@Service +public class MaterialAttributeServiceImpl extends ServiceImpl implements MaterialAttributeService{ + private Logger logger = LoggerFactory.getLogger(MaterialAttributeServiceImpl.class); + + private final LogService logService; + private final MaterialAttributeMapper materialAttributeMapper; + private final MaterialAttributeMapperEx materialAttributeMapperEx; + + public MaterialAttributeServiceImpl(LogService logService, MaterialAttributeMapper materialAttributeMapper, MaterialAttributeMapperEx materialAttributeMapperEx) { + this.logService = logService; + this.materialAttributeMapper = materialAttributeMapper; + this.materialAttributeMapperEx = materialAttributeMapperEx; + } + + public MaterialAttribute getMaterialAttribute(long id) { + MaterialAttribute result=null; + try{ + result=materialAttributeMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialAttribute() { + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list=null; + try{ + list=materialAttributeMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String attributeName, int offset, int rows) { + List list = new ArrayList<>(); + try{ + list = materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeName, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countMaterialAttribute(String attributeField) { + Long result =null; + try{ + result= 5L; + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialAttribute(JSONObject obj, HttpServletRequest request) { + MaterialAttribute m = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.insertSelective(m); + logService.insertLog("商品属性", + BusinessConstants.LOG_OPERATION_TYPE_ADD + m.getAttributeName(), request); + return 1; + } + catch (BusinessRunTimeException ex) { + throw new BusinessRunTimeException(ex.getCode(), ex.getMessage()); + } + catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialAttribute(JSONObject obj, HttpServletRequest request) { + MaterialAttribute materialAttribute = JSONObject.parseObject(obj.toJSONString(), MaterialAttribute.class); + try{ + materialAttributeMapper.updateByPrimaryKeySelective(materialAttribute); + logService.insertLog("商品属性", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + materialAttribute.getAttributeName(), request); + return 1; + }catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialAttribute(Long id, HttpServletRequest request) { + return batchDeleteMaterialAttributeByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttribute(String ids, HttpServletRequest request) { + return batchDeleteMaterialAttributeByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialAttributeByIds(String ids) { + String [] idArray=ids.split(","); + try{ + return materialAttributeMapperEx.batchDeleteMaterialAttributeByIds(idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + return 0; + } + } + + public int checkIsNameExist(Long id, String name) { + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andIdNotEqualTo(id).andAttributeNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list = materialAttributeMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public JSONArray getValueArrById(Long id) { + JSONArray valueArr = new JSONArray(); + MaterialAttribute ma = getInfoById(id); + if(ma!=null) { + String value = ma.getAttributeValue(); + if(StringUtil.isNotEmpty(value)){ + String[] arr = value.split("\\|"); + for(String v: arr) { + JSONObject item = new JSONObject(); + item.put("value",v); + item.put("name",v); + valueArr.add(item); + } + } + } + return valueArr; + } + + public MaterialAttribute getInfoById(Long id) { + MaterialAttributeExample example = new MaterialAttributeExample(); + example.createCriteria().andIdEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialAttributeMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + return list.get(0); + } else { + return null; + } + } +} diff --git a/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryComponent.java b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryComponent.java new file mode 100644 index 00000000..8de8ff16 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@MaterialCategoryResource +public class MaterialCategoryComponent implements ICommonQuery { + + private final MaterialCategoryService materialCategoryService; + + public MaterialCategoryComponent(MaterialCategoryService materialCategoryService) { + this.materialCategoryService = materialCategoryService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return materialCategoryService.getMaterialCategory(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialCategoryList(map); + } + + private List getMaterialCategoryList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer parentId = StringUtil.parseInteger(StringUtil.getInfo(search, "parentId")); + String order = QueryUtils.order(map); + return materialCategoryService.select(name, parentId, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + Integer parentId = StringUtil.parseInteger(StringUtil.getInfo(search, "parentId")); + return materialCategoryService.countMaterialCategory(name, parentId); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return materialCategoryService.insertMaterialCategory(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialCategoryService.updateMaterialCategory(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialCategoryService.deleteMaterialCategory(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialCategoryService.batchDeleteMaterialCategory(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return materialCategoryService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryResource.java b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryResource.java new file mode 100644 index 00000000..ccf21de4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.materialCategory; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "materialCategory") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialCategoryResource { +} diff --git a/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryService.java b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryService.java new file mode 100644 index 00000000..1612fbed --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryService.java @@ -0,0 +1,50 @@ +package com.wansensoft.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.material.MaterialCategory; +import com.wansensoft.vo.TreeNode; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface MaterialCategoryService extends IService { + + MaterialCategory getMaterialCategory(long id); + + List getMaterialCategoryListByIds(String ids); + + List getMaterialCategory(); + + List getAllList(Long parentId); + + List getMCList(Long parentId); + + List select(String name, Integer parentId, int offset, int rows); + + Long countMaterialCategory(String name, Integer parentId); + + int insertMaterialCategory(JSONObject obj, HttpServletRequest request); + + int updateMaterialCategory(JSONObject obj, HttpServletRequest request); + + int deleteMaterialCategory(Long id, HttpServletRequest request); + + int batchDeleteMaterialCategory(String ids, HttpServletRequest request); + + int batchDeleteMaterialCategoryByIds(String ids); + + int checkIsNameExist(Long id, String name); + + List findById(Long id); + + List getMaterialCategoryTree(Long id); + + int addMaterialCategory(MaterialCategory mc); + + int editMaterialCategory(MaterialCategory mc); + + void checkMaterialCategorySerialNo(MaterialCategory mc); + + Long getCategoryIdByName(String name); +} diff --git a/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryServiceImpl.java b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryServiceImpl.java new file mode 100644 index 00000000..9797224d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialCategory/MaterialCategoryServiceImpl.java @@ -0,0 +1,371 @@ +package com.wansensoft.service.materialCategory; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.material.MaterialCategory; +import com.wansensoft.entities.material.MaterialCategoryExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.material.MaterialCategoryMapper; +import com.wansensoft.mappers.material.MaterialCategoryMapperEx; +import com.wansensoft.mappers.material.MaterialMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.TreeNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialCategoryServiceImpl extends ServiceImpl implements MaterialCategoryService{ + private Logger logger = LoggerFactory.getLogger(MaterialCategoryServiceImpl.class); + + private final MaterialCategoryMapper materialCategoryMapper; + private final MaterialCategoryMapperEx materialCategoryMapperEx; + private final UserService userService; + private final LogService logService; + private final MaterialMapperEx materialMapperEx; + + public MaterialCategoryServiceImpl(MaterialCategoryMapper materialCategoryMapper, MaterialCategoryMapperEx materialCategoryMapperEx, UserService userService, LogService logService, MaterialMapperEx materialMapperEx) { + this.materialCategoryMapper = materialCategoryMapper; + this.materialCategoryMapperEx = materialCategoryMapperEx; + this.userService = userService; + this.logService = logService; + this.materialMapperEx = materialMapperEx; + } + + public MaterialCategory getMaterialCategory(long id) { + MaterialCategory result=null; + try{ + result=materialCategoryMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialCategoryListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdIn(idList); + list = materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getMaterialCategory() { + MaterialCategoryExample example = new MaterialCategoryExample(); + List list=null; + try{ + list=materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getAllList(Long parentId) { + List list=null; + try{ + list = getMCList(parentId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getMCList(Long parentId) { + List res= new ArrayList(); + List list=null; + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andParentIdEqualTo(parentId).andIdNotEqualTo(1L); + example.setOrderByClause("id"); + list=materialCategoryMapper.selectByExample(example); + if(list!=null && list.size()>0) { + res.addAll(list); + for(MaterialCategory mc : list) { + List mcList = getMCList(mc.getId()); + if(mcList!=null && mcList.size()>0) { + res.addAll(mcList); + } + } + } + return res; + } + + public List select(String name, Integer parentId, int offset, int rows) { + List list=null; + try{ + list=materialCategoryMapperEx.selectByConditionMaterialCategory(name, parentId, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countMaterialCategory(String name, Integer parentId) { + Long result=null; + try{ + result=materialCategoryMapperEx.countsByMaterialCategory(name, parentId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialCategory(JSONObject obj, HttpServletRequest request) { + MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class); + materialCategory.setCreateTime(new Date()); + materialCategory.setUpdateTime(new Date()); + int result=0; + try{ + result=materialCategoryMapper.insertSelective(materialCategory); + logService.insertLog("商品类型", + BusinessConstants.LOG_OPERATION_TYPE_ADD + materialCategory.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialCategory(JSONObject obj, HttpServletRequest request) { + MaterialCategory materialCategory = JSONObject.parseObject(obj.toJSONString(), MaterialCategory.class); + materialCategory.setUpdateTime(new Date()); + int result=0; + try{ + result=materialCategoryMapper.updateByPrimaryKeySelective(materialCategory); + logService.insertLog("商品类型", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + materialCategory.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialCategory(Long id, HttpServletRequest request) { + return batchDeleteMaterialCategoryByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategory(String ids, HttpServletRequest request) { + return batchDeleteMaterialCategoryByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialCategoryByIds(String ids) { + int result=0; + String [] idArray=ids.split(","); + //校验产品表 jsh_material + List materialList=null; + try{ + materialList= materialMapperEx.getMaterialListByCategoryIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(materialList!=null&& !materialList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,CategoryIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getMaterialCategoryListByIds(ids); + for(MaterialCategory materialCategory: list){ + sb.append("[").append(materialCategory.getName()).append("]"); + } + logService.insertLog("商品类型", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //更新时间 + Date updateDate =new Date(); + //更新人 + User userInfo= userService.getCurrentUser(); + Long updater=userInfo==null?null:userInfo.getId(); + String strArray[]=ids.split(","); + if(strArray.length<1){ + return 0; + } + List mcList = materialCategoryMapperEx.getMaterialCategoryListByCategoryIds(idArray); + if(mcList!=null && !mcList.isEmpty()) { + logger.error("异常码[{}],异常提示[{}]", + ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE,ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG); + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE, + ExceptionConstants.MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG); + } else { + result=materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List findById(Long id) { + List list=null; + if(id!=null) { + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andIdEqualTo(id); + try{ + list=materialCategoryMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + } + return list; + } + /** + *获取商品类别树数据 + * @return java.util.List + */ + public List getMaterialCategoryTree(Long id) { + List list=null; + try{ + list=materialCategoryMapperEx.getNodeTree(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + /** + * create by: cjl + * description: + * 新增商品类别信息 + * create time: 2019/2/19 16:30 + * @Param: mc + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int addMaterialCategory(MaterialCategory mc) { + logService.insertLog("商品类型", + BusinessConstants.LOG_OPERATION_TYPE_ADD + mc.getName(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + if(mc.getParentId()==null){ + //没有给定父级目录的id,默认设置父级目录为根目录的父目录 + mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); + } + //检查商品类型编号是否已存在 + checkMaterialCategorySerialNo(mc); + //数据状态新增时默认设置为启用 + Date date=new Date(); + User userInfo= userService.getCurrentUser(); + //创建时间 + mc.setCreateTime(date); + //更新时间 + mc.setUpdateTime(date); + int result=0; + try{ + result=materialCategoryMapperEx.addMaterialCategory(mc); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int editMaterialCategory(MaterialCategory mc) { + logService.insertLog("商品类型", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + mc.getName(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + if(mc.getParentId()==null){ + //没有给定父级目录的id,默认设置父级目录为根目录的父目录 + mc.setParentId(BusinessConstants.MATERIAL_CATEGORY_ROOT_PARENT_ID); + } + //检查商品类型编号是否已存在 + checkMaterialCategorySerialNo(mc); + //更新时间 + mc.setUpdateTime(new Date()); + //更新人 + User userInfo= userService.getCurrentUser(); + int result=0; + try{ + result= materialCategoryMapperEx.editMaterialCategory(mc); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * 根据商品类别编号判断商品类别是否已存在 + * */ + public void checkMaterialCategorySerialNo(MaterialCategory mc) { + if(mc==null){ + return; + } + if(StringUtil.isEmpty(mc.getSerialNo())){ + return; + } + //根据商品类别编号查询商品类别 + List mList=null; + try{ + mList= materialCategoryMapperEx.getMaterialCategoryBySerialNo(mc.getSerialNo(), mc.getId()); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(mList==null|| mList.isEmpty()){ + //未查询到对应数据,编号可用 + return; + } + if(mList.size()>1){ + //查询到的数据条数大于1,编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + if(mc.getId()==null){ + //新增时,编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + /** + * 包装类型用equals来比较 + * */ + if(mc.getId().equals(mList.get(0).getId())){ + //修改时,相同编号,id不同 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE, + ExceptionConstants.MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG); + } + } + + /** + * 根据名称获取类型 + * @param name + */ + public Long getCategoryIdByName(String name) { + Long categoryId = null; + MaterialCategoryExample example = new MaterialCategoryExample(); + example.createCriteria().andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialCategoryMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + categoryId = list.get(0).getId(); + } + return categoryId; + } +} diff --git a/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendComponent.java b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendComponent.java new file mode 100644 index 00000000..d69851ee --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendComponent.java @@ -0,0 +1,66 @@ +package com.wansensoft.service.materialExtend; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@MaterialExtendResource +public class MaterialExtendComponent implements ICommonQuery { + private final MaterialExtendService materialExtendService; + + public MaterialExtendComponent(MaterialExtendService materialExtendService) { + this.materialExtendService = materialExtendService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return materialExtendService.getMaterialExtend(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialList(map); + } + + private List getMaterialList(Map map) throws Exception{ + + return null; + } + + @Override + public Long counts(Map map)throws Exception { + + return 0L; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception{ + return materialExtendService.insertMaterialExtend(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialExtendService.updateMaterialExtend(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialExtendService.deleteMaterialExtend(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialExtendService.batchDeleteMaterialExtendByIds(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendResource.java b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendResource.java new file mode 100644 index 00000000..a5546e5c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.materialExtend; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "materialExtend") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialExtendResource { +} diff --git a/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendService.java b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendService.java new file mode 100644 index 00000000..9d5c6a16 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendService.java @@ -0,0 +1,46 @@ +package com.wansensoft.service.materialExtend; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.vo.MaterialExtendVo4List; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface MaterialExtendService extends IService { + + MaterialExtend getMaterialExtend(long id); + + List getDetailList(Long materialId); + + List getListByMIds(List idList); + + String saveDetials(JSONObject obj, String sortList, Long materialId, String type); + + int insertMaterialExtend(MaterialExtend materialExtend); + + int updateMaterialExtend(MaterialExtend materialExtend); + + int checkIsBarCodeExist(Long id, String barCode); + + int deleteMaterialExtend(Long id, HttpServletRequest request); + + int batchDeleteMaterialExtendByIds(String ids, HttpServletRequest request); + + int insertMaterialExtend(JSONObject obj, HttpServletRequest request); + + int updateMaterialExtend(JSONObject obj, HttpServletRequest request); + + List getMaterialExtendByTenantAndTime(Long tenantId, Long lastTime, Long syncNum); + + Long selectIdByMaterialIdAndDefaultFlag(Long materialId, String defaultFlag); + + Long selectIdByMaterialIdAndBarCode(Long materialId, String barCode); + + List getListByMaterialIdAndDefaultFlagAndBarCode(Long materialId, String defaultFlag, String barCode); + + MaterialExtend getInfoByBarCode(String barCode); + + List getMeListByBarCodeAndMid(List barCodeList, Long mId); +} diff --git a/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendServiceImpl.java b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendServiceImpl.java new file mode 100644 index 00000000..4d58cce9 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialExtend/MaterialExtendServiceImpl.java @@ -0,0 +1,406 @@ +package com.wansensoft.service.materialExtend; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.material.MaterialExtend; +import com.wansensoft.entities.material.MaterialExtendExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.material.MaterialExtendMapper; +import com.wansensoft.mappers.material.MaterialExtendMapperEx; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.MaterialExtendVo4List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +@Service +public class MaterialExtendServiceImpl extends ServiceImpl implements MaterialExtendService{ + private Logger logger = LoggerFactory.getLogger(MaterialExtendServiceImpl.class); + private final MaterialExtendMapper materialExtendMapper; + private final MaterialExtendMapperEx materialExtendMapperEx; + private final UserService userService; + private final RedisService redisService; + + public MaterialExtendServiceImpl(MaterialExtendMapper materialExtendMapper, MaterialExtendMapperEx materialExtendMapperEx, UserService userService, RedisService redisService) { + this.materialExtendMapper = materialExtendMapper; + this.materialExtendMapperEx = materialExtendMapperEx; + this.userService = userService; + this.redisService = redisService; + } + + public MaterialExtend getMaterialExtend(long id) { + MaterialExtend result=null; + try{ + result=materialExtendMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + public List getDetailList(Long materialId) { + List list=null; + try{ + list = materialExtendMapperEx.getDetailList(materialId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getListByMIds(List idList) { + List meList = null; + try{ + Long [] idArray= StringUtil.listToLongArray(idList); + if(idArray!=null && idArray.length>0) { + meList = materialExtendMapperEx.getListByMId(idArray); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return meList; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String saveDetials(JSONObject obj, String sortList, Long materialId, String type) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + JSONArray meArr = obj.getJSONArray("meList"); + JSONArray insertedJson = new JSONArray(); + JSONArray updatedJson = new JSONArray(); + JSONArray deletedJson = obj.getJSONArray("meDeleteIdList"); + JSONArray sortJson = JSONArray.parseArray(sortList); + if (null != meArr) { + if("insert".equals(type)){ + for (int i = 0; i < meArr.size(); i++) { + JSONObject tempJson = meArr.getJSONObject(i); + insertedJson.add(tempJson); + } + } else if("update".equals(type)){ + for (int i = 0; i < meArr.size(); i++) { + JSONObject tempJson = meArr.getJSONObject(i); + String tempId = tempJson.getString("id"); + if(tempId.length()>19){ + insertedJson.add(tempJson); + } else { + updatedJson.add(tempJson); + } + } + } + } + if (null != deletedJson) { + StringBuffer bf=new StringBuffer(); + for (int i = 0; i < deletedJson.size(); i++) { + bf.append(deletedJson.getString(i)); + if(i<(deletedJson.size()-1)){ + bf.append(","); + } + } + this.batchDeleteMaterialExtendByIds(bf.toString(), request); + } + if (null != insertedJson) { + for (int i = 0; i < insertedJson.size(); i++) { + MaterialExtend materialExtend = new MaterialExtend(); + JSONObject tempInsertedJson = JSONObject.parseObject(insertedJson.getString(i)); + materialExtend.setMaterialId(materialId); + if (StringUtils.isNotEmpty(tempInsertedJson.getString("barCode"))) { + int exist = checkIsBarCodeExist(0L, tempInsertedJson.getString("barCode")); + if(exist>0) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG,tempInsertedJson.getString("barCode"))); + } else { + materialExtend.setBarCode(tempInsertedJson.getString("barCode")); + } + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("commodityUnit"))) { + materialExtend.setCommodityUnit(tempInsertedJson.getString("commodityUnit")); + } + if (tempInsertedJson.get("sku")!=null) { + materialExtend.setSku(tempInsertedJson.getString("sku")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("purchaseDecimal"))) { + materialExtend.setPurchaseDecimal(tempInsertedJson.getBigDecimal("purchaseDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("commodityDecimal"))) { + materialExtend.setCommodityDecimal(tempInsertedJson.getBigDecimal("commodityDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("wholesaleDecimal"))) { + materialExtend.setWholesaleDecimal(tempInsertedJson.getBigDecimal("wholesaleDecimal")); + } + if (StringUtils.isNotEmpty(tempInsertedJson.getString("lowDecimal"))) { + materialExtend.setLowDecimal(tempInsertedJson.getBigDecimal("lowDecimal")); + } + this.insertMaterialExtend(materialExtend); + } + } + if (null != updatedJson) { + for (int i = 0; i < updatedJson.size(); i++) { + JSONObject tempUpdatedJson = JSONObject.parseObject(updatedJson.getString(i)); + MaterialExtend materialExtend = new MaterialExtend(); + materialExtend.setId(tempUpdatedJson.getLong("id")); + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("barCode"))) { + int exist = checkIsBarCodeExist(tempUpdatedJson.getLong("id"), tempUpdatedJson.getString("barCode")); + if(exist>0) { + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EXISTS_CODE, + String.format(ExceptionConstants.MATERIAL_BARCODE_EXISTS_MSG,tempUpdatedJson.getString("barCode"))); + } else { + materialExtend.setBarCode(tempUpdatedJson.getString("barCode")); + } + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("commodityUnit"))) { + materialExtend.setCommodityUnit(tempUpdatedJson.getString("commodityUnit")); + } + if (tempUpdatedJson.get("sku")!=null) { + materialExtend.setSku(tempUpdatedJson.getString("sku")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("purchaseDecimal"))) { + materialExtend.setPurchaseDecimal(tempUpdatedJson.getBigDecimal("purchaseDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("commodityDecimal"))) { + materialExtend.setCommodityDecimal(tempUpdatedJson.getBigDecimal("commodityDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("wholesaleDecimal"))) { + materialExtend.setWholesaleDecimal(tempUpdatedJson.getBigDecimal("wholesaleDecimal")); + } + if (StringUtils.isNotEmpty(tempUpdatedJson.getString("lowDecimal"))) { + materialExtend.setLowDecimal(tempUpdatedJson.getBigDecimal("lowDecimal")); + } + this.updateMaterialExtend(materialExtend); + //如果金额为空,此处单独置空 + materialExtendMapperEx.specialUpdatePrice(materialExtend); + } + } + //处理条码的排序,基本单位排第一个 + if (null != sortJson && sortJson.size()>0) { + //此处为更新的逻辑 + for (int i = 0; i < sortJson.size(); i++) { + JSONObject tempSortJson = JSONObject.parseObject(sortJson.getString(i)); + MaterialExtend materialExtend = new MaterialExtend(); + if(StringUtil.isExist(tempSortJson.get("id"))) { + materialExtend.setId(tempSortJson.getLong("id")); + } + if(StringUtil.isExist(tempSortJson.get("defaultFlag"))) { + materialExtend.setDefaultFlag(tempSortJson.getString("defaultFlag")); + } + this.updateMaterialExtend(materialExtend); + } + } else { + //新增的时候将第一条记录设置为默认基本单位 + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List meList = materialExtendMapper.selectByExample(example); + if(meList!=null) { + for(int i=0; i 0) { + criteria.andIdNotEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + criteria.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list =null; + try{ + list = materialExtendMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialExtend(Long id, HttpServletRequest request) { + int result =0; + MaterialExtend materialExtend = new MaterialExtend(); + materialExtend.setId(id); + materialExtend.setDeleteFlag(BusinessConstants.DELETE_FLAG_DELETED); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + User user = userService.getUser(userId); + materialExtend.setUpdateTime(new Date().getTime()); + materialExtend.setUpdateSerial(user.getLoginName()); + try{ + result= materialExtendMapper.updateByPrimaryKeySelective(materialExtend); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialExtendByIds(String ids, HttpServletRequest request) { + String [] idArray=ids.split(","); + int result = 0; + try{ + result = materialExtendMapperEx.batchDeleteMaterialExtendByIds(idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int insertMaterialExtend(JSONObject obj, HttpServletRequest request) { + MaterialExtend materialExtend = JSONObject.parseObject(obj.toJSONString(), MaterialExtend.class); + int result=0; + try{ + result = materialExtendMapper.insertSelective(materialExtend); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int updateMaterialExtend(JSONObject obj, HttpServletRequest request) { + MaterialExtend materialExtend = JSONObject.parseObject(obj.toJSONString(), MaterialExtend.class); + int result=0; + try{ + result = materialExtendMapper.updateByPrimaryKeySelective(materialExtend); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getMaterialExtendByTenantAndTime(Long tenantId, Long lastTime, Long syncNum) { + List list=new ArrayList(); + try{ + //先获取最大的时间戳,再查两个时间戳之间的数据,这样同步能够防止丢失数据(应为时间戳有重复) + Long maxTime = materialExtendMapperEx.getMaxTimeByTenantAndTime(tenantId, lastTime, syncNum); + if(tenantId!=null && lastTime!=null && maxTime!=null) { + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andTenantIdEqualTo(tenantId) + .andUpdateTimeGreaterThan(lastTime) + .andUpdateTimeLessThanOrEqualTo(maxTime); + list=materialExtendMapper.selectByExample(example); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public Long selectIdByMaterialIdAndDefaultFlag(Long materialId, String defaultFlag) { + Long id = 0L; + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDefaultFlagEqualTo(defaultFlag) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + id = list.get(0).getId(); + } + return id; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public Long selectIdByMaterialIdAndBarCode(Long materialId, String barCode) { + Long id = 0L; + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andBarCodeEqualTo(barCode) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + id = list.get(0).getId(); + } + return id; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public List getListByMaterialIdAndDefaultFlagAndBarCode(Long materialId, String defaultFlag, String barCode) { + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andDefaultFlagEqualTo(defaultFlag).andBarCodeNotEqualTo(barCode) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + return materialExtendMapper.selectByExample(example); + } + + public MaterialExtend getInfoByBarCode(String barCode) { + MaterialExtend materialExtend = new MaterialExtend(); + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andBarCodeEqualTo(barCode) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = materialExtendMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + return list.get(0); + } else { + return null; + } + } + + /** + * 查询某个商品里面被清除的条码信息 + * @param barCodeList + * @param mId + * @return + * @throws Exception + */ + public List getMeListByBarCodeAndMid(List barCodeList, Long mId) { + List list = new ArrayList<>(); + if(!barCodeList.isEmpty()) { + MaterialExtendExample example = new MaterialExtendExample(); + example.createCriteria().andBarCodeNotIn(barCodeList).andMaterialIdEqualTo(mId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = materialExtendMapper.selectByExample(example); + } + return list; + } +} diff --git a/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyComponent.java b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyComponent.java new file mode 100644 index 00000000..f20e2b66 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@MaterialPropertyResource +public class MaterialPropertyComponent implements ICommonQuery { + + private final MaterialPropertyService materialPropertyService; + + public MaterialPropertyComponent(MaterialPropertyService materialPropertyService) { + this.materialPropertyService = materialPropertyService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return materialPropertyService.getMaterialProperty(id); + } + + @Override + public List select(Map map)throws Exception { + return getMaterialPropertyList(map); + } + + private List getMaterialPropertyList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + return materialPropertyService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return materialPropertyService.countMaterialProperty(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return materialPropertyService.insertMaterialProperty(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return materialPropertyService.updateMaterialProperty(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return materialPropertyService.deleteMaterialProperty(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return materialPropertyService.batchDeleteMaterialProperty(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name) throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyResource.java b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyResource.java new file mode 100644 index 00000000..d815e9ed --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.materialProperty; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "materialProperty") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MaterialPropertyResource { +} diff --git a/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyService.java b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyService.java new file mode 100644 index 00000000..1e085b6a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyService.java @@ -0,0 +1,31 @@ +package com.wansensoft.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.material.MaterialProperty; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface MaterialPropertyService extends IService { + + MaterialProperty getMaterialProperty(long id); + + List getMaterialProperty(); + + List select(String name, int offset, int rows); + + Long countMaterialProperty(String name); + + int insertMaterialProperty(JSONObject obj, HttpServletRequest request); + + int updateMaterialProperty(JSONObject obj, HttpServletRequest request); + + int deleteMaterialProperty(Long id, HttpServletRequest request); + + int batchDeleteMaterialProperty(String ids, HttpServletRequest request); + + int batchDeleteMaterialPropertyByIds(String ids); + + int checkIsNameExist(Long id, String name); +} diff --git a/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyServiceImpl.java b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyServiceImpl.java new file mode 100644 index 00000000..ae43b573 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/materialProperty/MaterialPropertyServiceImpl.java @@ -0,0 +1,150 @@ +package com.wansensoft.service.materialProperty; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.material.MaterialProperty; +import com.wansensoft.entities.material.MaterialPropertyExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.material.MaterialPropertyMapper; +import com.wansensoft.mappers.material.MaterialPropertyMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +@Service +public class MaterialPropertyServiceImpl extends ServiceImpl implements MaterialPropertyService { + private Logger logger = LoggerFactory.getLogger(MaterialPropertyServiceImpl.class); + + private final MaterialPropertyMapper materialPropertyMapper; + private final MaterialPropertyMapperEx materialPropertyMapperEx; + private final UserService userService; + private final LogService logService; + + public MaterialPropertyServiceImpl(MaterialPropertyMapper materialPropertyMapper, MaterialPropertyMapperEx materialPropertyMapperEx, UserService userService, LogService logService) { + this.materialPropertyMapper = materialPropertyMapper; + this.materialPropertyMapperEx = materialPropertyMapperEx; + this.userService = userService; + this.logService = logService; + } + + public MaterialProperty getMaterialProperty(long id) { + MaterialProperty result=null; + try{ + result=materialPropertyMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getMaterialProperty() { + MaterialPropertyExample example = new MaterialPropertyExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=materialPropertyMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, int offset, int rows) { + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + list = materialPropertyMapperEx.selectByConditionMaterialProperty(name, offset, rows); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countMaterialProperty(String name) { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = materialPropertyMapperEx.countsByMaterialProperty(name); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMaterialProperty(JSONObject obj, HttpServletRequest request) { + MaterialProperty materialProperty = JSONObject.parseObject(obj.toJSONString(), MaterialProperty.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = materialPropertyMapper.insertSelective(materialProperty); + logService.insertLog("商品属性", + BusinessConstants.LOG_OPERATION_TYPE_ADD + materialProperty.getNativeName(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMaterialProperty(JSONObject obj, HttpServletRequest request) { + MaterialProperty materialProperty = JSONObject.parseObject(obj.toJSONString(), MaterialProperty.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = materialPropertyMapper.updateByPrimaryKeySelective(materialProperty); + logService.insertLog("商品属性", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + materialProperty.getNativeName(), request); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMaterialProperty(Long id, HttpServletRequest request) { + return batchDeleteMaterialPropertyByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialProperty(String ids, HttpServletRequest request) { + return batchDeleteMaterialPropertyByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMaterialPropertyByIds(String ids) { + User userInfo= userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) { + result = materialPropertyMapperEx.batchDeleteMaterialPropertyByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + logService.insertLog("商品属性", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + return 0; + } +} diff --git a/service/src/main/java/com/wansensoft/service/msg/MsgComponent.java b/service/src/main/java/com/wansensoft/service/msg/MsgComponent.java new file mode 100644 index 00000000..551cecb3 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/msg/MsgComponent.java @@ -0,0 +1,74 @@ +package com.wansensoft.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@MsgResource +public class MsgComponent implements ICommonQuery { + + private final MsgService msgService; + + public MsgComponent(MsgService msgService) { + this.msgService = msgService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return msgService.getMsg(id); + } + + @Override + public List select(Map map)throws Exception { + return getMsgList(map); + } + + private List getMsgList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + String filter = QueryUtils.filter(map); + return msgService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return msgService.countMsg(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return msgService.insertMsg(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return msgService.updateMsg(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return msgService.deleteMsg(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return msgService.batchDeleteMsg(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return msgService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/msg/MsgResource.java b/service/src/main/java/com/wansensoft/service/msg/MsgResource.java new file mode 100644 index 00000000..dbd1e557 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/msg/MsgResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.msg; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "msg") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface MsgResource { +} diff --git a/service/src/main/java/com/wansensoft/service/msg/MsgService.java b/service/src/main/java/com/wansensoft/service/msg/MsgService.java new file mode 100644 index 00000000..805d756c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/msg/MsgService.java @@ -0,0 +1,42 @@ +package com.wansensoft.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.msg.Msg; +import com.wansensoft.entities.msg.MsgEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface MsgService extends IService { + + Msg getMsg(long id); + + List getMsg(); + + List select(String name, int offset, int rows); + + Long countMsg(String name); + + int insertMsg(JSONObject obj, HttpServletRequest request); + + int updateMsg(JSONObject obj, HttpServletRequest request); + + int deleteMsg(Long id, HttpServletRequest request); + + int batchDeleteMsg(String ids, HttpServletRequest request); + + int checkIsNameExist(Long id, String name); + + int batchDeleteMsgByIds(String ids); + + List getMsgByStatus(String status); + + void batchUpdateStatus(String ids, String status); + + Long getMsgCountByStatus(String status); + + Integer getMsgCountByType(String type); + + void readAllMsg(); +} diff --git a/service/src/main/java/com/wansensoft/service/msg/MsgServiceImpl.java b/service/src/main/java/com/wansensoft/service/msg/MsgServiceImpl.java new file mode 100644 index 00000000..f831fb37 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/msg/MsgServiceImpl.java @@ -0,0 +1,330 @@ +package com.wansensoft.service.msg; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.msg.Msg; +import com.wansensoft.entities.msg.MsgEx; +import com.wansensoft.entities.msg.MsgExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.mappers.msg.MsgMapper; +import com.wansensoft.mappers.msg.MsgMapperEx; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static com.wansensoft.utils.Tools.getCenternTime; + +@Service +public class MsgServiceImpl extends ServiceImpl implements MsgService { + private Logger logger = LoggerFactory.getLogger(MsgServiceImpl.class); + + private final MsgMapper msgMapper; + private final MsgMapperEx msgMapperEx; + private final UserService userService; + private final LogService logService; + + public MsgServiceImpl(MsgMapper msgMapper, MsgMapperEx msgMapperEx, UserService userService, LogService logService) { + this.msgMapper = msgMapper; + this.msgMapperEx = msgMapperEx; + this.userService = userService; + this.logService = logService; + } + + public Msg getMsg(long id) { + Msg result=null; + try{ + result=msgMapper.selectByPrimaryKey(id); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public List getMsg() { + MsgExample example = new MsgExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=msgMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; + } + + public List select(String name, int offset, int rows) { + List list=null; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + list = msgMapperEx.selectByConditionMsg(userInfo.getId(), name, offset, rows); + if (null != list) { + for (MsgEx msgEx : list) { + if (msgEx.getCreateTime() != null) { + msgEx.setCreateTimeStr(getCenternTime(msgEx.getCreateTime())); + } + } + } + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list; + } + + public Long countMsg(String name) { + Long result=null; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + result = msgMapperEx.countsByMsg(userInfo.getId(), name); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertMsg(JSONObject obj, HttpServletRequest request) { + Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); + int result=0; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + msg.setCreateTime(new Date()); + msg.setStatus("1"); + result=msgMapper.insertSelective(msg); + logService.insertLog("消息", + BusinessConstants.LOG_OPERATION_TYPE_ADD + msg.getMsgTitle(), request); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateMsg(JSONObject obj, HttpServletRequest request) { + Msg msg = JSONObject.parseObject(obj.toJSONString(), Msg.class); + int result=0; + try{ + result=msgMapper.updateByPrimaryKeySelective(msg); + logService.insertLog("消息", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + msg.getMsgTitle(), request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteMsg(Long id, HttpServletRequest request) { + int result=0; + try{ + result=msgMapper.deleteByPrimaryKey(id); + logService.insertLog("消息", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + id, request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMsg(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + MsgExample example = new MsgExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=msgMapper.deleteByExample(example); + logService.insertLog("消息", "批量删除,id集:" + ids, request); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + MsgExample example = new MsgExample(); + example.createCriteria().andIdNotEqualTo(id).andMsgTitleEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= msgMapper.selectByExample(example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return list==null?0:list.size(); + } + + /** + * 逻辑删除角色信息 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteMsgByIds(String ids) { + logService.insertLog("序列号", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + String [] idArray=ids.split(","); + int result=0; + try{ + result=msgMapperEx.batchDeleteMsgByIds(idArray); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + return result; + } + + public List getMsgByStatus(String status) { + List resList=new ArrayList<>(); + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + MsgExample example = new MsgExample(); + example.createCriteria().andStatusEqualTo(status).andUserIdEqualTo(userInfo.getId()) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("id desc"); + List list = msgMapper.selectByExample(example); + if (null != list) { + for (Msg msg : list) { + if (msg.getCreateTime() != null) { + MsgEx msgEx = new MsgEx(); + msgEx.setId(msg.getId()); + msgEx.setMsgTitle(msg.getMsgTitle()); + msgEx.setMsgContent(msg.getMsgContent()); + msgEx.setStatus(msg.getStatus()); + msgEx.setType(msg.getType()); + msgEx.setCreateTimeStr(Tools.getCenternTime(msg.getCreateTime())); + resList.add(msgEx); + } + } + } + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return resList; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void batchUpdateStatus(String ids, String status) { + List idList = StringUtil.strToLongList(ids); + Msg msg = new Msg(); + msg.setStatus(status); + MsgExample example = new MsgExample(); + example.createCriteria().andIdIn(idList); + try{ + msgMapper.updateByExampleSelective(msg, example); + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } + + public Long getMsgCountByStatus(String status) { + Long result=null; + try{ + User userInfo= userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + result = msgMapperEx.getMsgCountByStatus(status, userInfo.getId()); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return result; + } + + public Integer getMsgCountByType(String type) { + int msgCount = 0; + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + MsgExample example = new MsgExample(); + example.createCriteria().andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = msgMapper.selectByExample(example); + msgCount = list.size(); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE, + ExceptionConstants.DATA_READ_FAIL_MSG); + } + return msgCount; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void readAllMsg() { + try{ + User userInfo = userService.getCurrentUser(); + if(!BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { + Msg msg = new Msg(); + msg.setStatus("2"); + MsgExample example = new MsgExample(); + example.createCriteria(); + msgMapper.updateByExampleSelective(msg, example); + } + }catch(Exception e){ + logger.error("异常码[{}],异常提示[{}],异常[{}]", + ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e); + throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE, + ExceptionConstants.DATA_WRITE_FAIL_MSG); + } + } +} diff --git a/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelComponent.java b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelComponent.java new file mode 100644 index 00000000..63de8ef6 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelComponent.java @@ -0,0 +1,64 @@ +package com.wansensoft.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + */ +@Service +@OrgaUserRelResource +public class OrgaUserRelComponent implements ICommonQuery { + private final OrgaUserRelService orgaUserRelService; + + public OrgaUserRelComponent(OrgaUserRelService orgaUserRelService) { + this.orgaUserRelService = orgaUserRelService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return orgaUserRelService.getOrgaUserRel(id); + } + + @Override + public List select(Map parameterMap)throws Exception { + return getOrgaUserRelList(parameterMap); + } + private List getOrgaUserRelList(Map map)throws Exception { + return null; + } + @Override + public Long counts(Map parameterMap)throws Exception { + return null; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return orgaUserRelService.insertOrgaUserRel(obj,request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return orgaUserRelService.updateOrgaUserRel(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return orgaUserRelService.deleteOrgaUserRel(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return orgaUserRelService.batchDeleteOrgaUserRel(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } +} diff --git a/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelResource.java b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelResource.java new file mode 100644 index 00000000..928ad126 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelResource.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.orgaUserRel; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * 机构用户关系 + */ +@ResourceInfo(value = "orgaUserRel") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrgaUserRelResource { + +} diff --git a/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelService.java b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelService.java new file mode 100644 index 00000000..e0ad646c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelService.java @@ -0,0 +1,29 @@ +package com.wansensoft.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.organization.OrgaUserRel; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface OrgaUserRelService extends IService { + + OrgaUserRel getOrgaUserRel(long id); + + int insertOrgaUserRel(JSONObject obj, HttpServletRequest request); + + int updateOrgaUserRel(JSONObject obj, HttpServletRequest request); + + int deleteOrgaUserRel(Long id, HttpServletRequest request); + + int batchDeleteOrgaUserRel(String ids, HttpServletRequest request); + + OrgaUserRel addOrgaUserRel(OrgaUserRel orgaUserRel); + + OrgaUserRel updateOrgaUserRel(OrgaUserRel orgaUserRel); + + String getUserIdListByUserId(Long userId); + + List getUserIdListByOrgId(Long orgId); +} diff --git a/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelServiceImpl.java new file mode 100644 index 00000000..d315eb68 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/orgaUserRel/OrgaUserRelServiceImpl.java @@ -0,0 +1,219 @@ +package com.wansensoft.service.orgaUserRel; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.organization.OrgaUserRel; +import com.wansensoft.entities.organization.OrgaUserRelExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.organization.OrgaUserRelMapper; +import com.wansensoft.mappers.organization.OrgaUserRelMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.organization.OrganizationService; +import com.wansensoft.service.organization.OrganizationServiceImpl; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + */ +@Service +public class OrgaUserRelServiceImpl extends ServiceImpl implements OrgaUserRelService{ + private Logger logger = LoggerFactory.getLogger(OrganizationServiceImpl.class); + + private final OrgaUserRelMapper orgaUserRelMapper; + private final OrgaUserRelMapperEx orgaUserRelMapperEx; + private final OrganizationService organizationService; + private final LogService logService; + private final CommonService commonService; + + public OrgaUserRelServiceImpl(OrgaUserRelMapper orgaUserRelMapper, OrgaUserRelMapperEx orgaUserRelMapperEx, OrganizationService organizationService, LogService logService, CommonService commonService) { + this.orgaUserRelMapper = orgaUserRelMapper; + this.orgaUserRelMapperEx = orgaUserRelMapperEx; + this.organizationService = organizationService; + this.logService = logService; + this.commonService = commonService; + } + + public OrgaUserRel getOrgaUserRel(long id) { + return orgaUserRelMapper.selectByPrimaryKey(id); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertOrgaUserRel(JSONObject obj, HttpServletRequest request) { + OrgaUserRel orgaUserRel = JSONObject.parseObject(obj.toJSONString(), OrgaUserRel.class); + int result=0; + try{ + result=orgaUserRelMapper.insertSelective(orgaUserRel); + logService.insertLog("用户与机构关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateOrgaUserRel(JSONObject obj, HttpServletRequest request) { + OrgaUserRel orgaUserRel = JSONObject.parseObject(obj.toJSONString(), OrgaUserRel.class); + int result=0; + try{ + result=orgaUserRelMapper.updateByPrimaryKeySelective(orgaUserRel); + logService.insertLog("用户与机构关系", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + orgaUserRel.getId(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrgaUserRel(Long id, HttpServletRequest request) { + int result=0; + try{ + result=orgaUserRelMapper.deleteByPrimaryKey(id); + logService.insertLog("用户与机构关系", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + id, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrgaUserRel(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + OrgaUserRelExample example = new OrgaUserRelExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + result=orgaUserRelMapper.deleteByExample(example); + logService.insertLog("用户与机构关系", "批量删除,id集:" + ids, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * description: + * 新增机构用户关联关系,反显id + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel addOrgaUserRel(OrgaUserRel orgaUserRel) { + Date date = new Date(); + User userInfo = commonService.getCurrentUser(); + //创建时间 + if(orgaUserRel.getCreateTime()==null){ + orgaUserRel.setCreateTime(date); + } + //创建人 + if(orgaUserRel.getCreator()==null){ + orgaUserRel.setCreator(userInfo==null?null:userInfo.getId()); + } + //更新时间 + if(orgaUserRel.getUpdateTime()==null){ + orgaUserRel.setUpdateTime(date); + } + //更新人 + if(orgaUserRel.getUpdater()==null){ + orgaUserRel.setUpdater(userInfo==null?null:userInfo.getId()); + } + orgaUserRel.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS); + int result=0; + try{ + result=orgaUserRelMapperEx.addOrgaUserRel(orgaUserRel); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result>0){ + return orgaUserRel; + } + return null; + } + + /** + * description: + * 更新机构用户关联关系 + * @Param: orgaUserRel + * @return void + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public OrgaUserRel updateOrgaUserRel(OrgaUserRel orgaUserRel) { + User userInfo = commonService.getCurrentUser(); + //更新时间 + if(orgaUserRel.getUpdateTime()==null){ + orgaUserRel.setUpdateTime(new Date()); + } + //更新人 + if(orgaUserRel.getUpdater()==null){ + orgaUserRel.setUpdater(userInfo==null?null:userInfo.getId()); + } + int result=0; + try{ + result=orgaUserRelMapperEx.updateOrgaUserRel(orgaUserRel); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result>0){ + return orgaUserRel; + } + return null; + } + + /** + * 根据用户id获取用户id列表 + * @param userId + * @return + * @throws Exception + */ + public String getUserIdListByUserId(Long userId) { + String users = ""; + OrgaUserRelExample example = new OrgaUserRelExample(); + example.createCriteria().andUserIdEqualTo(userId); + List list = orgaUserRelMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + OrgaUserRel our = list.get(0); + List userIdList = getUserIdListByOrgId(our.getOrgaId()); + for(Long u: userIdList){ + users = users + u + ","; + } + if(!users.isEmpty()){ + users = users.substring(0,users.length()-1); + } + } + return users; + } + + /** + * 根据组织id获取所属的用户id列表(包含组织的递归) + * @param orgId + * @return + */ + public List getUserIdListByOrgId(Long orgId) { + List orgIdList = organizationService.getOrgIdByParentId(orgId); + List userIdList = new ArrayList(); + OrgaUserRelExample example = new OrgaUserRelExample(); + if(orgIdList!=null && !orgIdList.isEmpty()) { + example.createCriteria().andOrgaIdIn(orgIdList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } else { + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + } + List list = orgaUserRelMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + for(OrgaUserRel our: list) { + userIdList.add(our.getUserId()); + } + } + return userIdList; + } +} diff --git a/service/src/main/java/com/wansensoft/service/organization/OrganizationComponent.java b/service/src/main/java/com/wansensoft/service/organization/OrganizationComponent.java new file mode 100644 index 00000000..7a070086 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/organization/OrganizationComponent.java @@ -0,0 +1,65 @@ +package com.wansensoft.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + */ +@Service +@OrganizationResource +public class OrganizationComponent implements ICommonQuery { + + private final OrganizationService organizationService; + + public OrganizationComponent(OrganizationService organizationService) { + this.organizationService = organizationService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return organizationService.getOrganization(id); + } + + @Override + public List select(Map parameterMap)throws Exception { + return getOrganizationList(parameterMap); + } + private List getOrganizationList(Map map)throws Exception { + return null; + } + @Override + public Long counts(Map parameterMap)throws Exception { + return null; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return organizationService.insertOrganization(obj,request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return organizationService.updateOrganization(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return organizationService.deleteOrganization(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return organizationService.batchDeleteOrganization(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return organizationService.checkIsNameExist(id, name); + } +} diff --git a/service/src/main/java/com/wansensoft/service/organization/OrganizationResource.java b/service/src/main/java/com/wansensoft/service/organization/OrganizationResource.java new file mode 100644 index 00000000..e9ab190f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/organization/OrganizationResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.service.organization; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * 机构 + */ +@ResourceInfo(value = "organization") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface OrganizationResource { +} diff --git a/service/src/main/java/com/wansensoft/service/organization/OrganizationService.java b/service/src/main/java/com/wansensoft/service/organization/OrganizationService.java new file mode 100644 index 00000000..d23ab5bd --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/organization/OrganizationService.java @@ -0,0 +1,46 @@ +package com.wansensoft.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.organization.Organization; +import com.wansensoft.vo.TreeNode; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface OrganizationService extends IService { + + Organization getOrganization(long id); + + List getOrganizationListByIds(String ids); + + int insertOrganization(JSONObject obj, HttpServletRequest request); + + int updateOrganization(JSONObject obj, HttpServletRequest request); + + int deleteOrganization(Long id, HttpServletRequest request); + + int batchDeleteOrganization(String ids, HttpServletRequest request); + + int batchDeleteOrganizationByIds(String ids); + + int checkIsNameExist(Long id, String name); + + int addOrganization(Organization org); + + int editOrganization(Organization org); + + List getOrganizationTree(Long id); + + List findById(Long id); + + List findByParentId(Long parentId); + + List findByOrgNo(String orgNo); + + void checkOrgNoIsExists(String orgNo,Long id); + + List getOrgIdByParentId(Long orgId); + + void getOrgIdByParentNo(List idList,Long id); +} diff --git a/service/src/main/java/com/wansensoft/service/organization/OrganizationServiceImpl.java b/service/src/main/java/com/wansensoft/service/organization/OrganizationServiceImpl.java new file mode 100644 index 00000000..a03c4829 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/organization/OrganizationServiceImpl.java @@ -0,0 +1,320 @@ +package com.wansensoft.service.organization; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.organization.Organization; +import com.wansensoft.entities.organization.OrganizationExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.organization.OrganizationMapper; +import com.wansensoft.mappers.organization.OrganizationMapperEx; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.vo.TreeNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + */ +@Service +public class OrganizationServiceImpl extends ServiceImpl implements OrganizationService{ + private Logger logger = LoggerFactory.getLogger(OrganizationServiceImpl.class); + + private final OrganizationMapper organizationMapper; + private final OrganizationMapperEx organizationMapperEx; + private final LogService logService; + + public OrganizationServiceImpl(OrganizationMapper organizationMapper, OrganizationMapperEx organizationMapperEx, LogService logService) { + this.organizationMapper = organizationMapper; + this.organizationMapperEx = organizationMapperEx; + this.logService = logService; + } + + public Organization getOrganization(long id) { + return organizationMapper.selectByPrimaryKey(id); + } + + public List getOrganizationListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdIn(idList); + list = organizationMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertOrganization(JSONObject obj, HttpServletRequest request) { + Organization organization = JSONObject.parseObject(obj.toJSONString(), Organization.class); + organization.setCreateTime(new Date()); + organization.setUpdateTime(new Date()); + int result=0; + try{ + result = organizationMapper.insertSelective(organization); + + logService.insertLog("机构", + BusinessConstants.LOG_OPERATION_TYPE_ADD + organization.getOrgAbr(),request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateOrganization(JSONObject obj, HttpServletRequest request) { + Organization organization = JSONObject.parseObject(obj.toJSONString(), Organization.class); + organization.setUpdateTime(new Date()); + int result=0; + try{ + result=organizationMapper.updateByPrimaryKeySelective(organization); + logService.insertLog("机构", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + organization.getOrgAbr(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteOrganization(Long id, HttpServletRequest request) { + return batchDeleteOrganizationByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganization(String ids, HttpServletRequest request) { + return batchDeleteOrganizationByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteOrganizationByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getOrganizationListByIds(ids); + for(Organization organization: list){ + sb.append("[").append(organization.getOrgAbr()).append("]"); + } + logService.insertLog("机构", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + // User userInfo=userService.getCurrentUser(); + User userInfo= null; + String [] idArray=ids.split(","); + int result=0; + List organList = organizationMapperEx.getOrganizationByParentIds(idArray); + if(organList!=null && !organList.isEmpty()) { + //如果存在子机构则不能删除 + logger.error("异常码[{}],异常提示[{}]", + ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE,ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE, + ExceptionConstants.ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG); + } else { + result=organizationMapperEx.batchDeleteOrganizationByIds( + new Date(),userInfo==null?null:userInfo.getId(),idArray); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdNotEqualTo(id).andOrgAbrEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= organizationMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int addOrganization(Organization org) { + logService.insertLog("机构", + BusinessConstants.LOG_OPERATION_TYPE_ADD + org.getOrgAbr(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //新增时间 + Date date=new Date(); + // User userInfo=userService.getCurrentUser(); + User userInfo= null; + org.setCreateTime(date); + //修改时间 + org.setUpdateTime(date); + /** + *添加的时候检测机构编号是否已存在 + * */ + if(StringUtil.isNotEmpty(org.getOrgNo())){ + checkOrgNoIsExists(org.getOrgNo(),null); + } + /** + * 未指定父级机构的时候默认为根机构 + * */ + if(org.getParentId()!=null){ + org.setParentId(null); + } + int result=0; + try{ + result=organizationMapperEx.addOrganization(org); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int editOrganization(Organization org) { + logService.insertLog("机构", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + org.getOrgAbr(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //修改时间 + org.setUpdateTime(new Date()); + // User userInfo=userService.getCurrentUser(); + User userInfo= null; + /** + * 修改的时候检测机构编号是否已存在 + * */ + if(StringUtil.isNotEmpty(org.getOrgNo())){ + checkOrgNoIsExists(org.getOrgNo(),org.getId()); + } + /** + * 未指定父级机构的时候默认为根机构 + * */ + if(org.getParentId()!=null){ + org.setParentId(null); + } + int result=0; + try{ + result=organizationMapperEx.editOrganization(org); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List getOrganizationTree(Long id) { + List list=null; + try{ + list=organizationMapperEx.getNodeTree(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findById(Long id) { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(id); + List list=null; + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByParentId(Long parentId) { + List list=null; + if(parentId!=null){ + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(parentId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + } + return list; + } + + public List findByOrgNo(String orgNo) { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andOrgNoEqualTo(orgNo).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=organizationMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + /** + * description: + * 检查机构编号是否已经存在 + * @Param: orgNo + * @return void + */ + public void checkOrgNoIsExists(String orgNo,Long id) { + List orgList=findByOrgNo(orgNo); + if(orgList!=null&&orgList.size()>0){ + if(orgList.size()>1){ + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo); + //获取的数据条数大于1,机构编号已存在 + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + if(id!=null){ + if(!orgList.get(0).getId().equals(id)){ + //数据条数等于1,但是和编辑的数据的id不相同 + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}],id[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo,id); + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + }else{ + logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}]", + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE,ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG,orgNo); + //数据条数等于1,但此时是新增 + throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_CODE, + ExceptionConstants.ORGANIZATION_NO_ALREADY_EXISTS_MSG); + } + } + + } + + /** + * 根据父级id递归获取子集组织id + * @return + */ + public List getOrgIdByParentId(Long orgId) { + List idList = new ArrayList<>(); + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andIdEqualTo(orgId).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List orgList = organizationMapper.selectByExample(example); + if(orgList!=null && !orgList.isEmpty()) { + idList.add(orgId); + getOrgIdByParentNo(idList, orgList.get(0).getId()); + } + return idList; + } + + /** + * 根据组织编号递归获取下级编号 + * @param id + * @return + */ + public void getOrgIdByParentNo(List idList,Long id) { + OrganizationExample example = new OrganizationExample(); + example.createCriteria().andParentIdEqualTo(id).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List orgList = organizationMapper.selectByExample(example); + if(orgList!=null && !orgList.isEmpty()) { + for(Organization o: orgList) { + idList.add(o.getId()); + getOrgIdByParentNo(idList, o.getId()); + } + } + } +} diff --git a/service/src/main/java/com/wansensoft/service/person/PersonComponent.java b/service/src/main/java/com/wansensoft/service/person/PersonComponent.java new file mode 100644 index 00000000..228c41fb --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/person/PersonComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@PersonResource +public class PersonComponent implements ICommonQuery { + + private final PersonService personService; + + public PersonComponent(PersonService personService) { + this.personService = personService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return personService.getPerson(id); + } + + @Override + public List select(Map map)throws Exception { + return getPersonList(map); + } + + private List getPersonList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + String order = QueryUtils.order(map); + return personService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String type = StringUtil.getInfo(search, "type"); + return personService.countPerson(name, type); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return personService.insertPerson(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return personService.updatePerson(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return personService.deletePerson(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return personService.batchDeletePerson(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return personService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/person/PersonResource.java b/service/src/main/java/com/wansensoft/service/person/PersonResource.java new file mode 100644 index 00000000..d22301a2 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/person/PersonResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.person; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "person") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PersonResource { +} diff --git a/service/src/main/java/com/wansensoft/service/person/PersonService.java b/service/src/main/java/com/wansensoft/service/person/PersonService.java new file mode 100644 index 00000000..2b39834c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/person/PersonService.java @@ -0,0 +1,44 @@ +package com.wansensoft.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.person.Person; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; +import java.util.Map; + +public interface PersonService extends IService { + + Person getPerson(long id); + + List getPersonListByIds(String ids); + + List getPerson(); + + List select(String name, String type, int offset, int rows); + + Long countPerson(String name, String type); + + int insertPerson(JSONObject obj, HttpServletRequest request); + + int updatePerson(JSONObject obj, HttpServletRequest request); + + int deletePerson(Long id, HttpServletRequest request); + + int batchDeletePerson(String ids, HttpServletRequest request); + + int batchDeletePersonByIds(String ids); + + int checkIsNameExist(Long id, String name); + + Map getPersonMap(); + + String getPersonByMapAndIds(Map personMap, String personIds); + + List getPersonByType(String type); + + int batchSetStatus(Boolean status, String ids); + + +} diff --git a/service/src/main/java/com/wansensoft/service/person/PersonServiceImpl.java b/service/src/main/java/com/wansensoft/service/person/PersonServiceImpl.java new file mode 100644 index 00000000..1045a24e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/person/PersonServiceImpl.java @@ -0,0 +1,254 @@ +package com.wansensoft.service.person; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.person.Person; +import com.wansensoft.entities.person.PersonExample; +import com.wansensoft.mappers.account.AccountHeadMapperEx; +import com.wansensoft.mappers.depot.DepotHeadMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.person.PersonMapper; +import com.wansensoft.mappers.person.PersonMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class PersonServiceImpl extends ServiceImpl implements PersonService{ + private Logger logger = LoggerFactory.getLogger(PersonServiceImpl.class); + + private final PersonMapper personMapper; + private final PersonMapperEx personMapperEx; + private final LogService logService; + private final AccountHeadMapperEx accountHeadMapperEx; + private final DepotHeadMapperEx depotHeadMapperEx; + + public PersonServiceImpl(PersonMapper personMapper, PersonMapperEx personMapperEx, LogService logService, AccountHeadMapperEx accountHeadMapperEx, DepotHeadMapperEx depotHeadMapperEx) { + this.personMapper = personMapper; + this.personMapperEx = personMapperEx; + this.logService = logService; + this.accountHeadMapperEx = accountHeadMapperEx; + this.depotHeadMapperEx = depotHeadMapperEx; + } + + public Person getPerson(long id) { + Person result=null; + try{ + result=personMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getPersonListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + PersonExample example = new PersonExample(); + example.createCriteria().andIdIn(idList); + list = personMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getPerson() { + PersonExample example = new PersonExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, String type, int offset, int rows) { + List list=null; + try{ + list=personMapperEx.selectByConditionPerson(name, type, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countPerson(String name, String type) { + Long result=null; + try{ + result=personMapperEx.countsByPerson(name, type); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertPerson(JSONObject obj, HttpServletRequest request) { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + person.setEnabled(true); + result=personMapper.insertSelective(person); + logService.insertLog("经手人", + BusinessConstants.LOG_OPERATION_TYPE_ADD + person.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updatePerson(JSONObject obj, HttpServletRequest request) { + Person person = JSONObject.parseObject(obj.toJSONString(), Person.class); + int result=0; + try{ + result=personMapper.updateByPrimaryKeySelective(person); + logService.insertLog("经手人", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + person.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deletePerson(Long id, HttpServletRequest request) { + return batchDeletePersonByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePerson(String ids, HttpServletRequest request) { + return batchDeletePersonByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePersonByIds(String ids) { + int result =0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList =null; + try{ + accountHeadList=accountHeadMapperEx.getAccountHeadListByHandsPersonIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(accountHeadList!=null&& !accountHeadList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList =null; + try{ + depotHeadList=depotHeadMapperEx.getDepotHeadListByCreator(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(depotHeadList!=null&& !depotHeadList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,HandsPersonIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getPersonListByIds(ids); + for(Person person: list){ + sb.append("[").append(person.getName()).append("]"); + } + logService.insertLog("经手人", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //删除经手人 + try{ + result=personMapperEx.batchDeletePersonByIds(idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + PersonExample example = new PersonExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public Map getPersonMap() { + List personList = getPerson(); + Map personMap = new HashMap<>(); + for(Person person : personList){ + personMap.put(person.getId(), person.getName()); + } + return personMap; + } + + public String getPersonByMapAndIds(Map personMap, String personIds) { + List ids = StringUtil.strToLongList(personIds); + StringBuilder sb = new StringBuilder(); + for(Long id: ids){ + sb.append(personMap.get(id)).append(" "); + } + return sb.toString(); + } + + public List getPersonByType(String type) { + PersonExample example = new PersonExample(); + example.createCriteria().andTypeEqualTo(type).andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list =null; + try{ + list=personMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("经手人", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List personIds = StringUtil.strToLongList(ids); + Person person = new Person(); + person.setEnabled(status); + PersonExample example = new PersonExample(); + example.createCriteria().andIdIn(personIds); + int result=0; + try{ + result = personMapper.updateByExampleSelective(person, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigComponent.java b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigComponent.java new file mode 100644 index 00000000..7d392a40 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigComponent.java @@ -0,0 +1,72 @@ +package com.wansensoft.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@PlatformConfigResource +public class PlatformConfigComponent implements ICommonQuery { + + private final PlatformConfigService platformConfigService; + + public PlatformConfigComponent(PlatformConfigService platformConfigService) { + this.platformConfigService = platformConfigService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return platformConfigService.getPlatformConfig(id); + } + + @Override + public List select(Map map)throws Exception { + return getPlatformConfigList(map); + } + + private List getPlatformConfigList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String platformKey = StringUtil.getInfo(search, "platformKey"); + return platformConfigService.select(platformKey, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String platformKey = StringUtil.getInfo(search, "platformKey"); + return platformConfigService.countPlatformConfig(platformKey); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return platformConfigService.insertPlatformConfig(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return platformConfigService.updatePlatformConfig(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return platformConfigService.deletePlatformConfig(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return platformConfigService.batchDeletePlatformConfig(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return 0; + } + +} diff --git a/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigResource.java b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigResource.java new file mode 100644 index 00000000..7b3dad97 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.platformConfig; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "platformConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PlatformConfigResource { +} diff --git a/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigService.java b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigService.java new file mode 100644 index 00000000..975bca17 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigService.java @@ -0,0 +1,33 @@ +package com.wansensoft.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.platformConfig.PlatformConfig; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface PlatformConfigService extends IService { + + PlatformConfig getPlatformConfig(long id); + + List getPlatformConfig(); + + List select(String platformKey, int offset, int rows); + + Long countPlatformConfig(String platformKey); + + int insertPlatformConfig(JSONObject obj, HttpServletRequest request); + + int updatePlatformConfig(JSONObject obj, HttpServletRequest request); + + int deletePlatformConfig(Long id, HttpServletRequest request); + + int batchDeletePlatformConfig(String ids, HttpServletRequest request); + + int updatePlatformConfigByKey(String platformKey, String platformValue); + + PlatformConfig getInfoByKey(String platformKey); + + PlatformConfig getPlatformConfigByKey(String platformKey); +} diff --git a/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigServiceImpl.java new file mode 100644 index 00000000..9db36e22 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/platformConfig/PlatformConfigServiceImpl.java @@ -0,0 +1,197 @@ +package com.wansensoft.service.platformConfig; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.platformConfig.PlatformConfig; +import com.wansensoft.entities.platformConfig.PlatformConfigExample; +import com.wansensoft.service.CommonService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.platformConfig.PlatformConfigMapper; +import com.wansensoft.mappers.platformConfig.PlatformConfigMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +@Service +public class PlatformConfigServiceImpl extends ServiceImpl implements PlatformConfigService{ + private Logger logger = LoggerFactory.getLogger(PlatformConfigServiceImpl.class); + + private final CommonService commonService; + private final PlatformConfigMapper platformConfigMapper; + private final PlatformConfigMapperEx platformConfigMapperEx; + + public PlatformConfigServiceImpl(CommonService commonService, PlatformConfigMapper platformConfigMapper, PlatformConfigMapperEx platformConfigMapperEx) { + this.commonService = commonService; + this.platformConfigMapper = platformConfigMapper; + this.platformConfigMapperEx = platformConfigMapperEx; + } + + public PlatformConfig getPlatformConfig(long id) { + PlatformConfig result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.selectByPrimaryKey(id); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getPlatformConfig() { + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria(); + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + list = platformConfigMapper.selectByExample(example); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String platformKey, int offset, int rows) { + List list=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + list = platformConfigMapperEx.selectByConditionPlatformConfig(platformKey, offset, rows); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countPlatformConfig(String platformKey) { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapperEx.countsByPlatformConfig(platformKey); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertPlatformConfig(JSONObject obj, HttpServletRequest request) { + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.insertSelective(platformConfig); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updatePlatformConfig(JSONObject obj, HttpServletRequest request) { + PlatformConfig platformConfig = JSONObject.parseObject(obj.toJSONString(), PlatformConfig.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.updateByPrimaryKeySelective(platformConfig); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deletePlatformConfig(Long id, HttpServletRequest request) { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.deleteByPrimaryKey(id); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeletePlatformConfig(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = platformConfigMapper.deleteByExample(example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int updatePlatformConfigByKey(String platformKey, String platformValue) { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + PlatformConfig platformConfig = new PlatformConfig(); + platformConfig.setPlatformValue(platformValue); + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + result = platformConfigMapper.updateByExampleSelective(platformConfig, example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public PlatformConfig getInfoByKey(String platformKey) { + PlatformConfig platformConfig = new PlatformConfig(); + try{ + if(platformKey.contains("aliOss") || platformKey.contains("weixin")) { + platformConfig = null; + } else { + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + List list = this.baseMapper.getInfoByKey(example); + if(list!=null && !list.isEmpty()){ + platformConfig = list.get(0); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return platformConfig; + } + + /** + * 根据key查询平台信息-内部专用方法 + * @param platformKey + * @return + * @throws Exception + */ + public PlatformConfig getPlatformConfigByKey(String platformKey) { + PlatformConfig platformConfig = new PlatformConfig(); + try{ + PlatformConfigExample example = new PlatformConfigExample(); + example.createCriteria().andPlatformKeyEqualTo(platformKey); + List list=platformConfigMapper.selectByExample(example); + if(list!=null && !list.isEmpty()){ + platformConfig = list.get(0); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return platformConfig; + } +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java b/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java index 542bb800..c5f9f16f 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductAttribute; +import com.wansensoft.entities.ProductAttribute; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品属性表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductAttributeService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java b/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java index bb732d79..1e02a785 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductCategory; +import com.wansensoft.entities.ProductCategory; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品类型表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductCategoryService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java b/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java index d309dd1e..fe87850d 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductExtendPrice; +import com.wansensoft.entities.ProductExtendPrice; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品价格扩展 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductExtendPriceService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java b/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java index 0bf183ff..cf644a70 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductExtendProperty; +import com.wansensoft.entities.ProductExtendProperty; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品扩展字段表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductExtendPropertyService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java b/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java index 966262f2..0fc3f347 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductInventoryCurrent; +import com.wansensoft.entities.ProductInventoryCurrent; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品当前库存 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductInventoryCurrentService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java b/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java index eaaa3c4c..bb178baa 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductInventoryInitial; +import com.wansensoft.entities.ProductInventoryInitial; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品初始库存 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductInventoryInitialService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductService.java b/service/src/main/java/com/wansensoft/service/product/IProductService.java index 872fc176..463b98a8 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.Product; +import com.wansensoft.entities.Product; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 产品表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java b/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java index ee929f53..2ef5bc6f 100644 --- a/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java +++ b/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product; -import com.wansensoft.entities.product.ProductUnit; +import com.wansensoft.entities.ProductUnit; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 多单位表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IProductUnitService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java index 753d8cff..8cda6451 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductAttributeService; -import com.wansensoft.entities.product.ProductAttribute; +import com.wansensoft.entities.ProductAttribute; import com.wansensoft.mappers.product.ProductAttributeMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品属性表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductAttributeServiceImpl extends ServiceImpl implements IProductAttributeService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java index b36fa5a8..fe88d44b 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductCategoryService; -import com.wansensoft.entities.product.ProductCategory; +import com.wansensoft.entities.ProductCategory; import com.wansensoft.mappers.product.ProductCategoryMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品类型表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductCategoryServiceImpl extends ServiceImpl implements IProductCategoryService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java index fed8443d..aa063152 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductExtendPriceService; -import com.wansensoft.entities.product.ProductExtendPrice; +import com.wansensoft.entities.ProductExtendPrice; import com.wansensoft.mappers.product.ProductExtendPriceMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品价格扩展 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductExtendPriceServiceImpl extends ServiceImpl implements IProductExtendPriceService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java index e4e0b6f3..d12301a5 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductExtendPropertyService; -import com.wansensoft.entities.product.ProductExtendProperty; +import com.wansensoft.entities.ProductExtendProperty; import com.wansensoft.mappers.product.ProductExtendPropertyMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品扩展字段表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductExtendPropertyServiceImpl extends ServiceImpl implements IProductExtendPropertyService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java index 5c082c8c..d294218a 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductInventoryCurrentService; -import com.wansensoft.entities.product.ProductInventoryCurrent; +import com.wansensoft.entities.ProductInventoryCurrent; import com.wansensoft.mappers.product.ProductInventoryCurrentMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品当前库存 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductInventoryCurrentServiceImpl extends ServiceImpl implements IProductInventoryCurrentService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java index 7a711303..e8603396 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductInventoryInitialService; -import com.wansensoft.entities.product.ProductInventoryInitial; +import com.wansensoft.entities.ProductInventoryInitial; import com.wansensoft.mappers.product.ProductInventoryInitialMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品初始库存 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductInventoryInitialServiceImpl extends ServiceImpl implements IProductInventoryInitialService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java index 157dcd76..0fb8d4fa 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductService; -import com.wansensoft.entities.product.Product; +import com.wansensoft.entities.Product; import com.wansensoft.mappers.product.ProductMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 产品表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductServiceImpl extends ServiceImpl implements IProductService { diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java index 71fdf880..bda19603 100644 --- a/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.product.impl; import com.wansensoft.service.product.IProductUnitService; -import com.wansensoft.entities.product.ProductUnit; +import com.wansensoft.entities.ProductUnit; import com.wansensoft.mappers.product.ProductUnitMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 多单位表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class ProductUnitServiceImpl extends ServiceImpl implements IProductUnitService { diff --git a/service/src/main/java/com/wansensoft/service/redis/RedisService.java b/service/src/main/java/com/wansensoft/service/redis/RedisService.java new file mode 100644 index 00000000..cc209ae6 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/redis/RedisService.java @@ -0,0 +1,100 @@ +package com.wansensoft.service.redis; + +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * Description + */ +@Component +public class RedisService { + + @Autowired + private RedisTemplate redisTemplate; + + public static final String ACCESS_TOKEN = "X-Access-Token"; + + /** + * @author jisheng hua + * description: + * 从session中获取信息 + *@date: 2021/1/28 18:10 + * @Param: request + * @Param: key + * @return Object + */ + public Object getObjectFromSessionByKey(HttpServletRequest request, String key){ + Object obj=null; + if(request==null){ + return null; + } + String token = request.getHeader(ACCESS_TOKEN); + if(token!=null) { + //开启redis,用户数据放在redis中,从redis中获取 + if(redisTemplate.opsForHash().hasKey(token,key)){ + //redis中存在,拿出来使用 + obj=redisTemplate.opsForHash().get(token,key); + redisTemplate.expire(token, BusinessConstants.MAX_SESSION_IN_SECONDS, TimeUnit.SECONDS); + } + } + return obj; + } + /** + * @author jisheng hua + * description: + * 将信息放入session或者redis中 + *@date: 2021/1/28 18:10 + * @Param: request + * @Param: key + * @Param: obj + * @return + */ + public void storageObjectBySession(String token, String key, Object obj) { + //开启redis,用户数据放到redis中 + redisTemplate.opsForHash().put(token, key, obj.toString()); + redisTemplate.expire(token, BusinessConstants.MAX_SESSION_IN_SECONDS, TimeUnit.SECONDS); + } + /** + * @author jisheng hua + * description: + * 将信息从session或者redis中移除 + *@date: 2021/1/28 18:10 + * @Param: request + * @Param: key + * @Param: obj + * @return + */ + public void deleteObjectBySession(HttpServletRequest request, String key){ + if(request!=null){ + String token = request.getHeader(ACCESS_TOKEN); + if(StringUtil.isNotEmpty(token)){ + //开启redis,用户数据放在redis中,从redis中删除 + redisTemplate.opsForHash().delete(token, key); + } + } + } + + /** + * @author jisheng hua + * 将信息从redis中移除,比对user和ip + * @param userId + * @param clientIp + */ + public void deleteObjectByUserAndIp(Long userId, String clientIp){ + Set tokens = redisTemplate.keys("*"); + for(String token : tokens) { + Object userIdValue = redisTemplate.opsForHash().get(token, "userId"); + Object clientIpValue = redisTemplate.opsForHash().get(token, "clientIp"); + if(userIdValue!=null && clientIpValue!=null && userIdValue.equals(userId.toString()) && clientIpValue.equals(clientIp)) { + redisTemplate.opsForHash().delete(token, "userId"); + } + } + } +} diff --git a/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java b/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java index 23d7c808..75fe761d 100644 --- a/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java +++ b/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java @@ -1,28 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.role; -import com.wansensoft.entities.role.SysRoleMenuRel; +import com.wansensoft.entities.SysRoleMenuRel; import com.baomidou.mybatisplus.extension.service.IService; -import java.util.List; - /** *

* 角色菜单关系表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysRoleMenuRelService extends IService { - List listByRoleId(Long roleId); } diff --git a/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java b/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java index 7a9ba673..eddef6e4 100644 --- a/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java +++ b/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java @@ -1,36 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.role; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.role.RoleListDTO; -import com.wansensoft.entities.role.SysRole; +import com.wansensoft.entities.SysRole; import com.baomidou.mybatisplus.extension.service.IService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.RoleVO; - -import java.util.List; /** *

* 角色表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysRoleService extends IService { - Response> roleList(); - - Response> rolePageList(RoleListDTO roleListDTO); - - Response updateStatus(String id, Integer status); } diff --git a/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelService.kt b/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelService.kt deleted file mode 100644 index 1c9fa5bf..00000000 --- a/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelService.kt +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.role - -import com.wansensoft.entities.role.SysRoleMenuRel -import com.baomidou.mybatisplus.extension.service.IService - -interface KtSysRoleMenuRelService : IService { - - fun listByRoleId(roleId: Long?): List - -} diff --git a/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelServiceImpl.kt b/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelServiceImpl.kt deleted file mode 100644 index 633f7e13..00000000 --- a/service/src/main/java/com/wansensoft/service/role/KtSysRoleMenuRelServiceImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.role - -import com.wansensoft.entities.role.SysRoleMenuRel -import com.wansensoft.mappers.role.SysRoleMenuRelMapper -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl -import org.springframework.stereotype.Service - -@Service -open class KtSysRoleMenuRelServiceImpl : ServiceImpl(), KtSysRoleMenuRelService { - - override fun listByRoleId(roleId: Long?): List { - requireNotNull(roleId) { "roleId must not be null" } - - return lambdaQuery() - .eq(SysRoleMenuRel::getRoleId, roleId) - .list() - } -} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/role/KtSysRoleService.kt b/service/src/main/java/com/wansensoft/service/role/KtSysRoleService.kt deleted file mode 100644 index 0b4d8dc4..00000000 --- a/service/src/main/java/com/wansensoft/service/role/KtSysRoleService.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.wansensoft.service.role - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page -import com.baomidou.mybatisplus.extension.service.IService -import com.wansensoft.dto.role.AddOrUpdateRoleDTO -import com.wansensoft.dto.role.RoleListDTO -import com.wansensoft.entities.role.SysRole -import com.wansensoft.utils.response.Response -import com.wansensoft.vo.RoleVO - -interface KtSysRoleService : IService { - - fun roleList() : Response> - - fun rolePageList(roleListDTO: RoleListDTO?) : Response> - - fun updateStatus(id: String?, status: Int?) : Response - - fun addOrUpdateRole(addOrUpdateRoleDTO : AddOrUpdateRoleDTO?) : Response - - fun deleteRole(id: String?): Response -} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/role/KtSysRoleServiceImpl.kt b/service/src/main/java/com/wansensoft/service/role/KtSysRoleServiceImpl.kt deleted file mode 100644 index aea2b1d1..00000000 --- a/service/src/main/java/com/wansensoft/service/role/KtSysRoleServiceImpl.kt +++ /dev/null @@ -1,149 +0,0 @@ -package com.wansensoft.service.role - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper -import com.baomidou.mybatisplus.extension.plugins.pagination.Page -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl -import com.wansensoft.dto.role.AddOrUpdateRoleDTO -import com.wansensoft.dto.role.RoleListDTO -import com.wansensoft.entities.role.SysRole -import com.wansensoft.mappers.role.SysRoleMapper -import com.wansensoft.utils.SnowflakeIdUtil -import com.wansensoft.utils.constants.CommonConstants -import com.wansensoft.utils.enums.BaseCodeEnum -import com.wansensoft.utils.enums.RoleCodeEnum -import com.wansensoft.utils.response.Response -import com.wansensoft.vo.RoleVO -import org.springframework.beans.BeanUtils -import org.springframework.stereotype.Service -import org.springframework.util.StringUtils -import java.time.LocalDateTime - -@Service -open class KtSysRoleServiceImpl(private val roleMapper: SysRoleMapper) - : ServiceImpl(), KtSysRoleService { - - override fun roleList(): Response> { - val roles = ArrayList() - - val sysRoles = lambdaQuery() - .eq(SysRole::getDeleteFlag, CommonConstants.NOT_DELETED) - .list() - sysRoles.forEach { item -> - val roleVo = RoleVO() - BeanUtils.copyProperties(item, roleVo) - roles.add(roleVo) - } - - return Response.responseData(roles) - } - - override fun rolePageList(roleListDTO: RoleListDTO?): Response> { - val rolePage = roleListDTO?.let { Page(it.page, it.pageSize) } - val roleWrapper = LambdaQueryWrapper().apply { - roleListDTO?.roleName?.let { eq(SysRole::getRoleName, it) } - roleListDTO?.status?.let { eq(SysRole::getStatus, it) } - eq(SysRole::getDeleteFlag, CommonConstants.NOT_DELETED) - } - - val result = rolePage?.run { - roleMapper.selectPage(this, roleWrapper) - if (records.isNotEmpty()) { - val listVo = records.map { role -> - RoleVO().apply { - BeanUtils.copyProperties(role, this) - } - } - Page().apply { - records = listVo - total = this@run.total - pages = this@run.pages - size = this@run.size - } - } else { - Page() - } - } ?: Page() - - return Response.responseData(result) - } - - - override fun updateStatus(id: String?, status: Int?): Response { - if (id.isNullOrBlank() || status == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL) - } - - val updateResult = lambdaUpdate() - .eq(SysRole::getId, id) - .set(SysRole::getStatus, status) - .update() - - return if (updateResult) { - Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_STATUS_SUCCESS) - } else { - Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_STATUS_ERROR) - } - } - - override fun addOrUpdateRole(addOrUpdateRoleDTO: AddOrUpdateRoleDTO?): Response { - return addOrUpdateRoleDTO?.let { dto -> - if (dto.id == null) { - // add - val sysRole = SysRole().apply { - id = SnowflakeIdUtil.nextId() - roleName = dto.roleName - type = dto.type - priceLimit = dto.priceLimit - status = dto.status - description = dto.description - createTime = LocalDateTime.now() - } - - val saveResult = save(sysRole) - if (!saveResult) { - Response.responseMsg(RoleCodeEnum.ADD_ROLE_ERROR) - } else { - Response.responseMsg(RoleCodeEnum.ADD_ROLE_SUCCESS) - } - } else { - // update - val updateResult = lambdaUpdate().apply { - eq(SysRole::getId, dto.id) - set(SysRole::getRoleName, dto.roleName) - set(SysRole::getType, dto.type) - set(SysRole::getStatus, dto.status) - set(SysRole::getPriceLimit, dto.priceLimit) - set(SysRole::getDescription, dto.description) - set(SysRole::getUpdateTime, LocalDateTime.now()) - }.update() - - if (!updateResult) { - Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_ERROR) - } else { - Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_SUCCESS) - } - } - } ?: Response.responseMsg(BaseCodeEnum.PARAMETER_NULL) - } - - override fun deleteRole(id: String?): Response { - id?.let { roleId -> - if (roleId.isBlank()) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL) - } - val deleteResult = lambdaUpdate() - .eq(SysRole::getId, roleId) - .set(SysRole::getDeleteFlag, CommonConstants.DELETED) - .update() - - return if (deleteResult) { - Response.responseMsg(RoleCodeEnum.DELETE_ROLE_SUCCESS) - } else { - Response.responseMsg(RoleCodeEnum.DELETE_ROLE_ERROR) - } - } - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL) - } - - -} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/role/RoleComponent.java b/service/src/main/java/com/wansensoft/service/role/RoleComponent.java new file mode 100644 index 00000000..6b70bb59 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/RoleComponent.java @@ -0,0 +1,74 @@ +package com.wansensoft.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@RoleResource +public class RoleComponent implements ICommonQuery { + + private final RoleService roleService; + + public RoleComponent(RoleService roleService) { + this.roleService = roleService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return roleService.getRole(id); + } + + @Override + public List select(Map map)throws Exception { + return getRoleList(map); + } + + private List getRoleList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String description = StringUtil.getInfo(search, "description"); + return roleService.select(name, description, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String description = StringUtil.getInfo(search, "description"); + return roleService.countRole(name, description); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return roleService.insertRole(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return roleService.updateRole(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return roleService.deleteRole(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return roleService.batchDeleteRole(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return roleService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/role/RoleResource.java b/service/src/main/java/com/wansensoft/service/role/RoleResource.java new file mode 100644 index 00000000..73583ae7 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/RoleResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.role; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "role") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface RoleResource { +} diff --git a/service/src/main/java/com/wansensoft/service/role/RoleService.java b/service/src/main/java/com/wansensoft/service/role/RoleService.java new file mode 100644 index 00000000..9f40dcb8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/RoleService.java @@ -0,0 +1,52 @@ +package com.wansensoft.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.role.RoleEx; +import com.wansensoft.entities.role.RoleExample; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.constants.BusinessConstants; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; + +public interface RoleService extends IService { + + Role getRole(long id); + + List getRoleListByIds(String ids); + + List allList(); + + List select(String name, String description, int offset, int rows); + + Long countRole(String name, String description); + + int insertRole(JSONObject obj, HttpServletRequest request); + + int updateRole(JSONObject obj, HttpServletRequest request); + + int deleteRole(Long id, HttpServletRequest request); + + int batchDeleteRole(String ids, HttpServletRequest request); + + List findUserRole(); + + int batchDeleteRoleByIds(String ids); + + Role getRoleWithoutTenant(Long roleId); + + int batchSetStatus(Boolean status, String ids); + + Object parseHomePriceByLimit(BigDecimal price, String type, String priceLimit, String emptyInfo, HttpServletRequest request); + + BigDecimal parseBillPriceByLimit(BigDecimal price, String billCategory, String priceLimit, HttpServletRequest request); + + Object parseMaterialPriceByLimit(BigDecimal price, String type, String emptyInfo, HttpServletRequest request); + + String getCurrentPriceLimit(HttpServletRequest request); + + int checkIsNameExist(Long id, String name); +} diff --git a/service/src/main/java/com/wansensoft/service/role/RoleServiceImpl.java b/service/src/main/java/com/wansensoft/service/role/RoleServiceImpl.java new file mode 100644 index 00000000..6e692306 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/RoleServiceImpl.java @@ -0,0 +1,298 @@ +package com.wansensoft.service.role; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.role.RoleEx; +import com.wansensoft.entities.role.RoleExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.role.RoleMapper; +import com.wansensoft.mappers.role.RoleMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class RoleServiceImpl extends ServiceImpl implements RoleService{ + private Logger logger = LoggerFactory.getLogger(RoleServiceImpl.class); + + private final RoleMapper roleMapper; + private final RoleMapperEx roleMapperEx; + private final LogService logService; + private final UserService userService; + + public RoleServiceImpl(RoleMapper roleMapper, RoleMapperEx roleMapperEx, LogService logService, UserService userService) { + this.roleMapper = roleMapper; + this.roleMapperEx = roleMapperEx; + this.logService = logService; + this.userService = userService; + } + + public Role getRole(long id) { + Role result=null; + try{ + result=roleMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getRoleListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + RoleExample example = new RoleExample(); + example.createCriteria().andIdIn(idList); + list = roleMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List allList() { + RoleExample example = new RoleExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, String description, int offset, int rows) { + List list=null; + try{ + list=roleMapperEx.selectByConditionRole(name, description, offset, rows); + for(RoleEx roleEx: list) { + String priceLimit = roleEx.getPriceLimit(); + if(StringUtil.isNotEmpty(priceLimit)) { + String priceLimitStr = priceLimit + .replace("1", "屏蔽首页采购价") + .replace("2", "屏蔽首页零售价") + .replace("3", "屏蔽首页销售价") + .replace("4", "屏蔽单据采购价") + .replace("5", "屏蔽单据零售价") + .replace("6", "屏蔽单据销售价"); + roleEx.setPriceLimitStr(priceLimitStr); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countRole(String name, String description) { + Long result=null; + try{ + result=roleMapperEx.countsByRole(name, description); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertRole(JSONObject obj, HttpServletRequest request) { + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + role.setEnabled(true); + result=roleMapper.insertSelective(role); + logService.insertLog("角色", + BusinessConstants.LOG_OPERATION_TYPE_ADD + role.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateRole(JSONObject obj, HttpServletRequest request) { + Role role = JSONObject.parseObject(obj.toJSONString(), Role.class); + int result=0; + try{ + result=roleMapper.updateByPrimaryKeySelective(role); + logService.insertLog("角色", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + role.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteRole(Long id, HttpServletRequest request) { + return batchDeleteRoleByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRole(String ids, HttpServletRequest request) { + return batchDeleteRoleByIds(ids); + } + + public int checkIsNameExist(Long id, String name) { + RoleExample example = new RoleExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public List findUserRole() { + RoleExample example = new RoleExample(); + example.setOrderByClause("Id"); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=roleMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + /** + * 逻辑删除角色信息 + * @Param: ids + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteRoleByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getRoleListByIds(ids); + for(Role role: list){ + sb.append("[").append(role.getName()).append("]"); + } + logService.insertLog("角色", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result=roleMapperEx.batchDeleteRoleByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public Role getRoleWithoutTenant(Long roleId) { + return roleMapperEx.getRoleWithoutTenant(roleId); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("角色", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List roleIds = StringUtil.strToLongList(ids); + Role role = new Role(); + role.setEnabled(status); + RoleExample example = new RoleExample(); + example.createCriteria().andIdIn(roleIds); + int result=0; + try{ + result = roleMapper.updateByExampleSelective(role, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + /** + * 根据权限进行屏蔽价格-首页 + * @param price + * @param type + * @return + */ + public Object parseHomePriceByLimit(BigDecimal price, String type, String priceLimit, String emptyInfo, HttpServletRequest request) { + if(StringUtil.isNotEmpty(priceLimit)) { + if("buy".equals(type) && priceLimit.contains("1")) { + return emptyInfo; + } + if("retail".equals(type) && priceLimit.contains("2")) { + return emptyInfo; + } + if("sale".equals(type) && priceLimit.contains("3")) { + return emptyInfo; + } + } + return price; + } + + /** + * 根据权限进行屏蔽价格-单据 + * @param price + * @param billCategory + * @param priceLimit + * @param request + * @return + * @throws Exception + */ + public BigDecimal parseBillPriceByLimit(BigDecimal price, String billCategory, String priceLimit, HttpServletRequest request) { + if(StringUtil.isNotEmpty(priceLimit)) { + if("buy".equals(billCategory) && priceLimit.contains("4")) { + return BigDecimal.ZERO; + } + if("retail".equals(billCategory) && priceLimit.contains("5")) { + return BigDecimal.ZERO; + } + if("sale".equals(billCategory) && priceLimit.contains("6")) { + return BigDecimal.ZERO; + } + } + return price; + } + + /** + * 根据权限进行屏蔽价格-物料 + * @param price + * @param type + * @return + */ + public Object parseMaterialPriceByLimit(BigDecimal price, String type, String emptyInfo, HttpServletRequest request) { + Long userId = userService.getUserId(request); + String priceLimit = userService.getRoleTypeByUserId(userId).getPriceLimit(); + if(StringUtil.isNotEmpty(priceLimit)) { + if("buy".equals(type) && priceLimit.contains("4")) { + return emptyInfo; + } + if("retail".equals(type) && priceLimit.contains("5")) { + return emptyInfo; + } + if("sale".equals(type) && priceLimit.contains("6")) { + return emptyInfo; + } + } + return price; + } + + public String getCurrentPriceLimit(HttpServletRequest request) { + Long userId = userService.getUserId(request); + return userService.getRoleTypeByUserId(userId).getPriceLimit(); + } +} diff --git a/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java index 38bac9eb..c1924b3f 100644 --- a/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java @@ -1,36 +1,19 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.role; -import com.wansensoft.entities.role.SysRoleMenuRel; +import com.wansensoft.entities.SysRoleMenuRel; import com.wansensoft.mappers.role.SysRoleMenuRelMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import java.util.List; - /** *

* 角色菜单关系表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class SysRoleMenuRelServiceImpl extends ServiceImpl implements ISysRoleMenuRelService { - @Override - public List listByRoleId(Long roleId) { - return lambdaQuery() - .eq(SysRoleMenuRel::getRoleId, roleId) - .list(); - } } diff --git a/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java b/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java index 762f6110..dec316ec 100644 --- a/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java @@ -1,104 +1,19 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.role; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.role.RoleListDTO; -import com.wansensoft.entities.role.SysRole; +import com.wansensoft.entities.SysRole; import com.wansensoft.mappers.role.SysRoleMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansensoft.utils.enums.BaseCodeEnum; -import com.wansensoft.utils.enums.RoleCodeEnum; -import com.wansensoft.utils.enums.test; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.RoleVO; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import java.util.ArrayList; -import java.util.List; /** *

* 角色表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class SysRoleServiceImpl extends ServiceImpl implements ISysRoleService { - private final SysRoleMapper roleMapper; - - public SysRoleServiceImpl(SysRoleMapper roleMapper) { - this.roleMapper = roleMapper; - } - - @Override - public Response> roleList() { - var roles = new ArrayList(); - - var sysRoles = lambdaQuery().list(); - sysRoles.forEach(item -> { - var roleVo = new RoleVO(); - BeanUtils.copyProperties(item, roleVo); - roles.add(roleVo); - }); - - return Response.responseData(roles); - } - - @Override - public Response> rolePageList(RoleListDTO roleListDTO) { - var result = new Page(); - var listVo = new ArrayList(); - - Page rolePage = new Page<>(roleListDTO.getPage(), roleListDTO.getPageSize()); - LambdaQueryWrapper roleWrapper = new LambdaQueryWrapper<>(); - roleWrapper.eq(StringUtils.hasText(roleListDTO.getRoleName()), SysRole::getRoleName, roleListDTO.getRoleName()); - roleWrapper.eq(roleListDTO.getStatus() != null, SysRole::getStatus, roleListDTO.getStatus()); - - roleMapper.selectPage(rolePage, roleWrapper); - if(!rolePage.getRecords().isEmpty()) { - rolePage.getRecords().forEach(role -> { - var roleVo = new RoleVO(); - BeanUtils.copyProperties(role, roleVo); - listVo.add(roleVo); - }); - } - result.setRecords(listVo); - result.setTotal(rolePage.getTotal()); - result.setSize(rolePage.getSize()); - result.setPages(rolePage.getPages()); - - return Response.responseData(result); - } - - @Override - public Response updateStatus(String id, Integer status) { - if(!StringUtils.hasText(id) && status == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - var updateResult = lambdaUpdate() - .eq(SysRole::getId, id) - .set(SysRole::getStatus, status) - .update(); - - if(!updateResult) { - return Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_STATUS_ERROR); - } - - return Response.responseMsg(RoleCodeEnum.UPDATE_ROLE_STATUS_SUCCESS); - } } diff --git a/service/src/main/java/com/wansensoft/service/sequence/SequenceComponent.java b/service/src/main/java/com/wansensoft/service/sequence/SequenceComponent.java new file mode 100644 index 00000000..f6f9aac1 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/sequence/SequenceComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * Description + */ +@Service +@SequenceResource +public class SequenceComponent implements ICommonQuery { + private final SequenceService sequenceService; + + public SequenceComponent(SequenceService sequenceService) { + this.sequenceService = sequenceService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return sequenceService.getSequence(id); + } + + @Override + public List select(Map map)throws Exception { + return getSequenceList(map); + } + + private List getSequenceList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return sequenceService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return sequenceService.countSequence(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return sequenceService.insertSequence(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return sequenceService.updateSequence(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return sequenceService.deleteSequence(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return sequenceService.batchDeleteSequence(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name) throws Exception{ + return sequenceService.checkIsNameExist(id, name); + } +} diff --git a/service/src/main/java/com/wansensoft/service/sequence/SequenceResource.java b/service/src/main/java/com/wansensoft/service/sequence/SequenceResource.java new file mode 100644 index 00000000..08fb10c4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/sequence/SequenceResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.sequence; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "sequence") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SequenceResource { +} diff --git a/service/src/main/java/com/wansensoft/service/sequence/SequenceService.java b/service/src/main/java/com/wansensoft/service/sequence/SequenceService.java new file mode 100644 index 00000000..35a94dc4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/sequence/SequenceService.java @@ -0,0 +1,31 @@ +package com.wansensoft.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.Sequence; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface SequenceService extends IService { + + String buildOnlyNumber(); + + SerialNumber getSequence(long id); + + List select(String name, Integer offset, Integer rows); + + Long countSequence(String name); + + int insertSequence(JSONObject obj, HttpServletRequest request); + + int updateSequence(JSONObject obj, HttpServletRequest request); + + int deleteSequence(Long id, HttpServletRequest request); + + int batchDeleteSequence(String ids, HttpServletRequest request); + + int checkIsNameExist(Long id, String serialNumber); +} diff --git a/service/src/main/java/com/wansensoft/service/sequence/SequenceServiceImpl.java b/service/src/main/java/com/wansensoft/service/sequence/SequenceServiceImpl.java new file mode 100644 index 00000000..c60230a4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/sequence/SequenceServiceImpl.java @@ -0,0 +1,93 @@ +package com.wansensoft.service.sequence; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.Sequence; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import com.wansensoft.mappers.serialNumber.SequenceMapperEx; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * Description + */ +@Service +public class SequenceServiceImpl extends ServiceImpl implements SequenceService{ + private Logger logger = LoggerFactory.getLogger(SequenceServiceImpl.class); + + private final SequenceMapperEx sequenceMapperEx; + + public SequenceServiceImpl(SequenceMapperEx sequenceMapperEx) { + this.sequenceMapperEx = sequenceMapperEx; + } + + public SerialNumber getSequence(long id) { + return null; + } + + public List select(String name, Integer offset, Integer rows) { + return null; + } + + public Long countSequence(String name) { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSequence(JSONObject obj, HttpServletRequest request) { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSequence(JSONObject obj, HttpServletRequest request) { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSequence(Long id, HttpServletRequest request) { + return 0; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSequence(String ids, HttpServletRequest request) { + return 0; + } + + public int checkIsNameExist(Long id, String serialNumber) { + return 0; + } + + /** + * 创建一个唯一的序列号 + * */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public String buildOnlyNumber() { + Long buildOnlyNumber=null; + synchronized (this){ + try{ + sequenceMapperEx.updateBuildOnlyNumber(); //编号+1 + buildOnlyNumber= sequenceMapperEx.getBuildOnlyNumber(BusinessConstants.DEPOT_NUMBER_SEQ); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + if(buildOnlyNumber select(Map map)throws Exception { + return getSerialNumberList(map); + } + + private List getSerialNumberList(Map map) throws Exception{ + String search = map.get(Constants.SEARCH); + String serialNumber = StringUtil.getInfo(search, "serialNumber"); + String materialName = StringUtil.getInfo(search, "materialName"); + return serialNumberService.select(serialNumber,materialName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String serialNumber = StringUtil.getInfo(search, "serialNumber"); + String materialName = StringUtil.getInfo(search, "materialName"); + return serialNumberService.countSerialNumber(serialNumber, materialName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return serialNumberService.insertSerialNumber(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return serialNumberService.updateSerialNumber(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return serialNumberService.deleteSerialNumber(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return serialNumberService.batchDeleteSerialNumber(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String serialNumber) throws Exception{ + return serialNumberService.checkIsNameExist(id, serialNumber); + } +} diff --git a/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberResource.java b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberResource.java new file mode 100644 index 00000000..e837783c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberResource.java @@ -0,0 +1,15 @@ +package com.wansensoft.service.serialNumber; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +/** + * Description + */ +@ResourceInfo(value = "serialNumber") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SerialNumberResource { +} diff --git a/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberService.java b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberService.java new file mode 100644 index 00000000..e55d7549 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberService.java @@ -0,0 +1,57 @@ +package com.wansensoft.service.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import com.wansensoft.entities.serialNumber.SerialNumberExample; +import com.wansensoft.entities.user.User; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface SerialNumberService extends IService { + + SerialNumber getSerialNumber(long id); + + List getSerialNumberListByIds(String ids); + + List getSerialNumber(); + + int insertSerialNumber(JSONObject obj, HttpServletRequest request); + + int updateSerialNumber(JSONObject obj, HttpServletRequest request); + + int deleteSerialNumber(Long id, HttpServletRequest request); + + int batchDeleteSerialNumber(String ids, HttpServletRequest request); + + int batchDeleteSerialNumberByIds(String ids); + + int checkIsNameExist(Long id, String serialNumber); + + Long checkMaterialName(String materialName); + + Long getSerialNumberMaterialIdByBarCode(String materialCode); + + void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo, User userInfo, String snList); + + int sellSerialNumber(Long materialId, String outBillNo, String snList, User user); + + int cancelSerialNumber(Long materialId, String outBillNo,int count,User user); + + int batAddSerialNumber(String materialCode, String serialNumberPrefix, Integer batAddTotal, String remark); + + List getEnableSerialNumberList(String number, String name, Long depotId, String barCode, Integer offset, Integer rows); + + Long getEnableSerialNumberCount(String number, String name, Long depotId, String barCode); + + void addSerialNumberByBill(String type, String subType, String inBillNo, Long materialId, Long depotId, String snList); + + void deleteByExample(SerialNumberExample example); + + List select(String serialNumber, String materialName, Integer offset, Integer rows); + + Long countSerialNumber(String serialNumber,String materialName); +} diff --git a/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberServiceImpl.java b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberServiceImpl.java new file mode 100644 index 00000000..9be19925 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/serialNumber/SerialNumberServiceImpl.java @@ -0,0 +1,434 @@ +package com.wansensoft.service.serialNumber; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.depot.DepotItem; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.material.MaterialVo4Unit; +import com.wansensoft.entities.serialNumber.SerialNumber; +import com.wansensoft.entities.serialNumber.SerialNumberEx; +import com.wansensoft.entities.serialNumber.SerialNumberExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.material.MaterialMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.material.MaterialService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.serialNumber.SerialNumberMapper; +import com.wansensoft.mappers.serialNumber.SerialNumberMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Description + */ +@Service +public class SerialNumberServiceImpl extends ServiceImpl implements SerialNumberService{ + private Logger logger = LoggerFactory.getLogger(SerialNumberServiceImpl.class); + + private final SerialNumberMapper serialNumberMapper; + private final SerialNumberMapperEx serialNumberMapperEx; + private final MaterialMapperEx materialMapperEx; + private final CommonService commonService; + private final UserService userService; + private final LogService logService; + + public SerialNumberServiceImpl(SerialNumberMapper serialNumberMapper, SerialNumberMapperEx serialNumberMapperEx, MaterialMapperEx materialMapperEx, CommonService commonService, UserService userService, LogService logService) { + this.serialNumberMapper = serialNumberMapper; + this.serialNumberMapperEx = serialNumberMapperEx; + this.materialMapperEx = materialMapperEx; + this.commonService = commonService; + this.userService = userService; + this.logService = logService; + } + + + public SerialNumber getSerialNumber(long id) { + SerialNumber result=null; + try{ + result=serialNumberMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSerialNumberListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andIdIn(idList); + list = serialNumberMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getSerialNumber() { + SerialNumberExample example = new SerialNumberExample(); + List list=null; + try{ + list=serialNumberMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String serialNumber, String materialName, Integer offset, Integer rows) { + return null; + + } + + public Long countSerialNumber(String serialNumber,String materialName) { + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSerialNumber(JSONObject obj, HttpServletRequest request) { + int result=0; + try{ + SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class); + /**处理商品id*/ + serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode())); + //删除标记,默认未删除 + serialNumberEx.setDeleteFlag(BusinessConstants.DELETE_FLAG_EXISTS); + //已卖出,默认未否 + serialNumberEx.setIsSell(BusinessConstants.IS_SELL_HOLD); + Date date=new Date(); + serialNumberEx.setCreateTime(date); + serialNumberEx.setUpdateTime(date); + User userInfo= userService.getCurrentUser(); + serialNumberEx.setCreator(userInfo==null?null:userInfo.getId()); + serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); + result = serialNumberMapperEx.addSerialNumber(serialNumberEx); + logService.insertLog("序列号",BusinessConstants.LOG_OPERATION_TYPE_ADD, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSerialNumber(JSONObject obj, HttpServletRequest request) { + SerialNumberEx serialNumberEx = JSONObject.parseObject(obj.toJSONString(), SerialNumberEx.class); + int result=0; + try{ + serialNumberEx.setMaterialId(getSerialNumberMaterialIdByBarCode(serialNumberEx.getMaterialCode())); + Date date=new Date(); + serialNumberEx.setUpdateTime(date); + User userInfo= userService.getCurrentUser(); + serialNumberEx.setUpdater(userInfo==null?null:userInfo.getId()); + result = serialNumberMapperEx.updateSerialNumber(serialNumberEx); + logService.insertLog("序列号", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + serialNumberEx.getId(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSerialNumber(Long id, HttpServletRequest request) { + return batchDeleteSerialNumberByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumber(String ids, HttpServletRequest request) { + return batchDeleteSerialNumberByIds(ids); + } + + /** + * 逻辑删除序列号信息 + * @Param: ids + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSerialNumberByIds(String ids) { + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getSerialNumberListByIds(ids); + for(SerialNumber serialNumber: list){ + sb.append("[").append(serialNumber.getSerialNumber()).append("]"); + } + logService.insertLog("序列号", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = serialNumberMapperEx.batchDeleteSerialNumberByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String serialNumber) { + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andIdNotEqualTo(id).andSerialNumberEqualTo(serialNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=serialNumberMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + /** + * description: + * 根据商品名称判断商品名称是否有效 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long checkMaterialName(String materialName) { + if(StringUtil.isNotEmpty(materialName)) { + List mlist=null; + try{ + mlist = materialMapperEx.findByMaterialName(materialName); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if (mlist == null || mlist.size() < 1) { + //商品名称不存在 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_EXISTS_CODE, + ExceptionConstants.MATERIAL_NOT_EXISTS_MSG); + } + if (mlist.size() > 1) { + //商品信息不唯一 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ONLY_CODE, + ExceptionConstants.MATERIAL_NOT_ONLY_MSG); + + } + //获得唯一商品 + if (BusinessConstants.ENABLE_SERIAL_NUMBER_NOT_ENABLED.equals(mlist.get(0).getEnableSerialNumber())) { + //商品未开启序列号 + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE, + ExceptionConstants.MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG); + } + return mlist.get(0).getId(); + } + return null; + } + /** + * description: + * 根据商品名称判断给商品添加序列号是否可行 + * 1、根据商品名称必须查询到唯一的商品 + * 2、该商品必须已经启用序列号 + * 3、该商品已绑定序列号数量小于商品现有库存 + * 用商品的库存去限制序列号的添加有点不合乎道理,去掉此限制 + * @Param: materialName + * @return Long 满足使用条件的商品的id + */ + public Long getSerialNumberMaterialIdByBarCode(String materialCode) { + if(StringUtil.isNotEmpty(materialCode)){ + //计算商品库存和目前占用的可用序列号数量关系 + //库存=入库-出库 + //入库数量 + Long materialId = 0L; + List list = commonService.getMaterialByBarCode(materialCode); + if(list!=null && !list.isEmpty()) { + materialId = list.get(0).getId(); + } + return materialId; + } + return null; + } + + /** + * description: + * 出库时判断序列号库存是否足够, + * 同时将对应的序列号绑定单据 + * @Param: List + * @return void + */ + public void checkAndUpdateSerialNumber(DepotItem depotItem, String outBillNo, User userInfo, String snList) { + if(depotItem!=null){ + sellSerialNumber(depotItem.getMaterialId(), outBillNo, snList,userInfo); + } + } + + /** + * description: + * 卖出序列号 + * create time: 2019/1/25 9:17 + * @Param: materialId + * @Param: depotheadId + * @Param: isSell 卖出'1' + * @Param: Count 卖出或者赎回的数量 + * @return com.jsh.erp.datasource.entities.SerialNumberEx + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int sellSerialNumber(Long materialId, String outBillNo, String snList, User user) { + int result=0; + try{ + //将中文的逗号批量替换为英文逗号 + snList = snList.replaceAll(",",","); + String [] snArray=snList.split(","); + result = serialNumberMapperEx.sellSerialNumber(materialId, outBillNo, snArray, new Date(),user==null?null:user.getId()); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + /** + * description: + * 赎回序列号 + * create time: 2019/1/25 9:17 + * @Param: materialId + * @Param: depotheadId + * @Param: isSell 赎回'0' + * @Param: Count 卖出或者赎回的数量 + * @return com.jsh.erp.datasource.entities.SerialNumberEx + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int cancelSerialNumber(Long materialId, String outBillNo,int count,User user) { + int result=0; + try{ + result = serialNumberMapperEx.cancelSerialNumber(materialId,outBillNo,count,new Date(),user==null?null:user.getId()); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + /** + * description: + *批量添加序列号,最多500个 + * @Param: materialName + * @Param: serialNumberPrefix + * @Param: batAddTotal + * @Param: remark + * @return java.lang.Object + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batAddSerialNumber(String materialCode, String serialNumberPrefix, Integer batAddTotal, String remark) { + int result=0; + try { + if (StringUtil.isNotEmpty(materialCode)) { + //查询商品id + Long materialId = getSerialNumberMaterialIdByBarCode(materialCode); + List list = null; + //当前用户 + User userInfo = userService.getCurrentUser(); + Long userId = userInfo == null ? null : userInfo.getId(); + Date date = null; + Long million = null; + synchronized (this) { + date = new Date(); + million = date.getTime(); + } + int insertNum = 0; + StringBuffer prefixBuf = new StringBuffer(serialNumberPrefix).append(million); + list = new ArrayList(); + int forNum = BusinessConstants.BATCH_INSERT_MAX_NUMBER >= batAddTotal ? batAddTotal : BusinessConstants.BATCH_INSERT_MAX_NUMBER; + for (int i = 0; i < forNum; i++) { + insertNum++; + SerialNumberEx each = new SerialNumberEx(); + each.setMaterialId(materialId); + each.setCreator(userId); + each.setCreateTime(date); + each.setUpdater(userId); + each.setUpdateTime(date); + each.setRemark(remark); + each.setSerialNumber(new StringBuffer(prefixBuf.toString()).append(insertNum).toString()); + list.add(each); + } + result = serialNumberMapperEx.batAddSerialNumber(list); + logService.insertLog("序列号", + BusinessConstants.LOG_OPERATION_TYPE_BATCH_ADD + batAddTotal + BusinessConstants.LOG_DATA_UNIT, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } + } catch (Exception e) { + JshException.writeFail(logger, e); + } + return result; + } + + public List getEnableSerialNumberList(String number, String name, Long depotId, String barCode, Integer offset, Integer rows) { + List list =null; + try{ + list = serialNumberMapperEx.getEnableSerialNumberList(StringUtil.toNull(number), StringUtil.toNull(name), depotId, barCode, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long getEnableSerialNumberCount(String number, String name, Long depotId, String barCode) { + Long count = 0L; + try{ + count = serialNumberMapperEx.getEnableSerialNumberCount(StringUtil.toNull(number), StringUtil.toNull(name), depotId, barCode); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return count; + } + + public void addSerialNumberByBill(String type, String subType, String inBillNo, Long materialId, Long depotId, String snList) { + //录入序列号的时候不能重复 + if ((BusinessConstants.SUB_TYPE_PURCHASE.equals(subType) || + BusinessConstants.SUB_TYPE_OTHER.equals(subType) || + BusinessConstants.SUB_TYPE_SALES_RETURN.equals(subType)|| + BusinessConstants.SUB_TYPE_RETAIL_RETURN.equals(subType)) && + BusinessConstants.DEPOTHEAD_TYPE_IN.equals(type)) { + //将中文的逗号批量替换为英文逗号 + snList = snList.replaceAll(",", ","); + List snArr = StringUtil.strToStringList(snList); + for (String sn : snArr) { + List list = new ArrayList<>(); + SerialNumberExample example = new SerialNumberExample(); + example.createCriteria().andMaterialIdEqualTo(materialId).andSerialNumberEqualTo(sn.trim()).andIsSellEqualTo("0") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list = serialNumberMapper.selectByExample(example); + //判断如果不存在重复序列号就新增 + if (list == null || list.size() == 0) { + SerialNumber serialNumber = new SerialNumber(); + serialNumber.setMaterialId(materialId); + serialNumber.setDepotId(depotId); + serialNumber.setSerialNumber(sn); + Date date = new Date(); + serialNumber.setCreateTime(date); + serialNumber.setUpdateTime(date); + User userInfo = userService.getCurrentUser(); + serialNumber.setCreator(userInfo == null ? null : userInfo.getId()); + serialNumber.setUpdater(userInfo == null ? null : userInfo.getId()); + serialNumber.setInBillNo(inBillNo); + serialNumberMapper.insertSelective(serialNumber); + } else { + if(!inBillNo.equals(list.get(0).getInBillNo())) { + throw new BusinessRunTimeException(ExceptionConstants.SERIAL_NUMBERE_ALREADY_EXISTS_CODE, + String.format(ExceptionConstants.SERIAL_NUMBERE_ALREADY_EXISTS_MSG, sn)); + } + } + } + } + } + + /** + * 直接删除序列号 + * @param example + */ + public void deleteByExample(SerialNumberExample example) { + serialNumberMapper.deleteByExample(example); + } +} diff --git a/service/src/main/java/com/wansensoft/service/supplier/SupplierComponent.java b/service/src/main/java/com/wansensoft/service/supplier/SupplierComponent.java new file mode 100644 index 00000000..e8e11c02 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/supplier/SupplierComponent.java @@ -0,0 +1,80 @@ +package com.wansensoft.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@SupplierResource +public class SupplierComponent implements ICommonQuery { + + private final SupplierService supplierService; + + public SupplierComponent(SupplierService supplierService) { + this.supplierService = supplierService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return supplierService.getSupplier(id); + } + + @Override + public List select(Map map)throws Exception { + return getSupplierList(map); + } + + private List getSupplierList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String supplier = StringUtil.getInfo(search, "supplier"); + String type = StringUtil.getInfo(search, "type"); + String phonenum = StringUtil.getInfo(search, "phonenum"); + String telephone = StringUtil.getInfo(search, "telephone"); + String roleType = StringUtil.getInfo(search, "roleType"); + return supplierService.select(supplier, type, phonenum, telephone, roleType, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String supplier = StringUtil.getInfo(search, "supplier"); + String type = StringUtil.getInfo(search, "type"); + String phonenum = StringUtil.getInfo(search, "phonenum"); + String telephone = StringUtil.getInfo(search, "telephone"); + String roleType = StringUtil.getInfo(search, "roleType"); + return supplierService.countSupplier(supplier, type, phonenum, telephone, roleType); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return supplierService.insertSupplier(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return supplierService.updateSupplier(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return supplierService.deleteSupplier(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return supplierService.batchDeleteSupplier(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return supplierService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/supplier/SupplierResource.java b/service/src/main/java/com/wansensoft/service/supplier/SupplierResource.java new file mode 100644 index 00000000..05d8891e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/supplier/SupplierResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.supplier; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "supplier") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SupplierResource { +} diff --git a/service/src/main/java/com/wansensoft/service/supplier/SupplierService.java b/service/src/main/java/com/wansensoft/service/supplier/SupplierService.java new file mode 100644 index 00000000..97667fbc --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/supplier/SupplierService.java @@ -0,0 +1,71 @@ +package com.wansensoft.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.utils.BaseResponseInfo; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface SupplierService extends IService { + + Supplier getSupplier(long id); + + List getSupplierListByIds(String ids); + + List getSupplier(); + + List select(String supplier, String type, String phonenum, String telephone, String roleType, int offset, int rows); + + Long countSupplier(String supplier, String type, String phonenum, String telephone, String roleType); + + int insertSupplier(JSONObject obj, HttpServletRequest request); + + int updateSupplier(JSONObject obj, HttpServletRequest request); + + int deleteSupplier(Long id, HttpServletRequest request); + + int batchDeleteSupplier(String ids, HttpServletRequest request); + + int batchDeleteSupplierByIds(String ids); + + int checkIsNameExist(Long id, String name); + + int checkIsNameAndTypeExist(Long id, String name, String type); + + int updateAdvanceIn(Long supplierId, BigDecimal advanceIn); + + List findBySelectCus(); + + List findBySelectSup(); + + List findBySelectRetail(); + + List findById(Long supplierId); + + int batchSetStatus(Boolean status, String ids); + + List findUserCustomer(); + + List findByAll(String supplier, String type, String phonenum, String telephone); + + Map getBeginNeedByOrganId(Long organId); + + void importVendor(MultipartFile file, HttpServletRequest request); + + void importCustomer(MultipartFile file, HttpServletRequest request); + + void importMember(MultipartFile file, HttpServletRequest request); + + BaseResponseInfo importExcel(List mList, String type); + + BigDecimal parseBigDecimalEx(String str); + + File exportExcel(List dataList, String type); + +} diff --git a/service/src/main/java/com/wansensoft/service/supplier/SupplierServiceImpl.java b/service/src/main/java/com/wansensoft/service/supplier/SupplierServiceImpl.java new file mode 100644 index 00000000..1ddcf93a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/supplier/SupplierServiceImpl.java @@ -0,0 +1,666 @@ +package com.wansensoft.service.supplier; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.account.AccountHead; +import com.wansensoft.entities.depot.DepotHead; +import com.wansensoft.entities.supplier.Supplier; +import com.wansensoft.entities.supplier.SupplierExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.mappers.account.AccountHeadMapperEx; +import com.wansensoft.mappers.account.AccountItemMapperEx; +import com.wansensoft.mappers.depot.DepotHeadMapperEx; +import com.wansensoft.service.depotHead.DepotHeadService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.supplier.SupplierMapper; +import com.wansensoft.mappers.supplier.SupplierMapperEx; +import com.wansensoft.utils.BaseResponseInfo; +import com.wansensoft.utils.ExcelUtils; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.vo.DepotHeadVo4StatementAccount; +import jxl.Sheet; +import jxl.Workbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import jakarta.servlet.http.HttpServletRequest; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; + + +@Service +public class SupplierServiceImpl extends ServiceImpl implements SupplierService { + private Logger logger = LoggerFactory.getLogger(SupplierServiceImpl.class); + + private final SupplierMapper supplierMapper; + private final SupplierMapperEx supplierMapperEx; + private final LogService logService; + private final UserService userService; + private final AccountHeadMapperEx accountHeadMapperEx; + private final DepotHeadMapperEx depotHeadMapperEx; + private final AccountItemMapperEx accountItemMapperEx; + private final DepotHeadService depotHeadService; + private final UserBusinessService userBusinessService; + + public SupplierServiceImpl(SupplierMapper supplierMapper, SupplierMapperEx supplierMapperEx, LogService logService, UserService userService, AccountHeadMapperEx accountHeadMapperEx, DepotHeadMapperEx depotHeadMapperEx, AccountItemMapperEx accountItemMapperEx, DepotHeadService depotHeadService, UserBusinessService userBusinessService) { + this.supplierMapper = supplierMapper; + this.supplierMapperEx = supplierMapperEx; + this.logService = logService; + this.userService = userService; + this.accountHeadMapperEx = accountHeadMapperEx; + this.depotHeadMapperEx = depotHeadMapperEx; + this.accountItemMapperEx = accountItemMapperEx; + this.depotHeadService = depotHeadService; + this.userBusinessService = userBusinessService; + } + + public Supplier getSupplier(long id) { + Supplier result=null; + try{ + result=supplierMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSupplierListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdIn(idList); + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getSupplier() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String supplier, String type, String phonenum, String telephone, String roleType, int offset, int rows) { + List resList = new ArrayList(); + try{ + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + List list = supplierMapperEx.selectByConditionSupplier(supplier, type, phonenum, telephone, creatorArray, offset, rows); + for(Supplier s : list) { + Integer supplierId = s.getId().intValue(); + String beginTime = Tools.getYearBegin(); + String endTime = Tools.getCenternTime(new Date()); + BigDecimal sum = BigDecimal.ZERO; + String supplierType = type; + String inOutType = ""; + String subType = ""; + String typeBack = ""; + String subTypeBack = ""; + String billType = ""; + if (("供应商").equals(supplierType)) { + inOutType = "入库"; + subType = "采购"; + typeBack = "出库"; + subTypeBack = "采购退货"; + billType = "付款"; + } else if (("客户").equals(supplierType)) { + inOutType = "出库"; + subType = "销售"; + typeBack = "入库"; + subTypeBack = "销售退货"; + billType = "收款"; + } + List saList = depotHeadService.getStatementAccount(beginTime, endTime, supplierId, null, + supplierType, inOutType, subType, typeBack, subTypeBack, billType, null, null); + if(saList.size()>0) { + DepotHeadVo4StatementAccount item = saList.get(0); + //期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款 + BigDecimal preNeed = item.getBeginNeed().add(item.getPreDebtMoney()).subtract(item.getPreReturnDebtMoney()).subtract(item.getPreBackMoney()); + item.setPreNeed(preNeed); + //实际欠款 = 本期欠款-本期退货的欠款金额 + BigDecimal realDebtMoney = item.getDebtMoney().subtract(item.getReturnDebtMoney()); + item.setDebtMoney(realDebtMoney); + //期末 = 期初+实际欠款-本期收款 + BigDecimal allNeedGet = preNeed.add(realDebtMoney).subtract(item.getBackMoney()); + sum = sum.add(allNeedGet); + } + if(("客户").equals(s.getType())) { + s.setAllNeedGet(sum); + } else if(("供应商").equals(s.getType())) { + s.setAllNeedPay(sum); + } + resList.add(s); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } + + public Long countSupplier(String supplier, String type, String phonenum, String telephone, String roleType) { + Long result=null; + try{ + String [] creatorArray = depotHeadService.getCreatorArray(roleType); + result=supplierMapperEx.countsBySupplier(supplier, type, phonenum, telephone, creatorArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSupplier(JSONObject obj, HttpServletRequest request) { + Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class); + int result=0; + try{ + supplier.setEnabled(true); + User userInfo= userService.getCurrentUser(); + supplier.setCreator(userInfo==null?null:userInfo.getId()); + result=supplierMapper.insertSelective(supplier); + //新增客户时给当前用户自动授权 + if("客户".equals(supplier.getType())) { + Long userId = userService.getUserId(request); + Supplier sInfo = supplierMapperEx.getSupplierByNameAndType(supplier.getSupplier(), supplier.getType()); + String ubKey = "[" + sInfo.getId() + "]"; + List ubList = userBusinessService.getBasicData(userId.toString(), "UserCustomer"); + if(ubList ==null || ubList.isEmpty()) { + JSONObject ubObj = new JSONObject(); + ubObj.put("type", "UserCustomer"); + ubObj.put("keyId", userId); + ubObj.put("value", ubKey); + userBusinessService.insertUserBusiness(ubObj, request); + } else { + UserBusiness ubInfo = ubList.get(0); + JSONObject ubObj = new JSONObject(); + ubObj.put("id", ubInfo.getId()); + ubObj.put("type", ubInfo.getType()); + ubObj.put("keyId", ubInfo.getKeyId()); + ubObj.put("value", ubInfo.getValue() + ubKey); + userBusinessService.updateUserBusiness(ubObj, request); + } + } + logService.insertLog("商家", + BusinessConstants.LOG_OPERATION_TYPE_ADD + supplier.getSupplier(),request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSupplier(JSONObject obj, HttpServletRequest request) { + Supplier supplier = JSONObject.parseObject(obj.toJSONString(), Supplier.class); + if(supplier.getBeginNeedPay() == null) { + supplier.setBeginNeedPay(BigDecimal.ZERO); + } + if(supplier.getBeginNeedGet() == null) { + supplier.setBeginNeedGet(BigDecimal.ZERO); + } + int result=0; + try{ + result=supplierMapper.updateByPrimaryKeySelective(supplier); + logService.insertLog("商家", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + supplier.getSupplier(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSupplier(Long id, HttpServletRequest request) { + return batchDeleteSupplierByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplier(String ids, HttpServletRequest request) { + return batchDeleteSupplierByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSupplierByIds(String ids) { + int result=0; + String [] idArray=ids.split(","); + //校验财务主表 jsh_accounthead + List accountHeadList=null; + try{ + accountHeadList = accountHeadMapperEx.getAccountHeadListByOrganIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(accountHeadList!=null&& !accountHeadList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //校验单据主表 jsh_depot_head + List depotHeadList=null; + try{ + depotHeadList = depotHeadMapperEx.getDepotHeadListByOrganIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(depotHeadList!=null&&depotHeadList.size()>0){ + logger.error("异常码[{}],异常提示[{}],参数,OrganIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getSupplierListByIds(ids); + for(Supplier supplier: list){ + sb.append("[").append(supplier.getSupplier()).append("]"); + } + logService.insertLog("商家", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result = supplierMapperEx.batchDeleteSupplierByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public int checkIsNameAndTypeExist(Long id, String name, String type) { + name = name == null? "": name; + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdNotEqualTo(id).andSupplierEqualTo(name).andTypeEqualTo(type) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateAdvanceIn(Long supplierId, BigDecimal advanceIn) { + Supplier supplier=null; + try{ + supplier = supplierMapper.selectByPrimaryKey(supplierId); + }catch(Exception e){ + JshException.readFail(logger, e); + } + int result=0; + try{ + if(supplier!=null){ + supplier.setAdvanceIn(supplier.getAdvanceIn().add(advanceIn)); //增加预收款的金额,可能增加的是负值 + result=supplierMapper.updateByPrimaryKeySelective(supplier); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List findBySelectCus() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("客户").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findBySelectSup() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("供应商").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findBySelectRetail() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeLike("会员").andEnabledEqualTo(true) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findById(Long supplierId) { + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdEqualTo(supplierId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("商家", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List supplierIds = StringUtil.strToLongList(ids); + Supplier supplier = new Supplier(); + supplier.setEnabled(status); + SupplierExample example = new SupplierExample(); + example.createCriteria().andIdIn(supplierIds); + int result=0; + try{ + result = supplierMapper.updateByExampleSelective(supplier, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public List findUserCustomer() { + SupplierExample example = new SupplierExample(); + example.createCriteria().andTypeEqualTo("客户") + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.setOrderByClause("sort asc, id desc"); + List list=null; + try{ + list = supplierMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List findByAll(String supplier, String type, String phonenum, String telephone) { + List list=null; + try{ + list = supplierMapperEx.findByAll(supplier, type, phonenum, telephone); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Map getBeginNeedByOrganId(Long organId) { + Supplier supplier = getSupplier(organId); + Map map = new HashMap<>(); + BigDecimal needDebt = BigDecimal.ZERO; + if("供应商".equals(supplier.getType())) { + needDebt = supplier.getBeginNeedPay(); + } else if("客户".equals(supplier.getType())) { + needDebt = supplier.getBeginNeedGet(); + } + BigDecimal finishDebt = accountItemMapperEx.getFinishDebtByOrganId(organId).abs(); + BigDecimal eachAmount = BigDecimal.ZERO; + if(needDebt != null) { + eachAmount = needDebt.subtract(finishDebt); + } + //应收欠款 + map.put("needDebt", needDebt); + //已收欠款 + map.put("finishDebt", finishDebt); + //本次收款 + map.put("eachAmount", eachAmount); + return map; + } + + public void importVendor(MultipartFile file, HttpServletRequest request) { + String type = "供应商"; + try { + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '传真', '期初应付', '纳税人识别号', '税率(%)', '开户行', '账号', '地址', '备注', '排序', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + String supplierName = ExcelUtils.getContent(src, i, 0); + String enabled = ExcelUtils.getContent(src, i, 14); + if(StringUtil.isNotEmpty(supplierName) && StringUtil.isNotEmpty(enabled)) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(supplierName); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setFax(ExcelUtils.getContent(src, i, 5)); + s.setBeginNeedPay(parseBigDecimalEx(ExcelUtils.getContent(src, i, 6))); + s.setTaxNum(ExcelUtils.getContent(src, i, 7)); + s.setTaxRate(parseBigDecimalEx(ExcelUtils.getContent(src, i, 8))); + s.setBankName(ExcelUtils.getContent(src, i, 9)); + s.setAccountNumber(ExcelUtils.getContent(src, i, 10)); + s.setAddress(ExcelUtils.getContent(src, i, 11)); + s.setDescription(ExcelUtils.getContent(src, i, 12)); + s.setSort(ExcelUtils.getContent(src, i, 13)); + s.setEnabled("1".equals(enabled)); + sList.add(s); + } + } + importExcel(sList, type); + }catch (Exception e) { + e.printStackTrace(); + } + } + + public void importCustomer(MultipartFile file, HttpServletRequest request) { + String type = "客户"; + try { + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '传真', '期初应收', '纳税人识别号', '税率(%)', '开户行', '账号', '地址', '备注', '排序', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + String supplierName = ExcelUtils.getContent(src, i, 0); + String enabled = ExcelUtils.getContent(src, i, 14); + if(StringUtil.isNotEmpty(supplierName) && StringUtil.isNotEmpty(enabled)) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(supplierName); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setFax(ExcelUtils.getContent(src, i, 5)); + s.setBeginNeedGet(parseBigDecimalEx(ExcelUtils.getContent(src, i, 6))); + s.setTaxNum(ExcelUtils.getContent(src, i, 7)); + s.setTaxRate(parseBigDecimalEx(ExcelUtils.getContent(src, i, 8))); + s.setBankName(ExcelUtils.getContent(src, i, 9)); + s.setAccountNumber(ExcelUtils.getContent(src, i, 10)); + s.setAddress(ExcelUtils.getContent(src, i, 11)); + s.setDescription(ExcelUtils.getContent(src, i, 12)); + s.setSort(ExcelUtils.getContent(src, i, 13)); + s.setEnabled("1".equals(enabled)); + sList.add(s); + } + } + importExcel(sList, type); + }catch (Exception e) { + e.printStackTrace(); + } + } + + public void importMember(MultipartFile file, HttpServletRequest request) { + String type = "会员"; + try { + Workbook workbook = Workbook.getWorkbook(file.getInputStream()); + Sheet src = workbook.getSheet(0); + //'名称', '联系人', '手机号码', '联系电话', '电子邮箱', '备注', '排序', '状态' + List sList = new ArrayList<>(); + for (int i = 2; i < src.getRows(); i++) { + String supplierName = ExcelUtils.getContent(src, i, 0); + String enabled = ExcelUtils.getContent(src, i, 7); + if(StringUtil.isNotEmpty(supplierName) && StringUtil.isNotEmpty(enabled)) { + Supplier s = new Supplier(); + s.setType(type); + s.setSupplier(supplierName); + s.setContacts(ExcelUtils.getContent(src, i, 1)); + s.setTelephone(ExcelUtils.getContent(src, i, 2)); + s.setPhoneNum(ExcelUtils.getContent(src, i, 3)); + s.setEmail(ExcelUtils.getContent(src, i, 4)); + s.setDescription(ExcelUtils.getContent(src, i, 5)); + s.setSort(ExcelUtils.getContent(src, i, 6)); + s.setEnabled("1".equals(enabled)); + sList.add(s); + } + } + importExcel(sList, type); + }catch (Exception e) { + e.printStackTrace(); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public BaseResponseInfo importExcel(List mList, String type) { + logService.insertLog(type, + BusinessConstants.LOG_OPERATION_TYPE_IMPORT + mList.size() + BusinessConstants.LOG_DATA_UNIT, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + BaseResponseInfo info = new BaseResponseInfo(); + Map data = new HashMap<>(); + try { + for(Supplier s: mList) { + SupplierExample example = new SupplierExample(); + example.createCriteria().andSupplierEqualTo(s.getSupplier()).andTypeEqualTo(type).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list= supplierMapper.selectByExample(example); + if(list.size() <= 0) { + supplierMapper.insertSelective(s); + } else { + Long id = list.get(0).getId(); + s.setId(id); + supplierMapper.updateByPrimaryKeySelective(s); + } + } + info.code = 200; + data.put("message", "成功"); + } catch (Exception e) { + info.code = 500; + data.put("message", e.getMessage()); + } + info.data = data; + return info; + } + + public BigDecimal parseBigDecimalEx(String str) { + if(!StringUtil.isEmpty(str)) { + return new BigDecimal(str); + } else { + return null; + } + } + + public File exportExcel(List dataList, String type) { + if("供应商".equals(type)) { + return exportExcelVendorOrCustomer(dataList, type); + } else if("客户".equals(type)) { + return exportExcelVendorOrCustomer(dataList, type); + } else { + //会员 + String[] names = {"会员卡号*", "联系人", "手机号码", "联系电话", "电子邮箱", "备注", "排序", "状态*"}; + String title = "信息内容"; + List objects = new ArrayList(); + if (null != dataList) { + for (Supplier s : dataList) { + String[] objs = new String[10]; + objs[0] = s.getSupplier(); + objs[1] = s.getContacts(); + objs[2] = s.getTelephone(); + objs[3] = s.getPhoneNum(); + objs[4] = s.getEmail(); + objs[5] = s.getDescription(); + objs[6] = s.getSort(); + objs[7] = s.getEnabled() ? "1" : "0"; + objects.add(objs); + } + } + return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + } + } + + private File exportExcelVendorOrCustomer(List dataList, String type) { + String beginNeedStr = ""; + if("供应商".equals(type)) { + beginNeedStr = "期初应付"; + } else if("客户".equals(type)) { + beginNeedStr = "期初应收"; + } + String[] names = {"名称*", "联系人", "手机号码", "联系电话", "电子邮箱", "传真", beginNeedStr, + "纳税人识别号", "税率(%)", "开户行", "账号", "地址", "备注", "排序", "状态*"}; + String title = "信息内容"; + List objects = new ArrayList(); + if (null != dataList) { + for (Supplier s : dataList) { + String[] objs = new String[20]; + objs[0] = s.getSupplier(); + objs[1] = s.getContacts(); + objs[2] = s.getTelephone(); + objs[3] = s.getPhoneNum(); + objs[4] = s.getEmail(); + objs[5] = s.getFax(); + if(("客户").equals(s.getType())) { + objs[6] = s.getBeginNeedGet() == null? "" : s.getBeginNeedGet().setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + } else if(("供应商").equals(s.getType())) { + objs[6] = s.getBeginNeedPay() == null? "" : s.getBeginNeedPay().setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + } + objs[7] = s.getTaxNum(); + objs[8] = s.getTaxRate() == null? "" : s.getTaxRate().setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + objs[9] = s.getBankName(); + objs[10] = s.getAccountNumber(); + objs[11] = s.getAddress(); + objs[12] = s.getDescription(); + objs[13] = s.getSort(); + objs[14] = s.getEnabled() ? "1" : "0"; + objects.add(objs); + } + } + return ExcelUtils.exportObjectsWithoutTitle(title, "*导入时本行内容请勿删除,切记!", names, title, objects); + } +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java b/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java index 52371d3a..e8a9527a 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; -import com.wansensoft.entities.system.SysConfig; +import com.wansensoft.entities.SysConfig; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 系统参数 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysConfigService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/system/ISysDepartmentService.java b/service/src/main/java/com/wansensoft/service/system/ISysDepartmentService.java deleted file mode 100644 index 3f4ccac4..00000000 --- a/service/src/main/java/com/wansensoft/service/system/ISysDepartmentService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.system; - -import com.wansensoft.dto.organization.DeptListDTO; -import com.wansensoft.entities.SysDepartment; -import com.baomidou.mybatisplus.extension.service.IService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.DeptListVO; - -import java.util.List; - -/** - *

- * 机构表 服务类 - *

- */ -public interface ISysDepartmentService extends IService { - - Response deptList(DeptListDTO deptListDto); - - Response> getUserDeptRel(); -} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysLogService.java b/service/src/main/java/com/wansensoft/service/system/ISysLogService.java index e949bd23..ddf73ed3 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysLogService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysLogService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; -import com.wansensoft.entities.system.SysLog; +import com.wansensoft.entities.SysLog; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 操作日志 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysLogService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java b/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java index e69d6053..35d82369 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java @@ -1,30 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; -import com.alibaba.fastjson.JSONObject; +import com.wansensoft.entities.SysMenu; import com.baomidou.mybatisplus.extension.service.IService; -import com.wansensoft.entities.system.SysMenu; -import com.wansensoft.utils.response.Response; /** *

* 功能模块表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysMenuService extends IService { - Response menuList(); - - String test(); } diff --git a/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java b/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java index e219b41a..17c9f321 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; -import com.wansensoft.entities.system.SysMsg; +import com.wansensoft.entities.SysMsg; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 消息表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysMsgService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java b/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java new file mode 100644 index 00000000..dd4bb5e8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysOrganization; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 机构表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysOrganizationService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java b/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java index 81879e7d..34541cc8 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; -import com.wansensoft.entities.system.SysPlatformConfig; +import com.wansensoft.entities.SysPlatformConfig; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 平台参数 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysPlatformConfigService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java b/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java index 207d7b53..d9b5d0e5 100644 --- a/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java +++ b/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.system; import com.wansensoft.entities.SysSerialNumber; @@ -19,6 +7,9 @@ *

* 序列号表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysSerialNumberService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/system/ISystemSupplierService.java b/service/src/main/java/com/wansensoft/service/system/ISystemSupplierService.java deleted file mode 100644 index bf773cf6..00000000 --- a/service/src/main/java/com/wansensoft/service/system/ISystemSupplierService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.system; - -import com.wansensoft.entities.system.SystemSupplier; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - *

- * 供应商/客户信息表 服务类 - *

- */ -public interface ISystemSupplierService extends IService { - -} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java index f5ee94a3..4852383e 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java @@ -1,7 +1,7 @@ package com.wansensoft.service.system.impl; import com.wansensoft.service.system.ISysConfigService; -import com.wansensoft.entities.system.SysConfig; +import com.wansensoft.entities.SysConfig; import com.wansensoft.mappers.system.SysConfigMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysDepartmentServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysDepartmentServiceImpl.java deleted file mode 100644 index a2b1e447..00000000 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysDepartmentServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.wansensoft.service.system.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.wansensoft.dto.organization.DeptListDTO; -import com.wansensoft.entities.user.SysUserDeptRel; -import com.wansensoft.mappers.system.SysDepartmentMapper; -import com.wansensoft.mappers.user.SysUserDeptRelMapper; -import com.wansensoft.service.system.ISysDepartmentService; -import com.wansensoft.entities.SysDepartment; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansensoft.service.user.ISysUserService; -import com.wansensoft.utils.enums.BaseCodeEnum; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.DeptListVO; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -/** - *

- * 机构表 服务实现类 - *

- * - * @author James Zow - * @since 2023-09-05 - */ -@Service -public class SysDepartmentServiceImpl extends ServiceImpl implements ISysDepartmentService { - - private final ISysUserService userService; - - private final SysUserDeptRelMapper userDeptRelMapper; - - private final SysDepartmentMapper departmentMapper; - - public SysDepartmentServiceImpl(ISysUserService userService, SysUserDeptRelMapper userDeptRelMapper, SysDepartmentMapper departmentMapper) { - this.userService = userService; - this.userDeptRelMapper = userDeptRelMapper; - this.departmentMapper = departmentMapper; - } - - @Override - public Response deptList(DeptListDTO deptListDto) { - return null; - } - - @Override - public Response> getUserDeptRel() { - var results = new ArrayList(5); - var tenantId = userService.getCurrentTenantId(); - - var userRoleWrapper = new QueryWrapper(); - userRoleWrapper.eq("tenant_id", tenantId); - var userDeptRelList = userDeptRelMapper.selectList(userRoleWrapper) - .stream().map(SysUserDeptRel::getDeptId).toList(); - - var departments = departmentMapper.selectBatchIds(userDeptRelList); - if(departments.isEmpty()) { - return Response.responseMsg(BaseCodeEnum.QUERY_DATA_EMPTY); - } - // find children department only 2 leave - departments.forEach(item -> { - if(item.getParentId() == null) { - // parent Dept Node - var deptVo = new DeptListVO(); - deptVo.setId(item.getId()); - deptVo.setDeptName(item.getName()); - deptVo.setDeptNumber(item.getNumber()); - deptVo.setSort(item.getSort()); - deptVo.setRemark(item.getRemark()); - // Query Children Node List - var deptQuery = new QueryWrapper(); - deptQuery.eq("parent_id", item.getId()); - var childrenDept = departmentMapper.selectList(deptQuery); - // Assemble Children Node Data - if (!childrenDept.isEmpty()) { - var DeptChildrenVOs = new ArrayList(); - childrenDept.forEach(childrenItem -> { - var childrenDeptVo = new DeptListVO.DeptChildrenVO(); - childrenDeptVo.setId(childrenItem.getId()); - childrenDeptVo.setParentId(childrenItem.getParentId()); - childrenDeptVo.setDeptName(childrenItem.getName()); - childrenDeptVo.setDeptNumber(childrenItem.getNumber()); - childrenDeptVo.setSort(childrenItem.getSort()); - childrenDeptVo.setRemark(childrenItem.getRemark()); - - DeptChildrenVOs.add(childrenDeptVo); - }); - deptVo.setChildren(DeptChildrenVOs); - } - // Add multiple child nodes to the parent node - results.add(deptVo); - } - }); - return Response.responseData(results); - } -} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java index 8669d20d..8b14721f 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java @@ -1,7 +1,7 @@ package com.wansensoft.service.system.impl; import com.wansensoft.service.system.ISysLogService; -import com.wansensoft.entities.system.SysLog; +import com.wansensoft.entities.SysLog; import com.wansensoft.mappers.system.SysLogMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java index b7fb1eca..a02f7611 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java @@ -1,28 +1,10 @@ package com.wansensoft.service.system.impl; -import com.alibaba.fastjson.JSONObject; -import com.wansensoft.entities.role.SysRoleMenuRel; -import com.wansensoft.entities.system.SysMenu; -import com.wansensoft.entities.user.SysUserRoleRel; -import com.wansensoft.mappers.role.SysRoleMenuRelMapper; import com.wansensoft.service.system.ISysMenuService; +import com.wansensoft.entities.SysMenu; import com.wansensoft.mappers.system.SysMenuMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansensoft.service.user.ISysUserRoleRelService; -import com.wansensoft.service.user.ISysUserService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.MenuVO; -import org.aspectj.util.FileUtil; import org.springframework.stereotype.Service; -import org.springframework.util.ResourceUtils; -import org.springframework.util.StringUtils; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; /** *

@@ -35,114 +17,4 @@ @Service public class SysMenuServiceImpl extends ServiceImpl implements ISysMenuService { - private final ISysUserRoleRelService userRoleRelService; - - private final SysRoleMenuRelMapper roleMenuRelMapper; - - private final SysMenuMapper menuMapper; - - private final ISysUserService userService; - - public SysMenuServiceImpl(ISysUserRoleRelService userRoleRelService, SysRoleMenuRelMapper roleMenuRelMapper, SysMenuMapper menuMapper, ISysUserService userService) { - this.userRoleRelService = userRoleRelService; - this.roleMenuRelMapper = roleMenuRelMapper; - this.menuMapper = menuMapper; - this.userService = userService; - } - - public String test(){ - try { - File file = ResourceUtils.getFile("classpath:testMenu.json"); - String json = FileUtil.readAsString(file); - return json; - }catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - - @Override - public Response menuList() { - var menuData = new JSONObject(); - var menuVos = new ArrayList(); - - var userId = userService.getCurrentUserId(); - if (!StringUtils.hasText(userId)) { - Response.fail(); - } - var roleIds = userRoleRelService.queryByUserId(Long.parseLong(userId)) - .stream().map(SysUserRoleRel::getRoleId).toList(); - - if (!roleIds.isEmpty()) { - var menusReals = roleMenuRelMapper.listByRoleId(roleIds); - if(!menusReals.isEmpty()) { - var numberList = menusReals.stream().map(SysRoleMenuRel::getMenuId).toList(); - // menuIds deduplication and segmentation into numbers - Pattern pattern = Pattern.compile("\\d+"); - List distinctNumbers = numberList.stream() - .flatMap(item -> { - Matcher matcher = pattern.matcher(item); - List numbers = new ArrayList<>(); - while (matcher.find()) { - numbers.add(matcher.group()); - } - return numbers.stream(); - }) - .distinct() - .collect(Collectors.toList()); - - var menus = menuMapper.selectBatchIds(distinctNumbers); - if(!menus.isEmpty()) { - menus.forEach(menu -> { - // JSON Assembly - var meta = getMetaJsonObject(menu); - var menuVo = MenuVO.builder() - .id(menu.getId()) - .name(menu.getName()) - .menuType(menu.getMenuType()) - .path(menu.getPath()) - .component(menu.getComponent()) - .icon(menu.getIcon()) - .sort(menu.getSort()) - .redirect(menu.getRedirect()) - .meta(meta) - .build(); - if(menu.getParentId() != null) { - menuVo.setParentId(menu.getParentId()); - } - - menuVos.add(menuVo); - }); - } - menuData.put("total", menuVos.size()); - menuData.put("data", menuVos); - } - } - return Response.responseData(menuData); - } - - /** - * menu Json Assembly - * @param menu menu data object - * @return meta data - */ - private static JSONObject getMetaJsonObject(SysMenu menu) { - var meta = new JSONObject(); - meta.put("title", menu.getTitle()); - meta.put("icon", menu.getIcon()); - meta.put("hideMenu", menu.getHideMenu()); - meta.put("hideBreadcrumb", menu.getHideBreadcrumb()); - meta.put("ignoreKeepAlive", menu.getIgnoreKeepAlive()); - meta.put("hideTab", menu.getHideTab()); - meta.put("carryParam", menu.getCarryParam()); - meta.put("hideChildrenInMenu", menu.getHideChildrenInMenu()); - meta.put("affix", menu.getAffix()); - meta.put("frameSrc", menu.getFrameSrc()); - meta.put("realPath", menu.getRealPath()); - // default value 20 - meta.put("dynamicLevel", 20); - - return meta; - } } diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java index 6bdef674..5f0728b2 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java @@ -1,7 +1,7 @@ package com.wansensoft.service.system.impl; import com.wansensoft.service.system.ISysMsgService; -import com.wansensoft.entities.system.SysMsg; +import com.wansensoft.entities.SysMsg; import com.wansensoft.mappers.system.SysMsgMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java new file mode 100644 index 00000000..7d2f530e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysOrganizationService; +import com.wansensoft.entities.SysOrganization; +import com.wansensoft.mappers.system.SysOrganizationMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 机构表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysOrganizationServiceImpl extends ServiceImpl implements ISysOrganizationService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java index d2a58616..f40e006d 100644 --- a/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java @@ -1,7 +1,7 @@ package com.wansensoft.service.system.impl; import com.wansensoft.service.system.ISysPlatformConfigService; -import com.wansensoft.entities.system.SysPlatformConfig; +import com.wansensoft.entities.SysPlatformConfig; import com.wansensoft.mappers.system.SysPlatformConfigMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigComponent.java b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigComponent.java new file mode 100644 index 00000000..1e70da6f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@SystemConfigResource +public class SystemConfigComponent implements ICommonQuery { + + private final SystemConfigService systemConfigService; + + public SystemConfigComponent(SystemConfigService systemConfigService) { + this.systemConfigService = systemConfigService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return systemConfigService.getSystemConfig(id); + } + + @Override + public List select(Map map)throws Exception { + return getSystemConfigList(map); + } + + private List getSystemConfigList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String companyName = StringUtil.getInfo(search, "companyName"); + String order = QueryUtils.order(map); + return systemConfigService.select(companyName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String companyName = StringUtil.getInfo(search, "companyName"); + return systemConfigService.countSystemConfig(companyName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return systemConfigService.insertSystemConfig(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return systemConfigService.updateSystemConfig(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return systemConfigService.deleteSystemConfig(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return systemConfigService.batchDeleteSystemConfig(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return systemConfigService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigResource.java b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigResource.java new file mode 100644 index 00000000..c97c30a8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.systemConfig; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "systemConfig") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SystemConfigResource { +} diff --git a/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigService.java b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigService.java new file mode 100644 index 00000000..9412f1f1 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigService.java @@ -0,0 +1,58 @@ +package com.wansensoft.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.system.SystemConfig; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.List; + +public interface SystemConfigService extends IService { + + SystemConfig getSystemConfig(long id); + + List getSystemConfig(); + + List select(String companyName, int offset, int rows); + + Long countSystemConfig(String companyName); + + int insertSystemConfig(JSONObject obj, HttpServletRequest request); + + int updateSystemConfig(JSONObject obj, HttpServletRequest request); + + int deleteSystemConfig(Long id, HttpServletRequest request); + + int batchDeleteSystemConfig(String ids, HttpServletRequest request); + + int batchDeleteSystemConfigByIds(String ids); + + int checkIsNameExist(Long id, String name); + + String uploadLocal(MultipartFile mf, String bizPath, String name, HttpServletRequest request); + + String uploadAliOss(MultipartFile mf, String bizPath, String name, HttpServletRequest request); + + String getFileUrlLocal(String imgPath); + + String getFileUrlAliOss(String imgPath); + + BufferedImage getImageMini(InputStream inputStream, int w); + + boolean getDepotFlag(); + + boolean getCustomerFlag(); + + boolean getMinusStockFlag(); + + boolean getUpdateUnitPriceFlag(); + + boolean getOverLinkBillFlag(); + + boolean getForceApprovalFlag(); + + boolean getMultiLevelApprovalFlag(); +} diff --git a/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigServiceImpl.java new file mode 100644 index 00000000..944aafb0 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/systemConfig/SystemConfigServiceImpl.java @@ -0,0 +1,478 @@ +package com.wansensoft.service.systemConfig; + +import com.alibaba.fastjson.JSONObject; +import com.aliyun.oss.ClientException; +import com.aliyun.oss.OSS; +import com.aliyun.oss.OSSClientBuilder; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.model.PutObjectRequest; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.system.SystemConfig; +import com.wansensoft.entities.system.SystemConfigExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.system.SystemConfigMapper; +import com.wansensoft.mappers.system.SystemConfigMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.platformConfig.PlatformConfigService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.FileUtils; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.imageio.ImageIO; +import javax.imageio.stream.ImageOutputStream; +import jakarta.servlet.http.HttpServletRequest; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Date; +import java.util.List; + +@Service +public class SystemConfigServiceImpl extends ServiceImpl implements SystemConfigService{ + private Logger logger = LoggerFactory.getLogger(SystemConfigServiceImpl.class); + + private final SystemConfigMapper systemConfigMapper; + private final SystemConfigMapperEx systemConfigMapperEx; + private final PlatformConfigService platformConfigService; + private final CommonService commonService; + private final LogService logService; + + @Value(value="${file.path}") + private String filePath; + + public SystemConfigServiceImpl(SystemConfigMapper systemConfigMapper, SystemConfigMapperEx systemConfigMapperEx, PlatformConfigService platformConfigService, CommonService commonService, LogService logService) { + this.systemConfigMapper = systemConfigMapper; + this.systemConfigMapperEx = systemConfigMapperEx; + this.platformConfigService = platformConfigService; + this.commonService = commonService; + this.logService = logService; + } + + public SystemConfig getSystemConfig(long id) { + SystemConfig result=null; + try{ + result=systemConfigMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getSystemConfig() { + SystemConfigExample example = new SystemConfigExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=systemConfigMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + public List select(String companyName, int offset, int rows) { + List list=null; + try{ + list=systemConfigMapperEx.selectByConditionSystemConfig(companyName, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countSystemConfig(String companyName) { + Long result=null; + try{ + result=systemConfigMapperEx.countsBySystemConfig(companyName); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertSystemConfig(JSONObject obj, HttpServletRequest request) { + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + result=systemConfigMapper.insertSelective(systemConfig); + logService.insertLog("系统配置", + BusinessConstants.LOG_OPERATION_TYPE_ADD + systemConfig.getCompanyName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateSystemConfig(JSONObject obj, HttpServletRequest request) { + SystemConfig systemConfig = JSONObject.parseObject(obj.toJSONString(), SystemConfig.class); + int result=0; + try{ + result = systemConfigMapper.updateByPrimaryKeySelective(systemConfig); + logService.insertLog("系统配置", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + systemConfig.getCompanyName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteSystemConfig(Long id, HttpServletRequest request) { + return batchDeleteSystemConfigByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfig(String ids, HttpServletRequest request) { + return batchDeleteSystemConfigByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteSystemConfigByIds(String ids) { + logService.insertLog("系统配置", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = commonService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result = systemConfigMapperEx.batchDeleteSystemConfigByIds(new Date(), userInfo == null ? null : userInfo.getId(), idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + SystemConfigExample example = new SystemConfigExample(); + example.createCriteria().andIdNotEqualTo(id).andCompanyNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list =null; + try{ + list=systemConfigMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + /** + * 本地文件上传 + * @param mf 文件 + * @param bizPath 自定义路径 + * @param name 自定义文件名 + * @return + */ + public String uploadLocal(MultipartFile mf, String bizPath, String name, HttpServletRequest request) { + try { + if(StringUtil.isEmpty(bizPath)){ + bizPath = ""; + } + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + bizPath = bizPath + File.separator + tenantId; + String ctxPath = filePath; + String fileName = null; + File file = new File(ctxPath + File.separator + bizPath + File.separator ); + if (!file.exists()) { + file.mkdirs();// 创建文件根目录 + } + String orgName = mf.getOriginalFilename();// 获取文件名 + orgName = FileUtils.getFileName(orgName); + if(orgName.contains(".")){ + if(StringUtil.isNotEmpty(name)) { + fileName = name.substring(0, name.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); + } else { + fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); + } + }else{ + fileName = orgName+ "_" + System.currentTimeMillis(); + } + String savePath = file.getPath() + File.separator + fileName; + File savefile = new File(savePath); + FileCopyUtils.copy(mf.getBytes(), savefile); + // 保存缩略图 + // String fileUrl = getFileUrlLocal(bizPath + File.separator + fileName); + // InputStream imgInputStream = new BufferedInputStream(new FileInputStream(fileUrl)); + // BufferedImage smallImage = getImageMini(imgInputStream, 80); + // int index = fileName.lastIndexOf("."); + // String ext = fileName.substring(index + 1); + // String smallUrl = filePath + "-small" + File.separator + bizPath + File.separator + fileName; + // FileUtils.createFile(smallUrl); + // File saveSmallFile = new File(smallUrl); + // ImageIO.write(smallImage, ext, saveSmallFile); + // 返回路径 + String dbpath = null; + if(StringUtil.isNotEmpty(bizPath)){ + dbpath = bizPath + File.separator + fileName; + }else{ + dbpath = fileName; + } + if (dbpath.contains("\\")) { + dbpath = dbpath.replace("\\", "/"); + } + return dbpath; + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + return ""; + } + + /** + * 阿里Oss文件上传 + * @param mf 文件 + * @param bizPath 自定义路径 + * @param name 自定义文件名 + * @return + */ + public String uploadAliOss(MultipartFile mf, String bizPath, String name, HttpServletRequest request) { + if (StringUtil.isEmpty(bizPath)) { + bizPath = ""; + } + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + bizPath = bizPath + "/" + tenantId; + String endpoint = platformConfigService.getPlatformConfigByKey("aliOss_endpoint").getPlatformValue(); + String accessKeyId = platformConfigService.getPlatformConfigByKey("aliOss_accessKeyId").getPlatformValue(); + String accessKeySecret = platformConfigService.getPlatformConfigByKey("aliOss_accessKeySecret").getPlatformValue(); + String bucketName = platformConfigService.getPlatformConfigByKey("aliOss_bucketName").getPlatformValue(); + // 填写Object完整路径,完整路径中不能包含Bucket名称,例如exampledir/exampleobject.txt。 + String fileName = ""; + String orgName = mf.getOriginalFilename();// 获取文件名 + orgName = FileUtils.getFileName(orgName); + if (orgName.contains(".")) { + if (StringUtil.isNotEmpty(name)) { + fileName = name.substring(0, name.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); + } else { + fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); + } + } else { + fileName = orgName + "_" + System.currentTimeMillis(); + } + String filePathStr = StringUtil.isNotEmpty(filePath) ? filePath.substring(1) : ""; + String objectName = filePathStr + "/" + bizPath + "/" + fileName; + String smallObjectName = filePathStr + "-small/" + bizPath + "/" + fileName; + // 创建OSSClient实例。 + OSS ossClient = null; + try { + // 如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。 + byte[] byteArr = mf.getBytes(); + ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); + + // 保存原文件 + InputStream inputStream = new ByteArrayInputStream(byteArr); + PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, objectName, inputStream); + ossClient.putObject(putObjectRequest); + // 如果是图片-保存缩略图 + int index = fileName.lastIndexOf("."); + String ext = fileName.substring(index + 1); + if (ext.contains("gif") || ext.contains("jpg") || ext.contains("jpeg") || ext.contains("png") + || ext.contains("GIF") || ext.contains("JPG") || ext.contains("JPEG") || ext.contains("PNG")) { + String fileUrl = getFileUrlAliOss(bizPath + "/" + fileName); + URL url = new URL(fileUrl); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5 * 1000); + InputStream imgInputStream = conn.getInputStream();// 通过输入流获取图片数据 + BufferedImage smallImage = getImageMini(imgInputStream, 80); + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + ImageOutputStream imOut = ImageIO.createImageOutputStream(bs); + ImageIO.write(smallImage, ext, imOut); + InputStream isImg = new ByteArrayInputStream(bs.toByteArray()); + PutObjectRequest putSmallObjectRequest = new PutObjectRequest(bucketName, smallObjectName, isImg); + ossClient.putObject(putSmallObjectRequest); + } + // 返回路径 + return bizPath + "/" + fileName; + } catch (OSSException oe) { + logger.error("Caught an OSSException, which means your request made it to OSS, " + + "but was rejected with an error response for some reason."); + logger.error("Error Message:" + oe.getErrorMessage()); + logger.error("Error Code:" + oe.getErrorCode()); + logger.error("Request ID:" + oe.getRequestId()); + logger.error("Host ID:" + oe.getHostId()); + } catch (ClientException ce) { + logger.error("Caught an ClientException, which means the client encountered " + + "a serious internal problem while trying to communicate with OSS, " + + "such as not being able to access the network."); + System.out.println("Error Message:" + ce.getMessage()); + } catch (IOException ioe) { + logger.error("Caught an IOException while uploading file to OSS."); + System.out.println("Error Message:" + ioe.getMessage()); + } finally { + if (ossClient != null) { + ossClient.shutdown(); + } + } + return ""; + } + + public String getFileUrlLocal(String imgPath) { + return filePath + File.separator + imgPath; + } + + public String getFileUrlAliOss(String imgPath) { + String linkUrl = platformConfigService.getPlatformConfigByKey("aliOss_linkUrl").getPlatformValue(); + return linkUrl + filePath + "/" + imgPath; + } + + public BufferedImage getImageMini(InputStream inputStream, int w) { + try { + BufferedImage img = ImageIO.read(inputStream); + //获取图片的长和宽 + int width = img.getWidth(); + int height = img.getHeight(); + int tempw = 0; + int temph = 0; + if (width > height) { + tempw = w; + temph = height * w / width; + } else { + tempw = w * width / height; + temph = w; + } + Image _img = img.getScaledInstance(tempw, temph, Image.SCALE_DEFAULT); + BufferedImage image = new BufferedImage(tempw, temph, BufferedImage.TYPE_INT_RGB); + Graphics2D graphics = image.createGraphics(); + graphics.drawImage(_img, 0, 0, null); + graphics.dispose(); + return image; + } catch (IOException e) { + // 处理异常 + e.printStackTrace(); + return null; + } + } + + /** + * 获取仓库开关 + * @return + * @throws Exception + */ + public boolean getDepotFlag() { + boolean depotFlag = false; + List list = getSystemConfig(); + if(!list.isEmpty()) { + String flag = list.get(0).getDepotFlag(); + if(("1").equals(flag)) { + depotFlag = true; + } + } + return depotFlag; + } + + /** + * 获取客户开关 + * @return + * @throws Exception + */ + public boolean getCustomerFlag() { + boolean customerFlag = false; + List list = getSystemConfig(); + if(!list.isEmpty()) { + String flag = list.get(0).getCustomerFlag(); + if(("1").equals(flag)) { + customerFlag = true; + } + } + return customerFlag; + } + + /** + * 获取负库存开关 + * @return + * @throws Exception + */ + public boolean getMinusStockFlag() { + boolean minusStockFlag = false; + List list = getSystemConfig(); + if(!list.isEmpty()) { + String flag = list.get(0).getMinusStockFlag(); + if(("1").equals(flag)) { + minusStockFlag = true; + } + } + return minusStockFlag; + } + + /** + * 获取更新单价开关 + * @return + * @throws Exception + */ + public boolean getUpdateUnitPriceFlag() { + boolean updateUnitPriceFlag = true; + List list = getSystemConfig(); + if(!list.isEmpty()) { + String flag = list.get(0).getUpdateUnitPriceFlag(); + if(("0").equals(flag)) { + updateUnitPriceFlag = false; + } + } + return updateUnitPriceFlag; + } + + /** + * 获取超出关联单据开关 + * @return + * @throws Exception + */ + public boolean getOverLinkBillFlag() { + boolean overLinkBillFlag = false; + List list = getSystemConfig(); + if(!list.isEmpty()) { + String flag = list.get(0).getOverLinkBillFlag(); + if(("1").equals(flag)) { + overLinkBillFlag = true; + } + } + return overLinkBillFlag; + } + + /** + * 获取强审核开关 + * @return + * @throws Exception + */ + public boolean getForceApprovalFlag() { + boolean forceApprovalFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getForceApprovalFlag(); + if(("1").equals(flag)) { + forceApprovalFlag = true; + } + } + return forceApprovalFlag; + } + + /** + * 获取多级审核开关 + * @return + * @throws Exception + */ + public boolean getMultiLevelApprovalFlag() { + boolean multiLevelApprovalFlag = false; + List list = getSystemConfig(); + if(list.size()>0) { + String flag = list.get(0).getMultiLevelApprovalFlag(); + if(("1").equals(flag)) { + multiLevelApprovalFlag = true; + } + } + return multiLevelApprovalFlag; + } +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java index 3ad62d99..86f29946 100644 --- a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java +++ b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.tenant; -import com.wansensoft.entities.tenant.SysTenant; +import com.wansensoft.entities.SysTenant; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 租户 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysTenantService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java index 0273dbd1..415c1ab0 100644 --- a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java +++ b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.tenant; -import com.wansensoft.entities.tenant.SysTenantUser; +import com.wansensoft.entities.SysTenantUser; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysTenantUserService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/tenant/TenantComponent.java b/service/src/main/java/com/wansensoft/service/tenant/TenantComponent.java new file mode 100644 index 00000000..dabf7585 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/TenantComponent.java @@ -0,0 +1,78 @@ +package com.wansensoft.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@TenantResource +public class TenantComponent implements ICommonQuery { + + private final TenantService tenantService; + + public TenantComponent(TenantService tenantService) { + this.tenantService = tenantService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return tenantService.getTenant(id); + } + + @Override + public List select(Map map)throws Exception { + return getTenantList(map); + } + + private List getTenantList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String loginName = StringUtil.getInfo(search, "loginName"); + String type = StringUtil.getInfo(search, "type"); + String enabled = StringUtil.getInfo(search, "enabled"); + String remark = StringUtil.getInfo(search, "remark"); + return tenantService.select(loginName, type, enabled, remark, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String loginName = StringUtil.getInfo(search, "loginName"); + String type = StringUtil.getInfo(search, "type"); + String enabled = StringUtil.getInfo(search, "enabled"); + String remark = StringUtil.getInfo(search, "remark"); + return tenantService.countTenant(loginName, type, enabled, remark); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return tenantService.insertTenant(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return tenantService.updateTenant(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return tenantService.deleteTenant(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return tenantService.batchDeleteTenant(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return tenantService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/TenantExampleService.java b/service/src/main/java/com/wansensoft/service/tenant/TenantExampleService.java new file mode 100644 index 00000000..f525ba23 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/TenantExampleService.java @@ -0,0 +1,11 @@ +package com.wansensoft.service.tenant; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.tenant.TenantEx; +import com.wansensoft.entities.tenant.TenantExample; + +public interface TenantExampleService extends IService { + + Tenant getTenantByTenantId(long tenantId); +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/TenantResource.java b/service/src/main/java/com/wansensoft/service/tenant/TenantResource.java new file mode 100644 index 00000000..c92406f8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/TenantResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.tenant; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "tenant") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface TenantResource { +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/TenantService.java b/service/src/main/java/com/wansensoft/service/tenant/TenantService.java new file mode 100644 index 00000000..0b83f940 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/TenantService.java @@ -0,0 +1,34 @@ +package com.wansensoft.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.tenant.TenantEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface TenantService extends IService { + + Tenant getTenant(long id); + + List getTenant(); + + List select(String loginName, String type, String enabled, String remark, int offset, int rows); + + Long countTenant(String loginName, String type, String enabled, String remark); + + int insertTenant(JSONObject obj, HttpServletRequest request); + + int updateTenant(JSONObject obj, HttpServletRequest request); + + int deleteTenant(Long id, HttpServletRequest request); + + int batchDeleteTenant(String ids, HttpServletRequest request); + + int checkIsNameExist(Long id, String name); + + Tenant getTenantByTenantId(long tenantId); + + int batchSetStatus(Boolean status, String ids); +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/TenantServiceImpl.java b/service/src/main/java/com/wansensoft/service/tenant/TenantServiceImpl.java new file mode 100644 index 00000000..9deab791 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/TenantServiceImpl.java @@ -0,0 +1,217 @@ +package com.wansensoft.service.tenant; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.tenant.TenantEx; +import com.wansensoft.entities.tenant.TenantExample; +import com.wansensoft.mappers.user.UserMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.tenant.TenantMapper; +import com.wansensoft.mappers.tenant.TenantMapperEx; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class TenantServiceImpl extends ServiceImpl implements TenantService{ + private Logger logger = LoggerFactory.getLogger(TenantServiceImpl.class); + + private final TenantMapper tenantMapper; + private final TenantMapperEx tenantMapperEx; + private final UserMapperEx userMapperEx; + private final CommonService commonService; + private final LogService logService; + + @Value("${tenant.userNumLimit}") + private Integer userNumLimit; + + @Value("${tenant.tryDayLimit}") + private Integer tryDayLimit; + + public TenantServiceImpl(TenantMapper tenantMapper, TenantMapperEx tenantMapperEx, UserMapperEx userMapperEx, CommonService commonService, LogService logService) { + this.tenantMapper = tenantMapper; + this.tenantMapperEx = tenantMapperEx; + this.userMapperEx = userMapperEx; + this.commonService = commonService; + this.logService = logService; + } + + public Tenant getTenant(long id) { + Tenant result=null; + try{ + result=tenantMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getTenant() { + TenantExample example = new TenantExample(); + List list=null; + try{ + list=tenantMapper.getTenantByTenantId(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String loginName, String type, String enabled, String remark, int offset, int rows) { + List list= new ArrayList<>(); + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + list = tenantMapperEx.selectByConditionTenant(loginName, type, enabled, remark, offset, rows); + if (null != list) { + for (TenantEx tenantEx : list) { + tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime())); + tenantEx.setExpireTimeStr(Tools.getCenternTime(tenantEx.getExpireTime())); + } + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countTenant(String loginName, String type, String enabled, String remark) { + Long result=null; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = tenantMapperEx.countsByTenant(loginName, type, enabled, remark); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertTenant(JSONObject obj, HttpServletRequest request) { + Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class); + int result=0; + try{ + tenant.setCreateTime(new Date()); + if(tenant.getUserNumLimit()==null) { + tenant.setUserNumLimit(userNumLimit); //默认用户限制数量 + } + if(tenant.getExpireTime()==null) { + tenant.setExpireTime(Tools.addDays(new Date(), tryDayLimit)); //租户允许试用的天数 + } + result = tenantMapper.insertSelective(tenant); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateTenant(JSONObject obj, HttpServletRequest request) { + Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + //如果租户下的用户限制数量为1,则将该租户之外的用户全部禁用 + if (1 == tenant.getUserNumLimit()) { + userMapperEx.disableUserByLimit(tenant.getTenantId()); + } + result = tenantMapper.updateByPrimaryKeySelective(tenant); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteTenant(Long id, HttpServletRequest request) { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = tenantMapper.deleteByPrimaryKey(id); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteTenant(String ids, HttpServletRequest request) { + List idList = StringUtil.strToLongList(ids); + TenantExample example = new TenantExample(); + example.createCriteria().andIdIn(idList); + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + result = tenantMapper.deleteByExample(example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + TenantExample example = new TenantExample(); + example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name); + List list=null; + try{ + list= tenantMapper.getTenantByTenantId(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + public Tenant getTenantByTenantId(long tenantId) { + Tenant tenant = new Tenant(); + TenantExample example = new TenantExample(); + example.createCriteria().andTenantIdEqualTo(tenantId); + List list = tenantMapper.getTenantByTenantId(example); + if(!list.isEmpty()) { + tenant = list.get(0); + } + return tenant; + } + + public int batchSetStatus(Boolean status, String ids) { + int result=0; + try{ + if(BusinessConstants.DEFAULT_MANAGER.equals(commonService.getCurrentUser().getLoginName())) { + String statusStr = ""; + if (status) { + statusStr = "批量启用"; + } else { + statusStr = "批量禁用"; + } + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + ids + "-" + statusStr, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List idList = StringUtil.strToLongList(ids); + Tenant tenant = new Tenant(); + tenant.setEnabled(status); + TenantExample example = new TenantExample(); + example.createCriteria().andIdIn(idList); + result = tenantMapper.updateByExampleSelective(tenant, example); + } + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java index 598f382f..925ef101 100644 --- a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.tenant.impl; import com.wansensoft.service.tenant.ISysTenantService; -import com.wansensoft.entities.tenant.SysTenant; +import com.wansensoft.entities.SysTenant; import com.wansensoft.mappers.tenant.SysTenantMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 租户 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class SysTenantServiceImpl extends ServiceImpl implements ISysTenantService { diff --git a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java index 26eb89d2..d81ea292 100644 --- a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.tenant.impl; import com.wansensoft.service.tenant.ISysTenantUserService; -import com.wansensoft.entities.tenant.SysTenantUser; +import com.wansensoft.entities.SysTenantUser; import com.wansensoft.mappers.tenant.SysTenantUserMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class SysTenantUserServiceImpl extends ServiceImpl implements ISysTenantUserService { diff --git a/service/src/main/java/com/wansensoft/service/unit/UnitComponent.java b/service/src/main/java/com/wansensoft/service/unit/UnitComponent.java new file mode 100644 index 00000000..5576fbc6 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/unit/UnitComponent.java @@ -0,0 +1,73 @@ +package com.wansensoft.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@UnitResource +public class UnitComponent implements ICommonQuery { + + private final UnitService unitService; + + public UnitComponent(UnitService unitService) { + this.unitService = unitService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return unitService.getUnit(id); + } + + @Override + public List select(Map map)throws Exception { + return getUnitList(map); + } + + private List getUnitList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + String order = QueryUtils.order(map); + return unitService.select(name, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String name = StringUtil.getInfo(search, "name"); + return unitService.countUnit(name); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return unitService.insertUnit(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return unitService.updateUnit(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return unitService.deleteUnit(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return unitService.batchDeleteUnit(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return unitService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/unit/UnitResource.java b/service/src/main/java/com/wansensoft/service/unit/UnitResource.java new file mode 100644 index 00000000..c3aeb613 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/unit/UnitResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.unit; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "unit") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UnitResource { +} diff --git a/service/src/main/java/com/wansensoft/service/unit/UnitService.java b/service/src/main/java/com/wansensoft/service/unit/UnitService.java new file mode 100644 index 00000000..812c3441 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/unit/UnitService.java @@ -0,0 +1,40 @@ +package com.wansensoft.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.unit.Unit; +import jakarta.servlet.http.HttpServletRequest; + +import java.math.BigDecimal; +import java.util.List; + +public interface UnitService extends IService { + + Unit getUnit(long id); + + List getUnitListByIds(String ids); + + List getUnit(); + + List select(String name, int offset, int rows); + + Long countUnit(String name); + + int insertUnit(JSONObject obj, HttpServletRequest request); + + int updateUnit(JSONObject obj, HttpServletRequest request); + + int deleteUnit(Long id, HttpServletRequest request); + + int batchDeleteUnit(String ids, HttpServletRequest request); + + int batchDeleteUnitByIds(String ids); + + int checkIsNameExist(Long id, String name); + + Long getUnitIdByParam(String basicUnit, String otherUnit, BigDecimal ratio); + + BigDecimal parseStockByUnit(BigDecimal stock, Unit unitInfo, String materialUnit); + + int batchSetStatus(Boolean status, String ids); +} diff --git a/service/src/main/java/com/wansensoft/service/unit/UnitServiceImpl.java b/service/src/main/java/com/wansensoft/service/unit/UnitServiceImpl.java new file mode 100644 index 00000000..14d50a81 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/unit/UnitServiceImpl.java @@ -0,0 +1,272 @@ +package com.wansensoft.service.unit; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.material.Material; +import com.wansensoft.entities.unit.Unit; +import com.wansensoft.entities.unit.UnitExample; +import com.wansensoft.entities.user.User; +import com.wansensoft.mappers.material.MaterialMapperEx; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.user.UserService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.mappers.unit.UnitMapper; +import com.wansensoft.mappers.unit.UnitMapperEx; +import com.wansensoft.utils.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class UnitServiceImpl extends ServiceImpl implements UnitService{ + private Logger logger = LoggerFactory.getLogger(UnitServiceImpl.class); + + private final UnitMapper unitMapper; + private final UnitMapperEx unitMapperEx; + private final UserService userService; + private final LogService logService; + private final MaterialMapperEx materialMapperEx; + + public UnitServiceImpl(UnitMapper unitMapper, UnitMapperEx unitMapperEx, UserService userService, LogService logService, MaterialMapperEx materialMapperEx) { + this.unitMapper = unitMapper; + this.unitMapperEx = unitMapperEx; + this.userService = userService; + this.logService = logService; + this.materialMapperEx = materialMapperEx; + } + + public Unit getUnit(long id) { + Unit result=null; + try{ + result=unitMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUnitListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + UnitExample example = new UnitExample(); + example.createCriteria().andIdIn(idList); + list = unitMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getUnit() { + UnitExample example = new UnitExample(); + example.createCriteria().andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=unitMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String name, int offset, int rows) { + List list=null; + try{ + list=unitMapperEx.selectByConditionUnit(name, offset, rows); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countUnit(String name) { + Long result=null; + try{ + result=unitMapperEx.countsByUnit(name); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUnit(JSONObject obj, HttpServletRequest request) { + Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class); + int result=0; + try{ + parseNameByUnit(unit); + unit.setEnabled(true); + result=unitMapper.insertSelective(unit); + logService.insertLog("计量单位", + BusinessConstants.LOG_OPERATION_TYPE_ADD + unit.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUnit(JSONObject obj, HttpServletRequest request) { + Unit unit = JSONObject.parseObject(obj.toJSONString(), Unit.class); + int result=0; + try{ + parseNameByUnit(unit); + result=unitMapper.updateByPrimaryKeySelective(unit); + if(unit.getRatioTwo()==null) { + unitMapperEx.updateRatioTwoById(unit.getId()); + } + if(unit.getRatioThree()==null) { + unitMapperEx.updateRatioThreeById(unit.getId()); + } + logService.insertLog("计量单位", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + unit.getName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + /** + * 根据单位信息生成名称的格式 + * @param unit + */ + private void parseNameByUnit(Unit unit) { + String unitName = unit.getBasicUnit() + "/" + "(" + unit.getOtherUnit() + "=" + unit.getRatio().toString() + unit.getBasicUnit() + ")"; + if(StringUtil.isNotEmpty(unit.getOtherUnitTwo()) && unit.getRatioTwo()!=null) { + unitName += "/" + "(" + unit.getOtherUnitTwo() + "=" + unit.getRatioTwo().toString() + unit.getBasicUnit() + ")"; + if(StringUtil.isNotEmpty(unit.getOtherUnitThree()) && unit.getRatioThree()!=null) { + unitName += "/" + "(" + unit.getOtherUnitThree() + "=" + unit.getRatioThree().toString() + unit.getBasicUnit() + ")"; + } + } + unit.setName(unitName); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUnit(Long id, HttpServletRequest request) { + return batchDeleteUnitByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnit(String ids, HttpServletRequest request) { + return batchDeleteUnitByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUnitByIds(String ids) { + int result=0; + String [] idArray=ids.split(","); + //校验产品表 jsh_material + List materialList=null; + try{ + materialList=materialMapperEx.getMaterialListByUnitIds(idArray); + }catch(Exception e){ + JshException.readFail(logger, e); + } + if(materialList!=null&& !materialList.isEmpty()){ + logger.error("异常码[{}],异常提示[{}],参数,UnitIds[{}]", + ExceptionConstants.DELETE_FORCE_CONFIRM_CODE,ExceptionConstants.DELETE_FORCE_CONFIRM_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.DELETE_FORCE_CONFIRM_CODE, + ExceptionConstants.DELETE_FORCE_CONFIRM_MSG); + } + //记录日志 + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getUnitListByIds(ids); + for(Unit unit: list){ + sb.append("[").append(unit.getName()).append("]"); + } + logService.insertLog("计量单位", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo= userService.getCurrentUser(); + //校验通过执行删除操作 + try{ + result=unitMapperEx.batchDeleteUnitByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + UnitExample example = new UnitExample(); + example.createCriteria().andIdNotEqualTo(id).andNameEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=unitMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + + /** + * 根据条件查询单位id + * @param basicUnit + * @param otherUnit + * @param ratio + * @return + */ + public Long getUnitIdByParam(String basicUnit, String otherUnit, BigDecimal ratio) { + Long unitId = null; + UnitExample example = new UnitExample(); + example.createCriteria().andBasicUnitEqualTo(basicUnit).andOtherUnitEqualTo(otherUnit).andRatioEqualTo(ratio) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list = unitMapper.selectByExample(example); + if(list!=null && !list.isEmpty()) { + unitId = list.get(0).getId(); + } + return unitId; + } + + /** + * 根据多单位的比例进行库存换算(保留两位小数) + * @param stock + * @param unitInfo + * @param materialUnit + * @return + */ + public BigDecimal parseStockByUnit(BigDecimal stock, Unit unitInfo, String materialUnit) { + if(materialUnit.equals(unitInfo.getOtherUnit()) && unitInfo.getRatio()!=null && unitInfo.getRatio().compareTo(BigDecimal.ZERO)!=0) { + stock = stock.divide(unitInfo.getRatio(), 2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitTwo()) && unitInfo.getRatioTwo()!=null && unitInfo.getRatioTwo().compareTo(BigDecimal.ZERO)!=0) { + stock = stock.divide(unitInfo.getRatioTwo(), 2, BigDecimal.ROUND_HALF_UP); + } + if(materialUnit.equals(unitInfo.getOtherUnitThree()) && unitInfo.getRatioThree()!=null && unitInfo.getRatioThree().compareTo(BigDecimal.ZERO)!=0) { + stock = stock.divide(unitInfo.getRatioThree(), 2, BigDecimal.ROUND_HALF_UP); + } + return stock; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Boolean status, String ids) { + logService.insertLog("计量单位", + BusinessConstants.LOG_OPERATION_TYPE_ENABLED, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + List unitIds = StringUtil.strToLongList(ids); + Unit unit = new Unit(); + unit.setEnabled(status); + UnitExample example = new UnitExample(); + example.createCriteria().andIdIn(unitIds); + int result=0; + try{ + result = unitMapper.updateByExampleSelective(unit, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java index 6dc99d86..1895ce32 100644 --- a/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.user; -import com.wansensoft.entities.user.SysUserBusiness; +import com.wansensoft.entities.SysUserBusiness; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 用户/角色/模块关系表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysUserBusinessService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserDeptRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserDeptRelService.java deleted file mode 100644 index eb77ef65..00000000 --- a/service/src/main/java/com/wansensoft/service/user/ISysUserDeptRelService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.service.user; - -import com.wansensoft.entities.user.SysUserDeptRel; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - *

- * 部门用户关系表 服务类 - *

- */ -public interface ISysUserDeptRelService extends IService { - - List queryBatchByUserIds(List userIds); - - List queryByUserId(Long userIds); -} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java new file mode 100644 index 00000000..5c3a7128 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUserOrgRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 机构用户关系表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserOrgRelService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java index 13a64287..18255005 100644 --- a/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java @@ -1,30 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.user; -import com.wansensoft.entities.user.SysUserRoleRel; +import com.wansensoft.entities.SysUserRoleRel; import com.baomidou.mybatisplus.extension.service.IService; -import java.util.List; - /** *

* 用户角色关系表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysUserRoleRelService extends IService { - List queryByUserId(long userId); - - List queryBatchByUserIds(List userIds); } diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserService.java index b1ae5a43..6667570d 100644 --- a/service/src/main/java/com/wansensoft/service/user/ISysUserService.java +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserService.java @@ -1,64 +1,16 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.user; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.user.*; -import com.wansensoft.entities.user.SysUser; +import com.wansensoft.entities.SysUser; import com.baomidou.mybatisplus.extension.service.IService; -import com.wansensoft.utils.response.Response; -import com.wansensoft.vo.UserInfoVO; -import com.wansensoft.vo.UserListVO; -import com.wansensoft.vo.UserRoleVO; - -import java.util.List; /** *

* 用户表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysUserService extends IService { - Response accountRegister(AccountRegisterDTO accountRegisterDto); - - Response accountLogin(AccountLoginDTO accountLoginDto); - - Response mobileLogin(MobileLoginDTO mobileLoginDto); - - Response updatePassword(UpdatePasswordDto updatePasswordDto); - - Response userInfo(); - - UserInfoVO getCurrentUser(); - - String getCurrentUserId(); - - String getCurrentTenantId(); - - String getCurrentUserName(); - - Response> userRole(); - - Response userLogout(); - - Response> userList(UserListDTO pageDto); - - Response updateUser(UpdateUserDTO updateUserDTO); - - Response addOrUpdate(AddOrUpdateUserDTO addOrUpdateUserDTO); - - Response deleteUser(List ids); - - Response resetPassword(Long id); } diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java index a4da5f24..afac8540 100644 --- a/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.user; -import com.wansensoft.entities.user.SysUserWarehouseRel; +import com.wansensoft.entities.SysUserWarehouseRel; import com.baomidou.mybatisplus.extension.service.IService; /** *

- * 用户仓库关联关系服务类 + * 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface ISysUserWarehouseRelService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/user/UserComponent.java b/service/src/main/java/com/wansensoft/service/user/UserComponent.java new file mode 100644 index 00000000..556f514f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/UserComponent.java @@ -0,0 +1,75 @@ +package com.wansensoft.service.user; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.service.ICommonQuery; +import com.wansensoft.utils.Constants; +import com.wansensoft.utils.QueryUtils; +import com.wansensoft.utils.StringUtil; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +@UserResource +public class UserComponent implements ICommonQuery { + + private final UserService userService; + + public UserComponent(UserService userService) { + this.userService = userService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return userService.getUser(id); + } + + @Override + public List select(Map map)throws Exception { + return getUserList(map); + } + + private List getUserList(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String userName = StringUtil.getInfo(search, "userName"); + String loginName = StringUtil.getInfo(search, "loginName"); + String order = QueryUtils.order(map); + String filter = QueryUtils.filter(map); + return userService.select(userName, loginName, QueryUtils.offset(map), QueryUtils.rows(map)); + } + + @Override + public Long counts(Map map)throws Exception { + String search = map.get(Constants.SEARCH); + String userName = StringUtil.getInfo(search, "userName"); + String loginName = StringUtil.getInfo(search, "loginName"); + return userService.countUser(userName, loginName); + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request)throws Exception { + return userService.insertUser(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return userService.updateUser(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return userService.deleteUser(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return userService.batchDeleteUser(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return userService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/user/UserResource.java b/service/src/main/java/com/wansensoft/service/user/UserResource.java new file mode 100644 index 00000000..13e35f24 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/UserResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.user; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "user") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserResource { +} diff --git a/service/src/main/java/com/wansensoft/service/user/UserService.java b/service/src/main/java/com/wansensoft/service/user/UserService.java new file mode 100644 index 00000000..3f8cc7d9 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/UserService.java @@ -0,0 +1,82 @@ +package com.wansensoft.service.user; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserEx; +import com.wansensoft.vo.TreeNodeEx; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; +import java.util.Map; + +public interface UserService extends IService { + + User getUser(long id); + + List getUserListByIds(String ids); + + List getUser(); + + List select(String userName, String loginName, int offset, int rows); + + Long countUser(String userName, String loginName); + + int insertUser(JSONObject obj, HttpServletRequest request); + + int updateUser(JSONObject obj, HttpServletRequest request); + + int updateUserByObj(User user); + + int resetPwd(String md5Pwd, Long id); + + int deleteUser(Long id, HttpServletRequest request); + + int batchDeleteUser(String ids, HttpServletRequest request); + + int batDeleteUser(String ids); + + Map login(User userParam, HttpServletRequest request); + + int validateUser(String loginName, String password); + + User getUserByLoginName(String loginName); + + int checkIsNameExist(Long id, String name); + + User getCurrentUser(); + + Long getIdByLoginName(String loginName); + + void addUserAndOrgUserRel(UserEx ue, HttpServletRequest request); + + UserEx addUser(UserEx ue); + + UserEx registerUser(UserEx ue, Integer manageRoleId, HttpServletRequest request); + + void updateUserTenant(User user); + + void updateUserAndOrgUserRel(UserEx ue, HttpServletRequest request); + + UserEx updateUser(UserEx ue); + + void checkLoginName(UserEx userEx); + + List getUserListByloginName(String loginName); + + List getOrganizationUserTree(); + + Role getRoleTypeByUserId(long userId); + + Long getUserId(HttpServletRequest request); + + JSONArray getBtnStrArrById(Long userId); + + int batchSetStatus(Byte status, String ids, HttpServletRequest request); + + User getUserByWeixinCode(String weixinCode); + + int weixinBind(String loginName, String password, String weixinCode); +} diff --git a/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java new file mode 100644 index 00000000..0ed59b52 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java @@ -0,0 +1,921 @@ +package com.wansensoft.service.user; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.function.Function; +import com.wansensoft.entities.organization.OrgaUserRel; +import com.wansensoft.entities.role.Role; +import com.wansensoft.entities.tenant.Tenant; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.entities.user.UserEx; +import com.wansensoft.entities.user.UserExample; +import com.wansensoft.mappers.role.RoleMapper; +import com.wansensoft.mappers.role.RoleMapperEx; +import com.wansensoft.mappers.user.UserMapper; +import com.wansensoft.mappers.user.UserMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.functions.FunctionService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.service.orgaUserRel.OrgaUserRelService; +import com.wansensoft.service.platformConfig.PlatformConfigService; +import com.wansensoft.service.redis.RedisService; +import com.wansensoft.service.tenant.TenantService; +import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.utils.HttpClient; +import com.wansensoft.utils.ExceptionCodeConstants; +import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.Tools; +import com.wansensoft.utils.redis.RedisUtil; +import com.wansensoft.vo.TreeNodeEx; +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.utils.constants.ExceptionConstants; +import com.wansensoft.plugins.exception.BusinessRunTimeException; +import com.wansensoft.plugins.exception.JshException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.security.NoSuchAlgorithmException; +import java.util.*; + +@Service +public class UserServiceImpl extends ServiceImpl implements UserService{ + private Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + private final UserMapper userMapper; + private final UserMapperEx userMapperEx; + private final OrgaUserRelService orgaUserRelService; + private final LogService logService; + private final TenantService tenantService; + private final UserBusinessService userBusinessService; + private final FunctionService functionService; + private final PlatformConfigService platformConfigService; + private final RedisService redisService; + + private final RoleMapperEx roleMapperEx; + + public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUserRelService orgaUserRelService, LogService logService, TenantService tenantService, UserBusinessService userBusinessService, FunctionService functionService, PlatformConfigService platformConfigService, RedisService redisService, RoleMapperEx roleMapperEx) { + this.userMapper = userMapper; + this.userMapperEx = userMapperEx; + this.orgaUserRelService = orgaUserRelService; + this.logService = logService; + this.tenantService = tenantService; + this.userBusinessService = userBusinessService; + this.roleMapperEx = roleMapperEx; + this.functionService = functionService; + this.platformConfigService = platformConfigService; + this.redisService = redisService; + } + + public User getUser(long id) { + User result=null; + try{ + result=userMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUserListByIds(String ids) { + List idList = StringUtil.strToLongList(ids); + List list = new ArrayList<>(); + try{ + UserExample example = new UserExample(); + example.createCriteria().andIdIn(idList); + list = userMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getUser() { + UserExample example = new UserExample(); + example.createCriteria().andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list=null; + try{ + list=userMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List select(String userName, String loginName, int offset, int rows) { + List list=null; + try{ + list=userMapperEx.selectByConditionUser(userName, loginName, offset, rows); + for(UserEx ue: list){ + String userType = ""; + if (ue.getId().equals(ue.getTenantId())) { + userType = "租户"; + } else if(ue.getTenantId() == null){ + userType = "超管"; + } else { + userType = "普通"; + } + ue.setUserType(userType); + //是否经理 + String leaderFlagStr = ""; + if("1".equals(ue.getLeaderFlag())) { + leaderFlagStr = "是"; + } else { + leaderFlagStr = "否"; + } + ue.setLeaderFlagStr(leaderFlagStr); + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public Long countUser(String userName, String loginName) { + Long result=null; + try{ + result=userMapperEx.countsByUser(userName, loginName); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + /** + * description: + * 添加事务控制 + * @Param: beanJson + * @Param: request + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUser(JSONObject obj, HttpServletRequest request) { + User user = JSONObject.parseObject(obj.toJSONString(), User.class); + String password = "123456"; + //因密码用MD5加密,需要对密码进行转化 + try { + password = Tools.md5Encryp(password); + user.setPassword(password); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + logger.error(">>>>>>>>>>>>>>转化MD5字符串错误 :" + e.getMessage()); + } + int result=0; + try{ + result=userMapper.insertSelective(user); + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_ADD + user.getLoginName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * description: + * 添加事务控制 + * @Param: beanJson + * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUser(JSONObject obj, HttpServletRequest request) { + User user = JSONObject.parseObject(obj.toJSONString(), User.class); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + user.getLoginName(), request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * description: + * 添加事务控制 + * @Param: user + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUserByObj(User user) { + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + user.getId(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + int result=0; + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + /** + * description: + * 添加事务控制 + * @Param: md5Pwd + * @Param: id + * @return int + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int resetPwd(String md5Pwd, Long id) { + int result=0; + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + id, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User u = getUser(id); + String loginName = u.getLoginName(); + if("admin".equals(loginName)){ + logger.info("禁止重置超管密码"); + } else { + User user = new User(); + user.setId(id); + user.setPassword(md5Pwd); + try{ + result=userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUser(Long id, HttpServletRequest request) { + return batDeleteUser(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUser(String ids, HttpServletRequest request) { + return batDeleteUser(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batDeleteUser(String ids) { + int result=0; + StringBuffer sb = new StringBuffer(); + sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE); + List list = getUserListByIds(ids); + for(User user: list){ + if(user.getId().equals(user.getTenantId())) { + logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", + ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE,ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.USER_LIMIT_TENANT_DELETE_CODE, + ExceptionConstants.USER_LIMIT_TENANT_DELETE_MSG); + } + sb.append("[").append(user.getLoginName()).append("]"); + } + logService.insertLog("用户", sb.toString(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + String idsArray[]=ids.split(","); + try{ + result=userMapperEx.batDeleteOrUpdateUser(idsArray,BusinessConstants.USER_STATUS_DELETE); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result<1){ + logger.error("异常码[{}],异常提示[{}],参数,ids:[{}]", + ExceptionConstants.USER_DELETE_FAILED_CODE,ExceptionConstants.USER_DELETE_FAILED_MSG,ids); + throw new BusinessRunTimeException(ExceptionConstants.USER_DELETE_FAILED_CODE, + ExceptionConstants.USER_DELETE_FAILED_MSG); + } + return result; + } + + /** + * 用户登录 + * @param userParam + * @param request + * @return + * @throws Exception + */ + public Map login(User userParam, HttpServletRequest request) { + Map data = new HashMap<>(); + String msgTip = ""; + User user=null; + String loginName = userParam.getLoginName().trim(); + String password = userParam.getPassword().trim(); + //判断用户是否已经登录过,登录过不再处理 + Object userId = redisService.getObjectFromSessionByKey(request,"userId"); + if (userId != null) { + logger.info("====用户已经登录过, login 方法调用结束===="); + msgTip = "user already login"; + } + //获取用户状态 + int userStatus = -1; + try { + redisService.deleteObjectBySession(request,"userId"); + userStatus = validateUser(loginName, password); + } catch (Exception e) { + e.printStackTrace(); + logger.error(">>>>>>>>>>>>>用户 " + loginName + " 登录 login 方法 访问服务层异常====", e); + msgTip = "access service exception"; + } + String token = UUID.randomUUID().toString().replaceAll("-", "") + ""; + switch (userStatus) { + case ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST: + msgTip = "user is not exist"; + break; + case ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR: + msgTip = "user password error"; + break; + case ExceptionCodeConstants.UserExceptionCode.BLACK_USER: + msgTip = "user is black"; + break; + case ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION: + msgTip = "access service error"; + break; + case ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT: + msgTip = "tenant is black"; + break; + case ExceptionCodeConstants.UserExceptionCode.EXPIRE_TENANT: + msgTip = "tenant is expire"; + break; + case ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT: + msgTip = "user can login"; + //验证通过 ,可以登录,放入session,记录登录日志 + user = getUserByLoginName(loginName); + if(user.getTenantId()!=null) { + token = token + "_" + user.getTenantId(); + } + redisService.storageObjectBySession(token,"userId",user.getId()); + break; + default: + break; + } + data.put("msgTip", msgTip); + if(user!=null){ + String roleType = getRoleTypeByUserId(user.getId()).getType(); //角色类型 + redisService.storageObjectBySession(token,"roleType",roleType); + redisService.storageObjectBySession(token,"clientIp", Tools.getLocalIp(request)); + logService.insertLogWithUserId(user.getId(), user.getTenantId(), "用户", + BusinessConstants.LOG_OPERATION_TYPE_LOGIN + user.getLoginName(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + JSONArray btnStrArr = getBtnStrArrById(user.getId()); + data.put("token", token); + data.put("user", user); + //用户的按钮权限 + if(!"admin".equals(user.getLoginName())){ + data.put("userBtn", btnStrArr); + } + data.put("roleType", roleType); + } + return data; + } + + public int validateUser(String loginName, String password) { + /**默认是可以登录的*/ + List list = null; + try { + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusNotEqualTo(BusinessConstants.USER_STATUS_DELETE); + list = userMapper.selectByExample(example); + if (null != list && list.isEmpty()) { + return ExceptionCodeConstants.UserExceptionCode.USER_NOT_EXIST; + } else if(list.size() ==1) { + if(list.get(0).getStatus()!=0) { + return ExceptionCodeConstants.UserExceptionCode.BLACK_USER; + } + Long tenantId = list.get(0).getTenantId(); + Tenant tenant = tenantService.getTenantByTenantId(tenantId); + if(tenant!=null) { + if(tenant.getEnabled()!=null && !tenant.getEnabled()) { + return ExceptionCodeConstants.UserExceptionCode.BLACK_TENANT; + } + if(tenant.getExpireTime()!=null && tenant.getExpireTime().getTime()>>>>>>>访问验证用户姓名是否存在后台信息异常", e); + return ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION; + } + try { + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andPasswordEqualTo(password) + .andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + list = userMapper.selectByExample(example); + if (null != list && list.size() == 0) { + return ExceptionCodeConstants.UserExceptionCode.USER_PASSWORD_ERROR; + } + } catch (Exception e) { + logger.error(">>>>>>>>>>访问验证用户密码后台信息异常", e); + return ExceptionCodeConstants.UserExceptionCode.USER_ACCESS_EXCEPTION; + } + return ExceptionCodeConstants.UserExceptionCode.USER_CONDITION_FIT; + } + + public User getUserByLoginName(String loginName) { + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + User user =null; + if(list!=null&&list.size()>0){ + user = list.get(0); + } + return user; + } + + public int checkIsNameExist(Long id, String name) { + UserExample example = new UserExample(); + List userStatus=new ArrayList(); + userStatus.add(BusinessConstants.USER_STATUS_DELETE); + userStatus.add(BusinessConstants.USER_STATUS_BANNED); + example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name).andStatusNotIn(userStatus); + List list=null; + try{ + list= userMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list==null?0:list.size(); + } + /** + * description: + * 获取当前用户信息 + * @Param: + * @return com.jsh.erp.datasource.entities.User + */ + public User getCurrentUser() { + HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); + Long userId = Long.parseLong(redisService.getObjectFromSessionByKey(request,"userId").toString()); + return getUser(userId); + } + + /** + * 根据用户名查询id + * @param loginName + * @return + */ + public Long getIdByLoginName(String loginName) { + Long userId = 0L; + UserExample example = new UserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusEqualTo(BusinessConstants.USER_STATUS_NORMAL); + List list = userMapper.selectByExample(example); + if(list!=null) { + userId = list.get(0).getId(); + } + return userId; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void addUserAndOrgUserRel(UserEx ue, HttpServletRequest request) { + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_ADD, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //检查用户名和登录名 + checkLoginName(ue); + //新增用户信息 + ue= this.addUser(ue); + if(ue==null){ + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.USER_ADD_FAILED_CODE,ExceptionConstants.USER_ADD_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.USER_ADD_FAILED_CODE, + ExceptionConstants.USER_ADD_FAILED_MSG); + } + //用户id,根据用户名查询id + Long userId = getIdByLoginName(ue.getLoginName()); + if(ue.getRoleId()!=null){ + JSONObject ubObj = new JSONObject(); + ubObj.put("type", "UserRole"); + ubObj.put("keyid", userId); + ubObj.put("value", "[" + ue.getRoleId() + "]"); + userBusinessService.insertUserBusiness(ubObj, request); + } + if(ue.getOrgaId()==null){ + //如果没有选择机构,就不建机构和用户的关联关系 + return; + } + if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){ + //检查当前机构是否存在经理 + List checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId()); + if(checkList.size()>0) { + throw new BusinessRunTimeException(ExceptionConstants.USER_LEADER_IS_EXIST_CODE, + ExceptionConstants.USER_LEADER_IS_EXIST_MSG); + } + } + //新增用户和机构关联关系 + OrgaUserRel oul=new OrgaUserRel(); + //机构id + oul.setOrgaId(ue.getOrgaId()); + oul.setUserId(userId); + //用户在机构中的排序 + oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); + oul = orgaUserRelService.addOrgaUserRel(oul); + if(oul==null){ + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE,ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_ADD_FAILED_CODE, + ExceptionConstants.ORGA_USER_REL_ADD_FAILED_MSG); + } + } + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx addUser(UserEx ue) { + /** + * 新增用户默认设置 + * 1、密码默认123456 + * 2是否系统自带默认为非系统自带 + * 3是否管理者默认为员工 + * 4默认用户状态为正常 + * */ + if(ue.getIsmanager()==null){ + ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); + } + ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); + int result=0; + try{ + ue.setPassword(Tools.md5Encryp(BusinessConstants.USER_DEFAULT_PASSWORD)); + ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); + result= userMapper.insertSelective(ue); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result>0){ + return ue; + } + return null; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx registerUser(UserEx ue, Integer manageRoleId, HttpServletRequest request) { + /** + * create by: qiankunpingtai + * create time: 2019/4/9 18:00 + * 多次创建事务,事物之间无法协同,应该在入口处创建一个事务以做协调 + */ + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + ue.setPassword(ue.getPassword()); + ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM); + if (ue.getIsmanager() == null) { + ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER); + } + ue.setStatus(BusinessConstants.USER_STATUS_NORMAL); + int result=0; + try{ + result= userMapper.insertSelective(ue); + Long userId = getIdByLoginName(ue.getLoginName()); + ue.setId(userId); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + //更新租户id + User user = new User(); + user.setId(ue.getId()); + user.setTenantId(ue.getId()); + updateUserTenant(user); + //新增用户与角色的关系 + JSONObject ubObj = new JSONObject(); + ubObj.put("type", "UserRole"); + ubObj.put("keyid", ue.getId()); + JSONArray ubArr = new JSONArray(); + ubArr.add(manageRoleId); + ubObj.put("value", ubArr.toString()); + ubObj.put("tenantId", ue.getId()); + userBusinessService.insertUserBusiness(ubObj, null); + //创建租户信息 + JSONObject tenantObj = new JSONObject(); + tenantObj.put("tenantId", ue.getId()); + tenantObj.put("loginName",ue.getLoginName()); + tenantObj.put("userNumLimit", ue.getUserNumLimit()); + tenantObj.put("expireTime", ue.getExpireTime()); + tenantObj.put("remark", ue.getRemark()); + tenantService.insertTenant(tenantObj, request); + logger.info("===============创建租户信息完成==============="); + if (result > 0) { + return ue; + } + return null; + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateUserTenant(User user) { + UserExample example = new UserExample(); + example.createCriteria().andIdEqualTo(user.getId()); + try{ + userMapper.updateByPrimaryKeySelective(user); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public void updateUserAndOrgUserRel(UserEx ue, HttpServletRequest request) { + if(BusinessConstants.DEFAULT_MANAGER.equals(ue.getLoginName())) { + throw new BusinessRunTimeException(ExceptionConstants.USER_NAME_LIMIT_USE_CODE, + ExceptionConstants.USER_NAME_LIMIT_USE_MSG); + } else { + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + ue.getId(), + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + //检查用户名和登录名 + checkLoginName(ue); + //更新用户信息 + ue = this.updateUser(ue); + if (ue == null) { + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.USER_EDIT_FAILED_CODE, ExceptionConstants.USER_EDIT_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.USER_EDIT_FAILED_CODE, + ExceptionConstants.USER_EDIT_FAILED_MSG); + } + if(ue.getRoleId()!=null){ + JSONObject ubObj = new JSONObject(); + ubObj.put("type", "UserRole"); + ubObj.put("keyid", ue.getId()); + ubObj.put("value", "[" + ue.getRoleId() + "]"); + Long ubId = userBusinessService.checkIsValueExist("UserRole", ue.getId().toString()); + if(ubId!=null) { + ubObj.put("id", ubId); + userBusinessService.updateUserBusiness(ubObj, request); + } else { + userBusinessService.insertUserBusiness(ubObj, request); + } + } + if (ue.getOrgaId() == null) { + //如果没有选择机构,就不建机构和用户的关联关系 + return; + } + if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){ + //检查当前机构是否存在经理 + List checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId()); + if(checkList.size()>0) { + throw new BusinessRunTimeException(ExceptionConstants.USER_LEADER_IS_EXIST_CODE, + ExceptionConstants.USER_LEADER_IS_EXIST_MSG); + } + } + //更新用户和机构关联关系 + OrgaUserRel oul = new OrgaUserRel(); + //机构和用户关联关系id + oul.setId(ue.getOrgaUserRelId()); + //机构id + oul.setOrgaId(ue.getOrgaId()); + //用户id + oul.setUserId(ue.getId()); + //用户在机构中的排序 + oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq()); + if (oul.getId() != null) { + //已存在机构和用户的关联关系,更新 + oul = orgaUserRelService.updateOrgaUserRel(oul); + } else { + //不存在机构和用户的关联关系,新建 + oul = orgaUserRelService.addOrgaUserRel(oul); + } + if (oul == null) { + logger.error("异常码[{}],异常提示[{}],参数,[{}]", + ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); + throw new BusinessRunTimeException(ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_CODE, + ExceptionConstants.ORGA_USER_REL_EDIT_FAILED_MSG); + } + } + } + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public UserEx updateUser(UserEx ue) { + int result =0; + try{ + result=userMapper.updateByPrimaryKeySelective(ue); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + if(result>0){ + return ue; + } + return null; + } + /** + * 检查登录名不能重复 + * @Param: userEx + * @return void + */ + public void checkLoginName(UserEx userEx) { + List list=null; + if(userEx==null){ + return; + } + Long userId=userEx.getId(); + //检查登录名 + if(!StringUtils.isEmpty(userEx.getLoginName())){ + String loginName=userEx.getLoginName(); + list=this.getUserListByloginName(loginName); + if(list!=null&&list.size()>0){ + if(list.size()>1){ + //超过一条数据存在,该登录名已存在 + logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); + throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); + } + //一条数据,新增时抛出异常,修改时和当前的id不同时抛出异常 + if(list.size()==1){ + if(userId==null||(userId!=null&&!userId.equals(list.get(0).getId()))){ + logger.error("异常码[{}],异常提示[{}],参数,loginName:[{}]", + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE,ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG,loginName); + throw new BusinessRunTimeException(ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_CODE, + ExceptionConstants.USER_LOGIN_NAME_ALREADY_EXISTS_MSG); + } + } + } + } + } + /** + * 通过登录名获取用户列表 + * */ + public List getUserListByloginName(String loginName) { + List list =null; + try{ + list=userMapperEx.getUserListByUserNameOrLoginName(null,loginName); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getOrganizationUserTree() { + List list =null; + try{ + list=userMapperEx.getNodeTree(); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + /** + * 根据用户id查询角色信息 + * @param userId + * @return + */ + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public Role getRoleTypeByUserId(long userId) { + + List list = userBusinessService.getBasicData(String.valueOf(userId), "UserRole"); + String roleId = "null"; + UserBusiness ub = null; + if(!list.isEmpty()) { + ub = list.get(0); + String values = ub.getValue(); + if(values!=null) { + values = values.replaceAll("\\[\\]",",").replace("[","").replace("]",""); + } + String [] valueArray=values.split(","); + if(valueArray.length>0) { + roleId = valueArray[0]; + } + } + Role role = roleMapperEx.getRoleWithoutTenant(Long.valueOf(roleId)); + return role; + } + + /** + * 获取用户id + * @param request + * @return + */ + public Long getUserId(HttpServletRequest request) { + Object userIdObj = redisService.getObjectFromSessionByKey(request,"userId"); + Long userId = null; + if(userIdObj != null) { + userId = Long.parseLong(userIdObj.toString()); + } + return userId; + } + + /** + * 用户的按钮权限 + * @param userId + * @return + * @throws Exception + */ + public JSONArray getBtnStrArrById(Long userId) { + JSONArray btnStrArr = new JSONArray(); + List userRoleList = userBusinessService.getBasicData(userId.toString(), "UserRole"); + if(userRoleList!=null && !userRoleList.isEmpty()) { + String roleValue = userRoleList.get(0).getValue(); + if(StringUtil.isNotEmpty(roleValue) && roleValue.contains("[") && roleValue.contains("]")){ + roleValue = roleValue.replace("[", "").replace("]", ""); //角色id-单个 + List roleFunctionsList = userBusinessService.getBasicData(roleValue, "RoleFunctions"); + if(roleFunctionsList!=null && !roleFunctionsList.isEmpty()) { + String btnStr = roleFunctionsList.get(0).getBtnStr(); + if(StringUtil.isNotEmpty(btnStr)){ + btnStrArr = JSONArray.parseArray(btnStr); + } + } + } + } + //将数组中的funId转为url + JSONArray btnStrWithUrlArr = new JSONArray(); + if(!btnStrArr.isEmpty()) { + List functionList = functionService.getFunction(); + Map functionMap = new HashMap<>(); + for (Function function: functionList) { + functionMap.put(function.getId(), function.getUrl()); + } + for (Object obj : btnStrArr) { + JSONObject btnStrObj = JSONObject.parseObject(obj.toString()); + Long funId = btnStrObj.getLong("funId"); + JSONObject btnStrWithUrlObj = new JSONObject(); + btnStrWithUrlObj.put("url", functionMap.get(funId)); + btnStrWithUrlObj.put("btnStr", btnStrObj.getString("btnStr")); + btnStrWithUrlArr.add(btnStrWithUrlObj); + } + } + return btnStrWithUrlArr; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchSetStatus(Byte status, String ids, HttpServletRequest request) { + int result=0; + List list = getUserListByIds(ids); + //选中的用户的数量 + int selectUserSize = list.size(); + //查询启用状态的用户的数量 + int enableUserSize = getUser().size(); + User userInfo = getCurrentUser(); + Tenant tenant = tenantService.getTenantByTenantId(userInfo.getTenantId()); + if(tenant!=null) { + if (selectUserSize + enableUserSize > tenant.getUserNumLimit() && status == 0) { +// throw new BusinessParamCheckingException(ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_CODE, +// ExceptionConstants.USER_ENABLE_OVER_LIMIT_FAILED_MSG); + } + } + StringBuilder userStr = new StringBuilder(); + List idList = new ArrayList<>(); + for(User user: list) { + if(user.getId().equals(user.getTenantId())) { + //租户不能进行禁用 + } else { + idList.add(user.getId()); + userStr.append(user.getLoginName()).append(" "); + } + } + String statusStr =""; + if(status == 0) { + statusStr ="批量启用"; + } else if(status == 2) { + statusStr ="批量禁用"; + } + if(idList.size()>0) { + User user = new User(); + user.setStatus(status); + UserExample example = new UserExample(); + example.createCriteria().andIdIn(idList); + result = userMapper.updateByExampleSelective(user, example); + logService.insertLog("用户", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + userStr + "-" + statusStr, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + } else { + result = 1; + } + return result; + } + + public User getUserByWeixinCode(String weixinCode) { + String weixinUrl = platformConfigService.getPlatformConfigByKey("weixinUrl").getPlatformValue(); + String weixinAppid = platformConfigService.getPlatformConfigByKey("weixinAppid").getPlatformValue(); + String weixinSecret = platformConfigService.getPlatformConfigByKey("weixinSecret").getPlatformValue(); + String url = weixinUrl + "?appid=" + weixinAppid + "&secret=" + weixinSecret + "&js_code=" + weixinCode + + "&grant_type=authorization_code"; + JSONObject jsonObject = HttpClient.httpGet(url); + if(jsonObject!=null) { + String weixinOpenId = jsonObject.getString("openid"); + if(StringUtil.isNotEmpty(weixinOpenId)) { + return userMapperEx.getUserByWeixinOpenId(weixinOpenId); + } + } + return null; + } + + public int weixinBind(String loginName, String password, String weixinCode) { + String weixinUrl = platformConfigService.getPlatformConfigByKey("weixinUrl").getPlatformValue(); + String weixinAppid = platformConfigService.getPlatformConfigByKey("weixinAppid").getPlatformValue(); + String weixinSecret = platformConfigService.getPlatformConfigByKey("weixinSecret").getPlatformValue(); + String url = weixinUrl + "?appid=" + weixinAppid + "&secret=" + weixinSecret + "&js_code=" + weixinCode + + "&grant_type=authorization_code"; + JSONObject jsonObject = HttpClient.httpGet(url); + if(jsonObject!=null) { + String weixinOpenId = jsonObject.getString("openid"); + if(StringUtil.isNotEmpty(weixinOpenId)) { + return userMapperEx.updateUserWithWeixinOpenId(loginName, password, weixinOpenId); + } + } + return 0; + } +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java index 4ee37664..e32608dd 100644 --- a/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java @@ -1,6 +1,6 @@ package com.wansensoft.service.user.impl; -import com.wansensoft.entities.user.SysUserBusiness; +import com.wansensoft.entities.SysUserBusiness; import com.wansensoft.mappers.user.SysUserBusinessMapper; import com.wansensoft.service.user.ISysUserBusinessService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserDeptRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserDeptRelServiceImpl.java deleted file mode 100644 index a909c6a4..00000000 --- a/service/src/main/java/com/wansensoft/service/user/impl/SysUserDeptRelServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.wansensoft.service.user.impl; - -import com.wansensoft.entities.user.SysUserDeptRel; -import com.wansensoft.mappers.user.SysUserDeptRelMapper; -import com.wansensoft.service.user.ISysUserDeptRelService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - *

- * 部门用户关系表 服务实现类 - *

- * - * @author James Zow - * @since 2023-09-05 - */ -@Service -public class SysUserDeptRelServiceImpl extends ServiceImpl implements ISysUserDeptRelService { - - @Override - public List queryBatchByUserIds(List userIds) { - return lambdaQuery() - .in(SysUserDeptRel::getUserId, userIds) - .list(); - } - - @Override - public List queryByUserId(Long userIds) { - return lambdaQuery() - .eq(SysUserDeptRel::getUserId, userIds) - .list(); - } -} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java new file mode 100644 index 00000000..61eb317b --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUserOrgRel; +import com.wansensoft.mappers.user.SysUserOrgRelMapper; +import com.wansensoft.service.user.ISysUserOrgRelService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 机构用户关系表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserOrgRelServiceImpl extends ServiceImpl implements ISysUserOrgRelService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java index 3b100606..f19296d4 100644 --- a/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java @@ -1,13 +1,11 @@ package com.wansensoft.service.user.impl; -import com.wansensoft.entities.user.SysUserRoleRel; +import com.wansensoft.entities.SysUserRoleRel; import com.wansensoft.mappers.user.SysUserRoleRelMapper; import com.wansensoft.service.user.ISysUserRoleRelService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; -import java.util.List; - /** *

* 用户角色关系表 服务实现类 @@ -19,17 +17,4 @@ @Service public class SysUserRoleRelServiceImpl extends ServiceImpl implements ISysUserRoleRelService { - @Override - public List queryByUserId(long userId) { - return lambdaQuery() - .eq(SysUserRoleRel::getUserId, userId) - .list(); - } - - @Override - public List queryBatchByUserIds(List userIds) { - return lambdaQuery() - .in(SysUserRoleRel::getUserId, userIds) - .list(); - } } diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java index a2e3f932..741050c4 100644 --- a/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java @@ -1,53 +1,10 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.user.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.wansensoft.dto.user.*; -import com.wansensoft.entities.user.SysUser; -import com.wansensoft.entities.user.SysUserDeptRel; -import com.wansensoft.entities.user.SysUserRoleRel; -import com.wansensoft.mappers.role.SysRoleMapper; -import com.wansensoft.mappers.system.SysDepartmentMapper; +import com.wansensoft.entities.SysUser; import com.wansensoft.mappers.user.SysUserMapper; -import com.wansensoft.middleware.security.JWTUtil; -import com.wansensoft.service.user.ISysUserDeptRelService; -import com.wansensoft.service.user.ISysUserRoleRelService; import com.wansensoft.service.user.ISysUserService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.wansensoft.utils.SnowflakeIdUtil; -import com.wansensoft.utils.constants.CommonConstants; -import com.wansensoft.utils.constants.UserConstants; -import com.wansensoft.utils.enums.UserCodeEnum; -import com.wansensoft.utils.response.Response; -import com.wansensoft.utils.CommonTools; -import com.wansensoft.utils.constants.SecurityConstants; -import com.wansensoft.utils.enums.BaseCodeEnum; -import com.wansensoft.utils.redis.RedisUtil; -import com.wansensoft.vo.UserInfoVO; -import com.wansensoft.vo.UserListVO; -import com.wansensoft.vo.UserRoleVO; -import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import java.time.LocalDateTime; -import java.util.*; /** *

@@ -58,576 +15,6 @@ * @since 2023-09-05 */ @Service -@Slf4j public class SysUserServiceImpl extends ServiceImpl implements ISysUserService { - private final SysUserMapper userMapper; - - private final RedisUtil redisUtil; - - private final JWTUtil jwtUtil; - - private final ISysUserRoleRelService userRoleRelService; - - private final ISysUserDeptRelService userDeptRelService; - - private final SysRoleMapper roleMapper; - - private final SysDepartmentMapper departmentMapper; - - public SysUserServiceImpl(SysUserMapper userMapper, RedisUtil redisUtil, JWTUtil jwtUtil, ISysUserRoleRelService userRoleRelService, - ISysUserDeptRelService userDeptRelService, SysRoleMapper roleMapper, SysDepartmentMapper departmentMapper) { - this.userMapper = userMapper; - this.redisUtil = redisUtil; - this.jwtUtil = jwtUtil; - this.userRoleRelService = userRoleRelService; - this.userDeptRelService = userDeptRelService; - this.roleMapper = roleMapper; - this.departmentMapper = departmentMapper; - } - - - @Override - public Response accountRegister(AccountRegisterDTO accountRegisterDto) { - if (accountRegisterDto == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - var verifyCode = redisUtil.get(SecurityConstants.REGISTER_VERIFY_CODE_CACHE_PREFIX + accountRegisterDto.getPhoneNumber()); - if (ObjectUtils.isEmpty(verifyCode)) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_EXPIRE); - } - - if (!String.valueOf(verifyCode).equals(accountRegisterDto.getSms())) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_ERROR); - } - - // check if the username under the same tenant is duplicate - if (checkUserNameExist(accountRegisterDto.getUsername())) { - return Response.responseMsg(UserCodeEnum.USER_NAME_EXISTS); - } - - if (checkPhoneNumberExist(accountRegisterDto.getPhoneNumber())) { - return Response.responseMsg(UserCodeEnum.USER_REGISTER_PHONE_EXISTS); - } - - // start register - boolean result = save(SysUser.builder() - .id(SnowflakeIdUtil.nextId()) - .userName(accountRegisterDto.getUsername()) - .name("测试租户") - .password(CommonTools.md5Encryp(accountRegisterDto.getPassword())) - .phoneNumber(accountRegisterDto.getPhoneNumber()) - .tenantId(SnowflakeIdUtil.nextId()) - .build()); - if (!result) { - return Response.fail(); - } - - return Response.responseMsg(UserCodeEnum.USER_REGISTER_SUCCESS); - } - - @Override - public Response accountLogin(AccountLoginDTO accountLoginDto) { - - var verifyCode = redisUtil.get(SecurityConstants.EMAIL_VERIFY_CODE_CACHE_PREFIX + accountLoginDto.getCaptchaId()); - if (ObjectUtils.isEmpty(verifyCode)) { - return Response.responseMsg(BaseCodeEnum.VERIFY_CODE_EXPIRE); - } - - if (!String.valueOf(verifyCode).equals(accountLoginDto.getCaptcha())) { - return Response.responseMsg(BaseCodeEnum.VERIFY_CODE_ERROR); - } - - var user = lambdaQuery() - .eq(SysUser::getUserName, accountLoginDto.getUsername()) - .eq(SysUser::getPassword, CommonTools.md5Encryp(accountLoginDto.getPassword())) - .one(); - - if (user == null) { - return Response.responseMsg(UserCodeEnum.USERNAME_OR_PASSWORD_ERROR); - } - - if (user.getStatus() == UserConstants.USER_STATUS_DISABLE) { - return Response.responseMsg(UserCodeEnum.USER_ACCOUNT_FREEZE); - } - - if (user.getDeleteFlag() == CommonConstants.DELETED) { - return Response.responseMsg(UserCodeEnum.USER_ACCOUNT_INVALID); - } - - var token = ""; - if (redisUtil.hasKey(user.getUserName() + ":token")) { - token = String.valueOf(redisUtil.get(user.getUserName() + ":token")); - } else { - // 生成JWT的令牌 - token = jwtUtil.createToken(accountLoginDto.getUsername()); - redisUtil.set(accountLoginDto.getUsername() + ":token", token); - redisUtil.expire(accountLoginDto.getUsername() + ":token", 86400); - // 同时存放userId和userName 租户id - redisUtil.set(token + ":userName", user.getUserName(), 86400); - redisUtil.set(token + ":userId", String.valueOf(user.getId()), 86400); - redisUtil.set(token + ":tenantId", String.valueOf(user.getTenantId()), 86400); - } - - return Response.responseData(UserInfoVO.builder() - .id(user.getId()) - .token(token) - .expire(1694757956L) - .build()); - } - - @Override - public Response mobileLogin(MobileLoginDTO mobileLoginDto) { - var verifyCode = redisUtil.getString(SecurityConstants.LOGIN_VERIFY_CODE_CACHE_PREFIX + mobileLoginDto.getPhoneNumber()); - if (ObjectUtils.isEmpty(verifyCode)) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_EXPIRE); - } - - if (!verifyCode.equals(mobileLoginDto.getSms())) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_ERROR); - } - - var user = lambdaQuery() - .eq(SysUser::getPhoneNumber, mobileLoginDto.getPhoneNumber()) - .one(); - - if (user == null) { - return Response.responseMsg(UserCodeEnum.USER_NOT_EXISTS); - } - - if (user.getStatus() == UserConstants.USER_STATUS_DISABLE) { - return Response.responseMsg(UserCodeEnum.USER_ACCOUNT_FREEZE); - } - - if (user.getDeleteFlag() == CommonConstants.DELETED) { - return Response.responseMsg(UserCodeEnum.USER_ACCOUNT_INVALID); - } - - var token = ""; - if (redisUtil.hasKey(user.getUserName() + ":token")) { - token = String.valueOf(redisUtil.get(user.getUserName() + ":token")); - } else { - // 生成JWT的令牌 - token = jwtUtil.createToken(user.getUserName()); - redisUtil.set(user.getUserName() + ":token", token); - redisUtil.expire(user.getUserName() + ":token", 86400); - var userId = String.valueOf(user.getId()); - var tenantId = String.valueOf(user.getTenantId()); - redisUtil.set(token + ":userName", user.getUserName(), 86400); - redisUtil.set(token + ":userId", userId, 86400); - redisUtil.set(token + ":tenantId", tenantId, 86400); - } - - return Response.responseData(UserInfoVO.builder() - .id(user.getId()) - .token(token) - .expire(1694757956L) - .build()); - } - - @Override - public Response updatePassword(UpdatePasswordDto updatePasswordDto) { - if (updatePasswordDto == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - var verifyCode = redisUtil.getString(SecurityConstants.UPDATE_PASSWORD_VERIFY_CODE_CACHE_PREFIX + updatePasswordDto.getPhoneNumber()); - if (ObjectUtils.isEmpty(verifyCode)) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_EXPIRE); - } - - if (!verifyCode.equals(updatePasswordDto.getSms())) { - return Response.responseMsg(BaseCodeEnum.SMS_VERIFY_CODE_ERROR); - } - - var isExists = lambdaQuery() - .eq(SysUser::getUserName, updatePasswordDto.getUsername()) - .eq(SysUser::getPhoneNumber, updatePasswordDto.getPhoneNumber()) - .one(); - - if (isExists == null) { - return Response.responseMsg(UserCodeEnum.USER_NOT_EXISTS); - } - - var result = lambdaUpdate() - .eq(SysUser::getUserName, updatePasswordDto.getUsername()) - .eq(SysUser::getPhoneNumber, updatePasswordDto.getPhoneNumber()) - .set(SysUser::getPassword, CommonTools.md5Encryp(updatePasswordDto.getPassword())) - .update(); - - if (!result) { - return Response.responseMsg(UserCodeEnum.UPDATE_PASSWORD_ERROR); - } - - return Response.responseMsg(UserCodeEnum.UPDATE_PASSWORD_SUCCESS); - } - - @Override - public Response userInfo() { - var user = getCurrentUser(); - if (user == null) { - return Response.responseMsg(BaseCodeEnum.QUERY_DATA_EMPTY); - } - return Response.responseData(user); - } - - private String httpServletRequestContextToken() { - var sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - if (sra == null) { - log.error("[异常]获取HttpServletRequest为空"); - } - return Optional.ofNullable(sra.getRequest().getHeader("Authorization")).orElseThrow(null); - } - - /** - * 通过请求获取当前用户信息 - * - * @return UserInfoVo - */ - @Override - public UserInfoVO getCurrentUser() { - var token = httpServletRequestContextToken(); - if (StringUtils.hasText(token)) { - var userId = Long.parseLong(redisUtil.getString(token + ":userId")); - var user = userMapper.selectById(userId); - if (user != null) { - return UserInfoVO.builder() - .id(user.getId()) - .name(user.getName()) - .userName(user.getUserName()) - .avatar(user.getAvatar()) - .build(); - } - } - return null; - } - - @Override - public String getCurrentUserId() { - var token = httpServletRequestContextToken(); - return redisUtil.getString(token + ":userId"); - } - - @Override - public String getCurrentTenantId() { - var token = httpServletRequestContextToken(); - return redisUtil.getString(token + ":tenantId"); - } - - @Override - public String getCurrentUserName() { - var token = httpServletRequestContextToken(); - return redisUtil.getString(token + ":userName"); - } - - @Override - public Response> userRole() { - var userRoleVos = new ArrayList(); - - var userId = Long.parseLong(getCurrentUserId()); - var ids = userRoleRelService.queryByUserId(userId).stream() - .map(SysUserRoleRel::getRoleId).toList(); - if (ids.isEmpty()) { - return Response.responseMsg(BaseCodeEnum.QUERY_DATA_EMPTY); - } - - var roles = roleMapper.selectBatchIds(ids); - roles.forEach(item -> { - UserRoleVO userRoleVo = new UserRoleVO(); - userRoleVo.setRoleId(item.getId()); - userRoleVo.setRoleType(item.getType()); - userRoleVo.setRoleName(item.getRoleName()); - userRoleVos.add(userRoleVo); - }); - - return Response.responseData(userRoleVos); - } - - @Override - public Response userLogout() { - var token = httpServletRequestContextToken(); - redisUtil.del(token + ":userId", token + ":userName", getCurrentUserName() + ":token"); - return Response.responseMsg(UserCodeEnum.USER_LOGOUT); - } - - /** - * 这里要查询管理角色和部门表以获取 角色名称和 部门名称 主表user 关联表2张 部门和角色表各1张 - * 所以是5表联查,最好可以用mapper xml写,但我这里实现是通过关联数据集合筛选查询 - * 后续数据量大的情况下可以使用二分查询 - * - * @param userListDto 用户列表查询数据请求对象 - * @return 返回用户列表 - */ - @Override - public Response> userList(UserListDTO userListDto) { - var result = new Page(); - var userListVos = new ArrayList(); - - // Dept query - var userIds = new ArrayList(); - if (StringUtils.hasText(userListDto.getDeptId())) { - var userDeptRelList = userDeptRelService.lambdaQuery() - .eq(SysUserDeptRel::getDeptId, userListDto.getDeptId()) - .list(); - if (!userDeptRelList.isEmpty()) { - userIds.addAll(userDeptRelList.stream().map(SysUserDeptRel::getUserId).toList()); - userMapper.selectBatchIds(userIds); - } - } - - var user = userMapper.selectById(getCurrentUserId()); - var tenantId = user.getTenantId(); - - Page page = new Page<>(userListDto.getPage(), userListDto.getPageSize()); - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - if (!userIds.isEmpty()) { - query.in(SysUser::getId, userIds); - } - query.eq(SysUser::getTenantId, tenantId); - query.eq(StringUtils.hasText(userListDto.getEmail()), SysUser::getEmail, userListDto.getEmail()); - query.eq(StringUtils.hasText(userListDto.getUsername()), SysUser::getUserName, userListDto.getUsername()); - query.eq(StringUtils.hasText(userListDto.getName()), SysUser::getName, userListDto.getName()); - query.eq(StringUtils.hasText(userListDto.getPhoneNumber()), SysUser::getPhoneNumber, userListDto.getPhoneNumber()); - query.eq(SysUser::getDeleteFlag, CommonConstants.NOT_DELETED); - userMapper.selectPage(page, query); - - var resultIds = page.getRecords().stream().map(SysUser::getId).toList(); - - // query role info need roleName - var userRoles = userRoleRelService.queryBatchByUserIds(resultIds); - var roleIds = userRoles.stream().map(SysUserRoleRel::getRoleId).toList(); - var roles = roleMapper.selectBatchIds(roleIds); - // query department info, need deptName - var userDepartments = userDeptRelService.queryBatchByUserIds(resultIds); - var deptIds = userDepartments.stream().map(SysUserDeptRel::getDeptId).toList(); - var departments = departmentMapper.selectBatchIds(deptIds); - - page.getRecords().forEach(item -> { - UserListVO userVo = UserListVO.builder() - .id(item.getId()) - .username(item.getUserName()) - .name(item.getName()) - .phoneNumber(item.getPhoneNumber()) - .email(item.getEmail()) - .status(item.getStatus()) - .createTime(item.getCreateTime()) - .build(); - // bind roleName - var userRoleIds = new ArrayList(); - var roleName = new StringBuilder(); - userRoles.forEach(userRole -> { - roles.forEach(role -> { - if (Objects.equals(item.getId(), userRole.getUserId()) && - Objects.equals(userRole.getRoleId(), role.getId())) { - userRoleIds.add(role.getId()); - roleName.append(role.getRoleName()).append(" "); - } - }); - }); - userVo.setRoleName(String.valueOf(roleName)); - userVo.setRoleId(userRoleIds); - // bind deptName - var userDepartmentIds = new ArrayList(); - userDepartments.forEach(userDept -> { - departments.forEach(dept -> { - if (Objects.equals(item.getId(), userDept.getUserId()) && - Objects.equals(userDept.getDeptId(), dept.getId())) { - userDepartmentIds.add(dept.getId()); - } - }); - }); - userVo.setDeptId(userDepartmentIds); - userListVos.add(userVo); - }); - result.setRecords(userListVos); - result.setTotal(page.getTotal()); - result.setSize(page.getSize()); - result.setPages(page.getPages()); - - return Response.responseData(result); - } - - @Override - public Response updateUser(UpdateUserDTO updateUserDTO) { - if (updateUserDTO == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - var updateResult = lambdaUpdate() - .eq(SysUser::getId, updateUserDTO.getId()) - .set(StringUtils.hasText(updateUserDTO.getName()), SysUser::getName, updateUserDTO.getName()) - .set(StringUtils.hasText(updateUserDTO.getEmail()), SysUser::getEmail, updateUserDTO.getEmail()) - .set(StringUtils.hasText(updateUserDTO.getPhoneNumber()), SysUser::getPhoneNumber, updateUserDTO.getPhoneNumber()) - .set(StringUtils.hasText(updateUserDTO.getPosition()), SysUser::getPosition, updateUserDTO.getPosition()) - .set(null != updateUserDTO.getStatus(), SysUser::getStatus, updateUserDTO.getStatus()) - .update(); - - if (!updateResult) { - return Response.responseMsg(UserCodeEnum.USER_INFO_UPDATE_ERROR); - } - - return Response.responseMsg(UserCodeEnum.USER_INFO_UPDATE_SUCCESS); - } - - private Boolean checkUserNameExist(String userName) { - return lambdaQuery() - .eq(SysUser::getUserName, userName) - .exists(); - } - - private Boolean checkPhoneNumberExist(String phoneNumber) { - return lambdaQuery() - .eq(SysUser::getPhoneNumber, phoneNumber) - .exists(); - } - - private boolean addUserRoleRelations(Long userId, List roleIds) { - List userRoleReals = new ArrayList<>(roleIds.size()); - roleIds.forEach(roleId -> { - var userRoleRel = SysUserRoleRel.builder() - .id(SnowflakeIdUtil.nextId()) - .roleId(roleId) - .userId(userId) - .tenantId(Long.parseLong(getCurrentTenantId())) - .createBy(Long.parseLong(getCurrentUserId())) - .createTime(LocalDateTime.now()) - .build(); - userRoleReals.add(userRoleRel); - }); - return userRoleRelService.saveBatch(userRoleReals); - } - - private boolean addUserDeptRelations(Long userId, List deptIds) { - List userDeptReals = new ArrayList<>(deptIds.size()); - deptIds.forEach(deptId -> { - var userDeptRel = SysUserDeptRel.builder() - .id(SnowflakeIdUtil.nextId()) - .deptId(deptId) - .userId(userId) - .tenantId(Long.parseLong(getCurrentTenantId())) - .createBy(Long.parseLong(getCurrentUserId())) - .createTime(LocalDateTime.now()) - .build(); - userDeptReals.add(userDeptRel); - }); - return userDeptRelService.saveBatch(userDeptReals); - } - - - @Override - @Transactional - public Response addOrUpdate(AddOrUpdateUserDTO addOrUpdateUserDTO) { - if (addOrUpdateUserDTO.getId() != null) { - var userExist = lambdaQuery() - .eq(SysUser::getId, addOrUpdateUserDTO.getId()) - .eq(SysUser::getPhoneNumber, addOrUpdateUserDTO.getPhoneNumber()) - .one(); - if (userExist == null) { - if(checkPhoneNumberExist(addOrUpdateUserDTO.getPhoneNumber())) { - return Response.responseMsg(UserCodeEnum.PHONE_EXISTS); - } - } - // update user info, Delete the original role and department association information - var userRoles = userRoleRelService.queryByUserId(addOrUpdateUserDTO.getId()); - var userDepartments = userDeptRelService.queryByUserId(addOrUpdateUserDTO.getId()); - if(!userRoles.isEmpty()) { - userRoleRelService.removeBatchByIds(userRoles.stream() - .map(SysUserRoleRel::getId) - .toList() - ); - } - if(!userDepartments.isEmpty()) { - userDeptRelService.removeBatchByIds(userDepartments.stream() - .map(SysUserDeptRel::getId) - .toList() - ); - } - // Reassign roles and departments - var saveUserRoleRealResult = addUserRoleRelations(addOrUpdateUserDTO.getId(), addOrUpdateUserDTO.getRoleId()); - var saveUserDeptRealResult = addUserDeptRelations(addOrUpdateUserDTO.getId(), addOrUpdateUserDTO.getDeptId()); - var updateUserResult = lambdaUpdate() - .eq(SysUser::getId, addOrUpdateUserDTO.getId()) - .set(StringUtils.hasText(addOrUpdateUserDTO.getName()), SysUser::getName, addOrUpdateUserDTO.getName()) - .set(StringUtils.hasText(addOrUpdateUserDTO.getPhoneNumber()), SysUser::getPhoneNumber, addOrUpdateUserDTO.getPhoneNumber()) - .set(StringUtils.hasText(addOrUpdateUserDTO.getEmail()), SysUser::getEmail, addOrUpdateUserDTO.getEmail()) - .set(StringUtils.hasText(addOrUpdateUserDTO.getRemake()), SysUser::getRemark, addOrUpdateUserDTO.getRemake()) - .update(); - - if(updateUserResult && saveUserRoleRealResult && saveUserDeptRealResult) { - return Response.responseMsg(UserCodeEnum.USER_INFO_UPDATE_SUCCESS); - } - return Response.responseMsg(UserCodeEnum.USER_INFO_UPDATE_ERROR); - } else { - // Add user info - if (checkUserNameExist(addOrUpdateUserDTO.getUsername())) { - return Response.responseMsg(UserCodeEnum.USER_NAME_EXISTS); - } - - if (checkPhoneNumberExist(addOrUpdateUserDTO.getPhoneNumber())) { - return Response.responseMsg(UserCodeEnum.PHONE_EXISTS); - } - - var userId = SnowflakeIdUtil.nextId(); - var user = SysUser.builder() - .id(userId) - .userName(addOrUpdateUserDTO.getUsername()) - .password(Optional.ofNullable(CommonTools.md5Encryp(addOrUpdateUserDTO.getPassword())) - .orElse(CommonTools.md5Encryp(UserConstants.DEFAULT_PASSWORD))) - .name(addOrUpdateUserDTO.getName()) - .phoneNumber(addOrUpdateUserDTO.getPhoneNumber()) - .email(addOrUpdateUserDTO.getEmail()) - .createBy(Long.parseLong(getCurrentUserId())) - .createTime(LocalDateTime.now()) - .description(addOrUpdateUserDTO.getRemake()) - .tenantId(Long.parseLong(getCurrentTenantId())) - .build(); - - var saveUserResult = save(user); - - // add dept relation and role relation - var saveUserRoleRealResult = addUserRoleRelations(userId, addOrUpdateUserDTO.getRoleId()); - var saveUserDeptRealResult = addUserDeptRelations(userId, addOrUpdateUserDTO.getDeptId()); - - if(saveUserResult && saveUserRoleRealResult && saveUserDeptRealResult) { - return Response.responseMsg(UserCodeEnum.USER_ADD_SUCCESS); - } - return Response.responseMsg(UserCodeEnum.USER_ADD_ERROR); - } - } - - @Override - public Response deleteUser(List ids) { - if(ids.isEmpty()) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - boolean deleteResult = lambdaUpdate() - .in(SysUser::getId, ids) - .set(SysUser::getDeleteFlag, CommonConstants.DELETED) - .update(); - if(!deleteResult) { - return Response.responseMsg(UserCodeEnum.USER_DELETE_ERROR); - } - - return Response.responseMsg(UserCodeEnum.USER_DELETE_SUCCESS); - } - - @Override - public Response resetPassword(Long id) { - if(id == null) { - return Response.responseMsg(BaseCodeEnum.PARAMETER_NULL); - } - - boolean resetResult = lambdaUpdate() - .eq(SysUser::getId, id) - .set(SysUser::getPassword, CommonTools.md5Encryp(UserConstants.DEFAULT_PASSWORD)) - .update(); - - if(!resetResult) { - return Response.responseMsg(UserCodeEnum.USER_RESET_PASSWORD_ERROR); - } - - return Response.responseMsg(UserCodeEnum.USER_RESET_PASSWORD_SUCCESS); - } } diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java index 2a7baec4..99bd1687 100644 --- a/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java @@ -1,6 +1,6 @@ package com.wansensoft.service.user.impl; -import com.wansensoft.entities.user.SysUserWarehouseRel; +import com.wansensoft.entities.SysUserWarehouseRel; import com.wansensoft.mappers.user.SysUserWarehouseRelMapper; import com.wansensoft.service.user.ISysUserWarehouseRelService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessComponent.java b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessComponent.java new file mode 100644 index 00000000..9efd4b69 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessComponent.java @@ -0,0 +1,66 @@ +package com.wansensoft.service.userBusiness; + +import com.alibaba.fastjson.JSONObject; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.service.ICommonQuery; +import org.springframework.stereotype.Service; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +@Service +@UserBusinessResource +public class UserBusinessComponent implements ICommonQuery { + + private final UserBusinessService userBusinessService; + + public UserBusinessComponent(UserBusinessService userBusinessService) { + this.userBusinessService = userBusinessService; + } + + @Override + public Object selectOne(Long id) throws Exception { + return userBusinessService.getUserBusiness(id); + } + + @Override + public List select(Map map)throws Exception { + return getUserBusinessList(map); + } + + private List getUserBusinessList(Map map)throws Exception { + return null; + } + + @Override + public Long counts(Map map)throws Exception { + return BusinessConstants.DEFAULT_LIST_NULL_NUMBER; + } + + @Override + public int insert(JSONObject obj, HttpServletRequest request) throws Exception { + return userBusinessService.insertUserBusiness(obj, request); + } + + @Override + public int update(JSONObject obj, HttpServletRequest request)throws Exception { + return userBusinessService.updateUserBusiness(obj, request); + } + + @Override + public int delete(Long id, HttpServletRequest request)throws Exception { + return userBusinessService.deleteUserBusiness(id, request); + } + + @Override + public int deleteBatch(String ids, HttpServletRequest request)throws Exception { + return userBusinessService.batchDeleteUserBusiness(ids, request); + } + + @Override + public int checkIsNameExist(Long id, String name)throws Exception { + return userBusinessService.checkIsNameExist(id, name); + } + +} diff --git a/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessResource.java b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessResource.java new file mode 100644 index 00000000..259a7598 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessResource.java @@ -0,0 +1,12 @@ +package com.wansensoft.service.userBusiness; + +import com.wansensoft.service.ResourceInfo; + +import java.lang.annotation.*; + +@ResourceInfo(value = "userBusiness") +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface UserBusinessResource { +} diff --git a/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessService.java b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessService.java new file mode 100644 index 00000000..c8330dd9 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessService.java @@ -0,0 +1,37 @@ +package com.wansensoft.service.userBusiness; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.entities.user.UserBusiness; +import jakarta.servlet.http.HttpServletRequest; + +import java.util.List; + +public interface UserBusinessService extends IService { + + UserBusiness getUserBusiness(long id); + + List getUserBusiness(); + + int insertUserBusiness(JSONObject obj, HttpServletRequest request); + + int updateUserBusiness(JSONObject obj, HttpServletRequest request); + + int deleteUserBusiness(Long id, HttpServletRequest request); + + int batchDeleteUserBusiness(String ids, HttpServletRequest request); + + int batchDeleteUserBusinessByIds(String ids); + + List getBasicData(String keyId, String type); + + List getListBy(String keyId, String type); + + String getUBValueByTypeAndKeyId(String type, String keyId); + + Long checkIsValueExist(String type, String keyId); + + int updateBtnStr(String keyId, String type, String btnStr); + + int checkIsNameExist(Long id, String name); +} diff --git a/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessServiceImpl.java b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessServiceImpl.java new file mode 100644 index 00000000..428d54e2 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/userBusiness/UserBusinessServiceImpl.java @@ -0,0 +1,204 @@ +package com.wansensoft.service.userBusiness; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.entities.user.User; +import com.wansensoft.entities.user.UserBusiness; +import com.wansensoft.entities.user.UserBusinessExample; +import com.wansensoft.mappers.user.UserBusinessMapper; +import com.wansensoft.mappers.user.UserBusinessMapperEx; +import com.wansensoft.service.CommonService; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.constants.BusinessConstants; +import com.wansensoft.plugins.exception.JshException; +import com.wansensoft.utils.Tools; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.*; + +@Service +public class UserBusinessServiceImpl extends ServiceImpl implements UserBusinessService{ + private Logger logger = LoggerFactory.getLogger(UserBusinessServiceImpl.class); + + private final UserBusinessMapper userBusinessMapper; + private final UserBusinessMapperEx userBusinessMapperEx; + private final LogService logService; + private final CommonService commonService; + + public UserBusinessServiceImpl(UserBusinessMapper userBusinessMapper, UserBusinessMapperEx userBusinessMapperEx, LogService logService, CommonService commonService) { + this.userBusinessMapper = userBusinessMapper; + this.userBusinessMapperEx = userBusinessMapperEx; + this.logService = logService; + this.commonService = commonService; + } + + public UserBusiness getUserBusiness(long id) { + UserBusiness result=null; + try{ + result=userBusinessMapper.selectByPrimaryKey(id); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return result; + } + + public List getUserBusiness() { + UserBusinessExample example = new UserBusinessExample(); + example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list=userBusinessMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int insertUserBusiness(JSONObject obj, HttpServletRequest request) { + UserBusiness userBusiness = JSONObject.parseObject(obj.toJSONString(), UserBusiness.class); + int result=0; + try{ + String token = ""; + if(request!=null) { + token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if(tenantId!=0L) { + userBusiness.setTenantId(tenantId); + } + } + String value = userBusiness.getValue(); + String newValue = value.replaceAll(",","\\]\\["); + newValue = newValue.replaceAll("\\[0\\]","").replaceAll("\\[\\]",""); + userBusiness.setValue(newValue); + result=userBusinessMapper.insertSelective(userBusiness); + logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_ADD, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateUserBusiness(JSONObject obj, HttpServletRequest request) { + UserBusiness userBusiness = JSONObject.parseObject(obj.toJSONString(), UserBusiness.class); + int result=0; + try{ + String value = userBusiness.getValue(); + String newValue = value.replaceAll(",","\\]\\["); + newValue = newValue.replaceAll("\\[0\\]","").replaceAll("\\[\\]",""); + userBusiness.setValue(newValue); + result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness); + logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_EDIT, request); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int deleteUserBusiness(Long id, HttpServletRequest request) { + return batchDeleteUserBusinessByIds(id.toString()); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusiness(String ids, HttpServletRequest request) { + return batchDeleteUserBusinessByIds(ids); + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int batchDeleteUserBusinessByIds(String ids) { + logService.insertLog("关联关系", + BusinessConstants.LOG_OPERATION_TYPE_DELETE + ids, + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + User userInfo = commonService.getCurrentUser(); + String [] idArray=ids.split(","); + int result=0; + try{ + result= userBusinessMapperEx.batchDeleteUserBusinessByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } + + public int checkIsNameExist(Long id, String name) { + return 1; + } + + public List getBasicData(String keyId, String type) { + List list=null; + try{ + UserBusinessExample example = new UserBusinessExample(); + example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list= userBusinessMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public List getListBy(String keyId, String type) { + List list=null; + try{ + UserBusinessExample example = new UserBusinessExample(); + example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + list= userBusinessMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + return list; + } + + public String getUBValueByTypeAndKeyId(String type, String keyId) { + String ubValue = ""; + List ubList = getBasicData(keyId, type); + if(ubList!=null && !ubList.isEmpty()) { + ubValue = ubList.get(0).getValue(); + } + return ubValue; + } + + public Long checkIsValueExist(String type, String keyId) { + UserBusinessExample example = new UserBusinessExample(); + example.createCriteria().andTypeEqualTo(type).andKeyIdEqualTo(keyId) + .andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + List list=null; + try{ + list= userBusinessMapper.selectByExample(example); + }catch(Exception e){ + JshException.readFail(logger, e); + } + Long id = null; + if(list!=null&& !list.isEmpty()) { + id = list.get(0).getId(); + } + return id; + } + + @Transactional(value = "transactionManager", rollbackFor = Exception.class) + public int updateBtnStr(String keyId, String type, String btnStr) { + logService.insertLog("关联关系", + BusinessConstants.LOG_OPERATION_TYPE_EDIT + "角色的按钮权限", + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); + UserBusiness userBusiness = new UserBusiness(); + userBusiness.setBtnStr(btnStr); + UserBusinessExample example = new UserBusinessExample(); + example.createCriteria().andKeyIdEqualTo(keyId).andTypeEqualTo(type); + int result=0; + try{ + result= userBusinessMapper.updateByExampleSelective(userBusiness, example); + }catch(Exception e){ + JshException.writeFail(logger, e); + } + return result; + } +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java index 81b6ea9a..71735ce5 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse; -import com.wansensoft.entities.warehouse.WarehouseHead; +import com.wansensoft.entities.WarehouseHead; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 单据主表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IWarehouseHeadService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java index 2db47c6f..f2cef037 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse; -import com.wansensoft.entities.warehouse.WarehouseItem; +import com.wansensoft.entities.WarehouseItem; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 单据子表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IWarehouseItemService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java index cd47d617..23be2a9a 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java @@ -1,24 +1,15 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse; -import com.wansensoft.entities.warehouse.Warehouse; +import com.wansensoft.entities.Warehouse; import com.baomidou.mybatisplus.extension.service.IService; /** *

* 仓库表 服务类 *

+ * + * @author James Zow + * @since 2023-09-05 */ public interface IWarehouseService extends IService { diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java index 82b7aa1e..fc3b0e16 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse.impl; import com.wansensoft.service.warehouse.IWarehouseHeadService; -import com.wansensoft.entities.warehouse.WarehouseHead; +import com.wansensoft.entities.WarehouseHead; import com.wansensoft.mappers.warehouse.WarehouseHeadMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 单据主表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class WarehouseHeadServiceImpl extends ServiceImpl implements IWarehouseHeadService { diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java index 0729ac7a..155cf634 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse.impl; import com.wansensoft.service.warehouse.IWarehouseItemService; -import com.wansensoft.entities.warehouse.WarehouseItem; +import com.wansensoft.entities.WarehouseItem; import com.wansensoft.mappers.warehouse.WarehouseItemMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 单据子表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class WarehouseItemServiceImpl extends ServiceImpl implements IWarehouseItemService { diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java index b49f2075..03110eb1 100644 --- a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java @@ -1,19 +1,7 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.service.warehouse.impl; import com.wansensoft.service.warehouse.IWarehouseService; -import com.wansensoft.entities.warehouse.Warehouse; +import com.wansensoft.entities.Warehouse; import com.wansensoft.mappers.warehouse.WarehouseMapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -22,6 +10,9 @@ *

* 仓库表 服务实现类 *

+ * + * @author James Zow + * @since 2023-09-05 */ @Service public class WarehouseServiceImpl extends ServiceImpl implements IWarehouseService { diff --git a/utils/pom.xml b/utils/pom.xml index a5f24a50..53b704ea 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -5,15 +5,15 @@ 4.0.0 com.wansensoft - wansen-erp-core + wansen-erp-parent 1.0-SNAPSHOT utils - 21 - 21 + 17 + 17 UTF-8 @@ -49,6 +49,11 @@ javax.mail 1.5.3 + + io.springfox + springfox-boot-starter + 3.0.0 + org.apache.httpcomponents @@ -67,12 +72,6 @@ fastjson 1.2.83 - - - com.github.penggle - kaptcha - 2.3.2 - diff --git a/utils/src/main/java/com/wansensoft/utils/AnnotationUtil.java b/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java similarity index 96% rename from utils/src/main/java/com/wansensoft/utils/AnnotationUtil.java rename to utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java index 7f4b8eef..5be90600 100644 --- a/utils/src/main/java/com/wansensoft/utils/AnnotationUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java @@ -6,7 +6,7 @@ /** * */ -public class AnnotationUtil { +public class AnnotationUtils { public static A getAnnotation(Class cls, Class annotationClass) { A res = cls.getAnnotation(annotationClass); if (res == null) { diff --git a/utils/src/main/java/com/wansensoft/utils/BaseResponseInfo.java b/utils/src/main/java/com/wansensoft/utils/BaseResponseInfo.java new file mode 100644 index 00000000..d3032866 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/BaseResponseInfo.java @@ -0,0 +1,11 @@ +package com.wansensoft.utils; + +public class BaseResponseInfo { + public int code; + public Object data; + + public BaseResponseInfo() { + code = 400; + data = null; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ColumnPropertyUtil.java b/utils/src/main/java/com/wansensoft/utils/ColumnPropertyUtil.java new file mode 100644 index 00000000..968b8d67 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ColumnPropertyUtil.java @@ -0,0 +1,65 @@ +package com.wansensoft.utils; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class ColumnPropertyUtil { + + /** + * 将数据库字段转换成属性 + */ + public static String columnToProperty(String column) { + StringBuilder result = new StringBuilder(); + // 快速检查 + if (StringUtil.isEmpty(column)) { + // 没必要转换 + return ""; + } else if (!column.contains("_")) { + // 不做转换 + return column; + } else { + // 用下划线将原始字符串分割 + String[] columns = column.split("_"); + for (String columnSplit : columns) { + // 跳过原始字符串中开头、结尾的下换线或双重下划线 + if (StringUtil.isEmpty(columnSplit)) { + continue; + } + // 处理真正的驼峰片段 + if (result.length() == 0) { + // 第一个驼峰片段,全部字母都小写 + result.append(columnSplit.toLowerCase()); + } else { + // 其他的驼峰片段,首字母大写 + result.append(columnSplit.substring(0, 1).toUpperCase()).append(columnSplit.substring(1).toLowerCase()); + } + } + return result.toString(); + } + + } + + + /** + * 驼峰转换下划线 + */ + public static String propertyToColumn(String property) { + if (StringUtil.isEmpty(property)) { + return ""; + } + StringBuilder column = new StringBuilder(); + column.append(property.substring(0, 1).toLowerCase()); + for (int i = 1; i < property.length(); i++) { + String s = property.substring(i, i + 1); + // 在小写字母前添加下划线 + if (!Character.isDigit(s.charAt(0)) && s.equals(s.toUpperCase())) { + column.append("_"); + } + // 其他字符直接转成小写 + column.append(s.toLowerCase()); + } + + return column.toString(); + } + +} diff --git a/utils/src/main/java/com/wansensoft/utils/ComputerInfo.java b/utils/src/main/java/com/wansensoft/utils/ComputerInfo.java index e4203e3a..7f64b6a7 100644 --- a/utils/src/main/java/com/wansensoft/utils/ComputerInfo.java +++ b/utils/src/main/java/com/wansensoft/utils/ComputerInfo.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils; import java.io.BufferedReader; @@ -22,16 +10,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -/** - * 取网卡物理地址- - * 1.在Windows,Linux系统下均可用; - * 2.通过ipconifg,ifconfig获得计算机信息; - * 3.再用模式匹配方式查找MAC地址,与操作系统的语言无关> - *

- * Description: <取计算机名--从环境变量中取> - * abstract 限制继承/创建实例 - *

- **/ +/* + * <取网卡物理地址-- + * 1.在Windows,Linux系统下均可用; + * 2.通过ipconifg,ifconfig获得计算机信息; + * 3.再用模式匹配方式查找MAC地址,与操作系统的语言无关> + * + * //* Description: <取计算机名--从环境变量中取> + * abstract 限制继承/创建实例 + */ public abstract class ComputerInfo { private static String macAddressStr = null; private static String computerName = System.getenv().get("COMPUTERNAME"); diff --git a/utils/src/main/java/com/wansensoft/utils/Constants.java b/utils/src/main/java/com/wansensoft/utils/Constants.java new file mode 100644 index 00000000..92382fc6 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/Constants.java @@ -0,0 +1,34 @@ +package com.wansensoft.utils; + +import java.util.UUID; + +/** + * by jishenghua qq-752718920 2018-10-7 12:01:36 + */ +public class Constants { + + //查询参数 + public final static String PAGE_SIZE = "pageSize"; + public final static String CURRENT_PAGE = "currentPage"; + public final static String ORDER = "order"; + public final static String FILTER = "filter"; + public final static String SPLIT = ","; + public final static String SEARCH = "search"; + public final static String DEVICE_ID = "deviceId"; + public final static String OFFSET = "offset"; + public final static String ROWS = "rows"; + public final static String IS_RECURSION = "isRecursion"; + public final static String IS_RECURSION_VALUE = "1"; + public final static String IS_QUERYBYNODEID = "isquerybyid"; + public final static String IS_QUERYBYNODEID_VALUE = "1"; + + //级联类别 + public final static String TYPE = "type"; + + //转发 + public final static String TEAM = "team"; + + //增加了角色等级常量 + public final static String LEVEL="level"; + +} \ No newline at end of file diff --git a/utils/src/main/java/com/wansensoft/utils/ErpInfo.java b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java new file mode 100644 index 00000000..0785c539 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java @@ -0,0 +1,37 @@ +package com.wansensoft.utils; + +/** + * + */ +public enum ErpInfo { + //通过构造传递参数 + OK(200, "成功"), + BAD_REQUEST(400, "请求错误或参数错误"), + UNAUTHORIZED(401, "未认证用户"), + INVALID_VERIFY_CODE(461, "错误的验证码"), + ERROR(500, "服务内部错误"), + WARING_MSG(201, "提醒信息"), + REDIRECT(301, "session失效,重定向"), + FORWARD_REDIRECT(302, "转发请求session失效"), + FORWARD_FAILED(303, "转发请求失败!"), + TEST_USER(-1, "演示用户禁止操作"); + + public final int code; + public final String name; + + public int getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 定义枚举构造函数 + */ + ErpInfo(int code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ExcelUtil.java b/utils/src/main/java/com/wansensoft/utils/ExcelUtils.java similarity index 86% rename from utils/src/main/java/com/wansensoft/utils/ExcelUtil.java rename to utils/src/main/java/com/wansensoft/utils/ExcelUtils.java index 8cbb27de..16dd0f07 100644 --- a/utils/src/main/java/com/wansensoft/utils/ExcelUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/ExcelUtils.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils; import java.io.*; @@ -17,6 +5,8 @@ import jxl.*; import jxl.format.Alignment; +import jxl.format.Border; +import jxl.format.BorderLineStyle; import jxl.format.Colour; import jxl.format.VerticalAlignment; import jxl.write.*; @@ -27,7 +17,7 @@ import jakarta.servlet.http.HttpServletResponse; @Slf4j -public class ExcelUtil { +public class ExcelUtils { public static InputStream getPathByFileName(String template, String tmpFileName) { File tmpFile = new File(template, tmpFileName); @@ -80,7 +70,7 @@ public static File exportObjectsWithoutTitle(String fileName, String tip, String format.setVerticalAlignment(VerticalAlignment.TOP); // 第一行写入提示 - if (StringUtils.hasText(tip) && tip.contains("*")) { + if (StringUtil.isNotEmpty(tip) && tip.contains("*")) { sheet.addCell(new Label(0, 0, tip, redWFFC)); } else { sheet.addCell(new Label(0, 0, tip, blackWFFC)); @@ -88,7 +78,7 @@ public static File exportObjectsWithoutTitle(String fileName, String tip, String // 第二行写入标题 for (int i = 0; i < names.length; i++) { - if (StringUtils.hasText(names[i]) && names[i].contains("*")) { + if (StringUtil.isNotEmpty(names[i]) && names[i].contains("*")) { sheet.addCell(new Label(i, 1, names[i], redWFFC)); } else { sheet.addCell(new Label(i, 1, names[i], blackWFFC)); diff --git a/utils/src/main/java/com/wansensoft/utils/ExceptionCodeConstants.java b/utils/src/main/java/com/wansensoft/utils/ExceptionCodeConstants.java new file mode 100644 index 00000000..6fdfdc73 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ExceptionCodeConstants.java @@ -0,0 +1,43 @@ +package com.wansensoft.utils; + +public interface ExceptionCodeConstants { + /** + * 用户错误码定义 + */ + public class UserExceptionCode { + /** + * 用户不存在 + */ + public static final int USER_NOT_EXIST = 1; + + /** + * 用户密码错误 + */ + public static final int USER_PASSWORD_ERROR = 2; + + /** + * 用户被加入黑名单 + */ + public static final int BLACK_USER = 3; + + /** + * 可以登录 + */ + public static final int USER_CONDITION_FIT = 4; + + /** + * 访问数据库异常 + */ + public static final int USER_ACCESS_EXCEPTION = 5; + + /** + * 租户被加入黑名单 + */ + public static final int BLACK_TENANT = 6; + + /** + * 租户已经过期 + */ + public static final int EXPIRE_TENANT = 7; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ExtJsonUtils.java b/utils/src/main/java/com/wansensoft/utils/ExtJsonUtils.java new file mode 100644 index 00000000..774d912a --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ExtJsonUtils.java @@ -0,0 +1,141 @@ +package com.wansensoft.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.parser.deserializer.ExtraProcessor; +import com.alibaba.fastjson.parser.deserializer.FieldDeserializer; +import com.alibaba.fastjson.serializer.*; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class ExtJsonUtils { + private static class NPFloatCodec extends FloatCodec { + public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { + SerializeWriter out = serializer.getWriter(); + + if (object == null) { + if (serializer.isEnabled(SerializerFeature.WriteNullNumberAsZero)) { + out.write('0'); + } else { + out.writeNull(); + } + return; + } + + float floatValue = (Float) object; + + if (Float.isNaN(floatValue)) { + out.writeNull(); + } else if (Float.isInfinite(floatValue)) { + out.writeNull(); + } else { + String floatText = Float.toString(floatValue); + out.write(floatText); + + if (serializer.isEnabled(SerializerFeature.WriteClassName)) { + out.write('F'); + } + } + } + } + + private static class NPDoubleSerializer extends DoubleSerializer { + public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException { + SerializeWriter out = serializer.getWriter(); + + if (object == null) { + if (!serializer.isEnabled(SerializerFeature.WriteNullNumberAsZero)) { + out.writeNull(); + } else { + out.write('0'); + } + return; + } + + double doubleValue = (Double) object; + + if (Double.isNaN(doubleValue)) { + out.writeNull(); + } else if (Double.isInfinite(doubleValue)) { + out.writeNull(); + } else { + String doubleText; + doubleText = Double.toString(doubleValue); + out.append(doubleText); + + if (serializer.isEnabled(SerializerFeature.WriteClassName)) { + out.write('D'); + } + } + } + } + + private static final String EXT_NAME = "ext"; + + static class ExtFilter extends AfterFilter implements PropertyFilter { + static { + SerializeConfig.getGlobalInstance().put(Float.class, new NPFloatCodec()); + SerializeConfig.getGlobalInstance().put(float.class, new NPFloatCodec()); + SerializeConfig.getGlobalInstance().put(Double.class, new NPDoubleSerializer()); + SerializeConfig.getGlobalInstance().put(double.class, new NPDoubleSerializer()); + } + + private Map map = new HashMap<>(); + + private Map> ignoredKey = new HashMap<>(); + + @Override + public boolean apply(Object object, String name, Object value) { + if (name.equals(EXT_NAME) && value instanceof String) { + map.put(object, JSON.parseObject((String) value)); + return false; + } + if (!map.containsKey(object)) { + ignoredKey.put(object, new HashSet()); + } + ignoredKey.get(object).add(name); +// if (value instanceof Float || value instanceof Double) { +// if (!floatMap.containsKey(object)) { +// floatMap.put(object, new HashMap()); +// } +// floatMap.get(object).put(name, value); +// return false; +// } + return true; + } + + @Override + public void writeAfter(Object object) { + if (map.containsKey(object)) { + Set ignoredKeys; + if (ignoredKey.containsKey(object)) { + ignoredKeys = ignoredKey.get(object); + } else { + ignoredKeys = new HashSet<>(); + } + for (Map.Entry entry : map.get(object).entrySet()) { + if (!ignoredKeys.contains(entry.getKey())) { + writeKeyValue(entry.getKey(), entry.getValue()); + } + } + } + } + } + + public static String toJSONString(Object object) { + return JSON.toJSONString(object, new ExtFilter()); + } + + public interface ExtExtractor { + String getExt(Object bean); + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/FileUtil.java b/utils/src/main/java/com/wansensoft/utils/FileUtils.java similarity index 91% rename from utils/src/main/java/com/wansensoft/utils/FileUtil.java rename to utils/src/main/java/com/wansensoft/utils/FileUtils.java index b1149b06..beccfdbd 100644 --- a/utils/src/main/java/com/wansensoft/utils/FileUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/FileUtils.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils; import java.io.*; @@ -20,7 +8,7 @@ * 文件处理工具类 * */ -public class FileUtil { +public class FileUtils { /** * 功 能: 创建文件夹 @@ -125,7 +113,8 @@ public static String getFileExtendName(String fileName) { if (fileName == null) { return ""; } else { - return fileName.substring(fileName.lastIndexOf(".") + 1); + return fileName.substring(fileName.lastIndexOf(".") + 1, fileName + .length()); } } @@ -254,7 +243,7 @@ public static HashMap readPropertyFile(String file, String charsetName) throws I if(file.startsWith("file:")) is=new FileInputStream(new File(file.substring(5))); else - is= FileUtil.class.getClassLoader().getResourceAsStream(file); + is=FileUtils.class.getClassLoader().getResourceAsStream(file); Properties properties = new Properties(); properties.load(is); Enumeration en = properties.propertyNames(); @@ -279,7 +268,7 @@ public static HashMap readPropertyFile(String file, String charsetName) throws I @SuppressWarnings("unchecked") public static List getListFiles(String path, String suffix, boolean isdepth) { File file = new File(path); - return FileUtil.listFile(file, suffix, isdepth); + return FileUtils.listFile(file, suffix, isdepth); } /** diff --git a/utils/src/main/java/com/wansensoft/utils/HttpClient.java b/utils/src/main/java/com/wansensoft/utils/HttpClient.java new file mode 100644 index 00000000..06ebd598 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/HttpClient.java @@ -0,0 +1,88 @@ +package com.wansensoft.utils; + +import com.alibaba.fastjson.JSONObject; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.EntityBuilder; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.apache.http.HttpStatus.SC_OK; + +public final class HttpClient { + private static Logger logger = LoggerFactory.getLogger(HttpClient.class); + + private static final RequestConfig REQUEST_CONFIG = RequestConfig.custom().setSocketTimeout(15000).setConnectTimeout(10000).build(); + + /** + * 采用Get方式发送请求,获取响应数据 + * @param url + * @return + */ + public static JSONObject httpGet(String url){ + CloseableHttpClient client = HttpClientBuilder.create().build(); + HttpGet httpGet = new HttpGet(url); + httpGet.setConfig(REQUEST_CONFIG); + try { + CloseableHttpResponse chr = client.execute(httpGet); + int statusCode = chr.getStatusLine().getStatusCode(); + if (SC_OK != statusCode) { + throw new RuntimeException(String.format("%s查询出现异常", url)); + } + String entity = EntityUtils.toString(chr.getEntity(), StandardCharsets.UTF_8); + JSONObject object = JSONObject.parseObject(entity); + return object; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException(String.format("%s", url) + "查询出现异常"); + } finally { + try { + client.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + /** + * 采用Post方式发送请求,获取响应数据 + * + * @param url url地址 + * @param param 参数值键值对的字符串 + * @return + */ + public static String httpPost(String url, String param) { + CloseableHttpClient client = HttpClientBuilder.create().build(); + try { + HttpPost post = new HttpPost(url); + EntityBuilder builder = EntityBuilder.create(); + builder.setContentType(ContentType.APPLICATION_JSON); + builder.setText(param); + post.setEntity(builder.build()); + + CloseableHttpResponse response = client.execute(post); + int statusCode = response.getStatusLine().getStatusCode(); + + HttpEntity entity = response.getEntity(); + String data = EntityUtils.toString(entity, StandardCharsets.UTF_8); + logger.info("状态:"+statusCode+"数据:"+data); + return data; + } catch(Exception e){ + throw new RuntimeException(e.getMessage()); + } finally { + try{ + client.close(); + }catch(Exception ex){ } + } + } +} \ No newline at end of file diff --git a/utils/src/main/java/com/wansensoft/utils/OrderUtils.java b/utils/src/main/java/com/wansensoft/utils/OrderUtils.java new file mode 100644 index 00000000..7f3a7f25 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/OrderUtils.java @@ -0,0 +1,69 @@ +package com.wansensoft.utils; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class OrderUtils { + + /** + * 将指定字段排序 + * + * @param orders 格式 属性名,排序方式 例如( name,asc或ip,desc) + * @return 排序字符串 例如:(name asc 或 ip desc) + */ + public static String getOrderString(String orders) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + String column = ColumnPropertyUtil.propertyToColumn(splits[0]); + if (column.equals("audit_status")) { + // TODO: 2015/12/24 这么处理不好,得相伴办法调整 + return "IF(`audit_status`=3,-1,`audit_status`) " + splits[1]; + } else if (column.equals("create_time") || column.equals("modify_time")) { + // TODO: 2015/12/24 这么处理不好,得相伴办法调整 + return column + " " + splits[1]; + } else { + return "convert(" + column + " using gbk) " + splits[1]; + } + } + } + return ""; + } + + public static String getJoinTablesOrderString(String orders, String tableName) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + return "convert(" + tableName + "." + ColumnPropertyUtil.propertyToColumn(splits[0]) + " using gbk) " + splits[1]; + } + } + return ""; + } + + + /** + * 将指定字段排序 + * inet_aton:mysql将IP 转成 long类别函数 + * + * @param orders 格式 属性名,排序方式 例如( name,asc或ip,desc) + * @param ipPropertyName 如果需要按IP属性排序,需要将属性名传入(可不传) + * @return 排序字符串 例如:(name asc 或 ip desc) + */ + public static String getOrderString(String orders, String... ipPropertyName) { + if (StringUtil.isNotEmpty(orders)) { + String[] splits = orders.split(Constants.SPLIT); + if (splits.length == 2) { + String column = ColumnPropertyUtil.propertyToColumn(splits[0]); + if (ipPropertyName != null && ipPropertyName.length > 0) { + for (String ip : ipPropertyName) { + if (ip.equals(column)) { + return "inet_aton(" + column + ") " + splits[1]; + } + } + } + return column + " " + splits[1]; + } + } + return ""; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/PageQueryInfo.java b/utils/src/main/java/com/wansensoft/utils/PageQueryInfo.java new file mode 100644 index 00000000..cb9f4ab0 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/PageQueryInfo.java @@ -0,0 +1,30 @@ +package com.wansensoft.utils; + +import java.util.List; + +/** + * 分页查询结果 + * + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class PageQueryInfo { + + private Long total; + private List rows; + + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ParamUtils.java b/utils/src/main/java/com/wansensoft/utils/ParamUtils.java new file mode 100644 index 00000000..a3855b3f --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ParamUtils.java @@ -0,0 +1,57 @@ +package com.wansensoft.utils; + +import jakarta.servlet.http.HttpServletRequest; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class ParamUtils { + public static String getPageOffset(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int offset = (currentPage - 1) * pageSize; + if (offset <= 0) { + return "0"; + } else { + return String.valueOf(offset); + } + } + return null; + } + public static Integer getNumberPageOffset(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int offset = (currentPage - 1) * pageSize; + if (offset <= 0) { + return 0; + } else { + return offset; + } + } + return null; + } + public static Integer getNumberPageRows(Integer currentPage, Integer pageSize) { + if (currentPage != null && pageSize != null) { + int rows = (currentPage) * pageSize; + if (rows <= 0) { + return 0; + } else { + return rows; + } + } + return null; + } + + public static HashMap requestToMap(HttpServletRequest request) { + + HashMap parameterMap = new HashMap(); + Enumeration names = request.getParameterNames(); + if (names != null) { + for (String name : Collections.list(names)) { + parameterMap.put(name, request.getParameter(name)); + } + } + return parameterMap; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/QueryUtils.java b/utils/src/main/java/com/wansensoft/utils/QueryUtils.java new file mode 100644 index 00000000..72fffe35 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/QueryUtils.java @@ -0,0 +1,142 @@ +package com.wansensoft.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.springframework.util.Assert; + +import java.util.List; +import java.util.Map; + +import static com.wansensoft.utils.Constants.CURRENT_PAGE; +import static com.wansensoft.utils.Constants.PAGE_SIZE; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class QueryUtils { + public static String filterSqlSpecialChar(String search) { + return search != null ? search + .replaceAll("_", "\\\\_") + .replaceAll("!", "\\\\!") + .replaceAll("\\[", "\\\\[") + .replaceAll("\\]", "\\\\]") + .replaceAll("\\^", "\\\\^") : null; + } + + public static T list2One(List list, String label) { + Assert.notNull(label); + Assert.notEmpty(list, label + "对应的记录不存在"); + Assert.isTrue(list.size() == 1, label + "对应的记录不止一个"); + return list.get(0); + } + + public static T list2One(List list, String label, T defaultValue) { + Assert.notNull(list); + Assert.notNull(label); + if (list.isEmpty()) + return defaultValue; + else { + Assert.isTrue(list.size() == 1, label + "对应的记录不止一个"); + return list.get(0); + } + } + + public static List search(Map map) { + List search = null; + + String str = map.get(Constants.SEARCH); + if (StringUtil.isNotEmpty(str)) { + search = StringUtil.searchCondition(str); + } + return search; + } + + public static int rows(Map map) { + return Integer.parseInt(map.get(PAGE_SIZE)); + } + + public static int offset(Map map) { + return (currentPage(map) - 1) * pageSize(map); + } + + public static int pageSize(Map map) { + return Integer.parseInt(map.get(PAGE_SIZE)); + } + + public static int currentPage(Map map) { + int val = Integer.parseInt(map.get(CURRENT_PAGE)); + if (val < 1) + throw new RuntimeException("当前页数目:" + val + " 必须大于0"); + return val; + } + + public static String order(Map map) { + String orderString = OrderUtils.getOrderString(map.get(Constants.ORDER)); + return orderString.trim().isEmpty() ? null : orderString; + } + + public static Integer level(Map map) { + String levelString = map.get(Constants.LEVEL); + return StringUtil.isEmpty(levelString) ? null : Integer.parseInt(levelString); + } + + public static boolean isRecursion(Map map) { + String isRecursion = map.get(Constants.IS_RECURSION); + return StringUtil.isNotEmpty(isRecursion) && Constants.IS_RECURSION_VALUE.equals(isRecursion); + } + + public static int type(Map map) { + return Integer.parseInt(map.get(Constants.TYPE)); + } + + public static String filter(Map map) { + if (map.containsKey(Constants.FILTER)) { + JSONArray array = JSON.parseArray(map.get(Constants.FILTER)); + if (array.isEmpty()) { + return null; + } else { + boolean first = true; + StringBuilder builder = new StringBuilder(); + for (int idx = 0; idx < array.size(); ++idx) { + JSONObject object = array.getJSONObject(idx); + if (object.get("value") instanceof JSONArray) { + + JSONArray value = object.getJSONArray("value"); + + if (!value.isEmpty()) { + if (!first) { + builder.append(" AND "); + } else { + first = false; + } + + String key = object.getString("name"); + + builder.append("("); + + builder.append("`").append(key).append("`"); + + builder.append(" IN "); + + builder.append("("); + + for (int vidx = 0; vidx < value.size(); ++vidx) { + if (vidx != 0) { + builder.append(","); + } + builder.append(value.getString(vidx)); + } + builder.append(")"); + + builder.append(")"); + } + } + } + return builder.toString(); + } + } else { + return null; + } + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/verifcode/RandImageUtil.java b/utils/src/main/java/com/wansensoft/utils/RandImageUtil.java similarity index 88% rename from utils/src/main/java/com/wansensoft/utils/verifcode/RandImageUtil.java rename to utils/src/main/java/com/wansensoft/utils/RandImageUtil.java index 48d0bab3..51493010 100644 --- a/utils/src/main/java/com/wansensoft/utils/verifcode/RandImageUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/RandImageUtil.java @@ -1,16 +1,4 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.verifcode; +package com.wansensoft.utils; import javax.imageio.ImageIO; import jakarta.servlet.http.HttpServletResponse; diff --git a/utils/src/main/java/com/wansensoft/utils/RegExpTools.java b/utils/src/main/java/com/wansensoft/utils/RegExpTools.java index 6d45407a..cbf22556 100644 --- a/utils/src/main/java/com/wansensoft/utils/RegExpTools.java +++ b/utils/src/main/java/com/wansensoft/utils/RegExpTools.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils; import org.springframework.util.Assert; @@ -18,9 +6,11 @@ import java.util.List; /** - *

- * mysql匹配正则表达式 - *

+ * Created by Adm on 2015/12/14. + * + * @author yubiao + *

+ * mysql匹配正则表达式 */ public class RegExpTools { /** diff --git a/utils/src/main/java/com/wansensoft/utils/Response.java b/utils/src/main/java/com/wansensoft/utils/Response.java new file mode 100644 index 00000000..9d968b88 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/Response.java @@ -0,0 +1,80 @@ +package com.wansensoft.utils; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.wansensoft.utils.enums.CodeEnum; + +import java.io.Serial; +import java.io.Serializable; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Response implements Serializable { + + @Serial + private static final long serialVersionUID = 793034041048451317L; + + private String msg; + + private String code; + + private T data; + + public static Response success() { + return responseMsg(CodeEnum.SUCCESS); + } + + public static Response fail() { + return responseMsg(CodeEnum.ERROR); + } + + public static Response responseMsg(CodeEnum codeEnum) { + Response baseResponse = new Response(); + baseResponse.setCode(codeEnum.getCode()); + baseResponse.setMsg(codeEnum.getMsg()); + return baseResponse; + } + + public static Response responseMsg(String code, String msg) { + Response baseResponse = new Response(); + baseResponse.setCode(code); + baseResponse.setMsg(msg); + return baseResponse; + } + + public static Response responseData(T data) { + Response baseResponse = new Response(); + baseResponse.setCode(CodeEnum.SUCCESS.getCode()); + baseResponse.setData(data); + return baseResponse; + } + + public static Response responseData(String code, T data) { + Response baseResponse = new Response(); + baseResponse.setCode(code); + baseResponse.setData(data); + return baseResponse; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ResponseCode.java b/utils/src/main/java/com/wansensoft/utils/ResponseCode.java new file mode 100644 index 00000000..fe75d4e7 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ResponseCode.java @@ -0,0 +1,20 @@ +package com.wansensoft.utils; + +import com.alibaba.fastjson.annotation.JSONCreator; +import com.alibaba.fastjson.annotation.JSONField; + + +public class ResponseCode { + + public final int code; + public final Object data; + + + + + @JSONCreator + public ResponseCode(@JSONField(name = "code") int code, @JSONField(name = "data")Object data) { + this.code = code; + this.data = data; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java b/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java new file mode 100644 index 00000000..d6de6ce8 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java @@ -0,0 +1,72 @@ +package com.wansensoft.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson.serializer.ValueFilter; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.TimeZone; + +public class ResponseJsonUtil { + public static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + static { + FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+8")); + } + + + + public static final class ResponseFilter extends ExtJsonUtils.ExtFilter implements ValueFilter { + @Override + public Object process(Object object, String name, Object value) { + if (name.equals("createTime") || name.equals("modifyTime")||name.equals("updateTime")) { + return value; + } else if (value instanceof Date) { + return FORMAT.format(value); + } else { + return value; + } + } + } + + + public static String backJson4HttpApi(ResponseCode responseCode) { + if (responseCode != null) { + String result = JSON.toJSONString(responseCode, new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + result = result.replaceFirst("\"data\":\\{", ""); + return result.substring(0, result.length() - 1); + } + return null; + } + + + + public static String backJson4VerifyFailure(int code) { + Map map = new HashMap(); + map.put("message", "未通过验证"); + return JSON.toJSONString(new ResponseCode(code, map), new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + } + + + + public static String backJson(ResponseCode responseCode) { + if (responseCode != null) { + return JSON.toJSONString(responseCode, new ResponseFilter(), + SerializerFeature.DisableCircularReferenceDetect, + SerializerFeature.WriteNonStringKeyAsString); + } + return null; + } + + public static String returnJson(Map map, String message, int code) { + map.put("message", message); + return backJson(new ResponseCode(code, map)); + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/SnowflakeIdUtil.java b/utils/src/main/java/com/wansensoft/utils/SnowflakeIdUtil.java deleted file mode 100644 index 348677a2..00000000 --- a/utils/src/main/java/com/wansensoft/utils/SnowflakeIdUtil.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils; - -/** - * Snowflake Algorithm - */ -public class SnowflakeIdUtil { - - // ==============================Fields=========================================== - /** - * 开始时间截 (2015-01-01) - */ - private final static long twepoch = 1420041600000L; - - /** - * 机器id所占的位数 - */ - private final static long workerIdBits = 5L; - - /** - * 数据标识id所占的位数 - */ - private final static long datacenterIdBits = 5L; - - /** - * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) - */ - private final static long maxWorkerId = -1L ^ (-1L << workerIdBits); - - /** - * 支持的最大数据标识id,结果是31 - */ - private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); - - /** - * 序列在id中占的位数 - */ - private final static long sequenceBits = 12L; - - /** - * 机器ID向左移12位 - */ - private final static long workerIdShift = sequenceBits; - - /** - * 数据标识id向左移17位(12+5) - */ - private final static long datacenterIdShift = sequenceBits + workerIdBits; - - /** - * 时间截向左移22位(5+5+12) - */ - private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; - - /** - * 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) - */ - private final static long sequenceMask = -1L ^ (-1L << sequenceBits); - - /** - * 工作机器ID(0~31) - */ - private static long workerId; - - /** - * 数据中心ID(0~31) - */ - private static long datacenterId; - - /** - * 毫秒内序列(0~4095) - */ - private static long sequence = 0L; - - /** - * 上次生成ID的时间截 - */ - private static long lastTimestamp = -1L; - - //==============================Constructors===================================== - - /** - * 构造函数 - * - * @param workerId 工作ID (0~31) - * @param datacenterId 数据中心ID (0~31) - */ - public SnowflakeIdUtil(long workerId, long datacenterId) { - if (workerId > maxWorkerId || workerId < 0) { - throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); - } - if (datacenterId > maxDatacenterId || datacenterId < 0) { - throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); - } - this.workerId = workerId; - this.datacenterId = datacenterId; - } - - // ==============================Methods========================================== - - /** - * 获得下一个ID (该方法是线程安全的) - * - * @return SnowflakeId - */ - public synchronized static long nextId() { - long timestamp = timeGen(); - - //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常 - if (timestamp < lastTimestamp) { - throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); - } - - //如果是同一时间生成的,则进行毫秒内序列 - if (lastTimestamp == timestamp) { - sequence = (sequence + 1) & sequenceMask; - //毫秒内序列溢出 - if (sequence == 0) { - //阻塞到下一个毫秒,获得新的时间戳 - timestamp = tilNextMillis(lastTimestamp); - } - } - //时间戳改变,毫秒内序列重置 - else { - sequence = 0L; - } - - //上次生成ID的时间截 - lastTimestamp = timestamp; - - //移位并通过或运算拼到一起组成64位的ID - return ((timestamp - twepoch) << timestampLeftShift) - | (datacenterId << datacenterIdShift) - | (workerId << workerIdShift) - | sequence; - } - - /** - * 阻塞到下一个毫秒,直到获得新的时间戳 - * - * @param lastTimestamp 上次生成ID的时间截 - * @return 当前时间戳 - */ - protected static long tilNextMillis(long lastTimestamp) { - long timestamp = timeGen(); - while (timestamp <= lastTimestamp) { - timestamp = timeGen(); - } - return timestamp; - } - - /** - * 返回以毫秒为单位的当前时间 - * - * @return 当前时间(毫秒) - */ - protected static long timeGen() { - return System.currentTimeMillis(); - } - - //==============================Test============================================= - - /** - * 测试 - */ - public static void main(String[] args) { - long start = System.currentTimeMillis(); - SnowflakeIdUtil idWorker = new SnowflakeIdUtil(1, 3); - for (int i = 0; i < 50; i++) { - long id = idWorker.nextId(); - System.out.println(id); - } - long end = System.currentTimeMillis(); - System.out.println(end - start); - } -} diff --git a/utils/src/main/java/com/wansensoft/utils/StringUtil.java b/utils/src/main/java/com/wansensoft/utils/StringUtil.java new file mode 100644 index 00000000..ab98a213 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/StringUtil.java @@ -0,0 +1,373 @@ +package com.wansensoft.utils; + +import org.springframework.util.StringUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.regex.Pattern; + +/** + * @author jishenghua qq752718920 2018-10-7 15:26:27 + */ +public class StringUtil { + + private StringUtil() { + + } + + private static String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss"; + + public final static String regex = "'|#|%|;|--| and | and|and | or | or|or | not | not|not " + + "| use | use|use | insert | insert|insert | delete | delete|delete | update | update|update " + + "| select | select|select | count | count|count | group | group|group | union | union|union " + + "| create | create|create | drop | drop|drop | truncate | truncate|truncate | alter | alter|alter " + + "| grant | grant|grant | execute | execute|execute | exec | exec|exec | xp_cmdshell | xp_cmdshell|xp_cmdshell " + + "| call | call|call | declare | declare|declare | source | source|source | sql | sql|sql "; + + public static String filterNull(String str) { + if (str == null) { + return ""; + } else { + return str.trim(); + } + } + + public static boolean stringEquels(String source,String target) { + if(isEmpty(source)||isEmpty(target)){ + return false; + }else{ + return source.equals(target); + } + } + + public static boolean isEmpty(String str) { + return str == null || "".equals(str.trim()); + } + + public static boolean isNotEmpty(String str) { + return !isEmpty(str); + } + + public static String getSysDate(String format) { + if (StringUtil.isEmpty(format)) { + format = DEFAULT_FORMAT; + } + SimpleDateFormat df = new SimpleDateFormat(format); + return df.format(new Date()); + } + + public static Date getDateByString(String date, String format) { + if (StringUtil.isEmpty(format)) { + format = DEFAULT_FORMAT; + } + if (StringUtil.isNotEmpty(date)) { + SimpleDateFormat sdf = new SimpleDateFormat(format); + try { + return sdf.parse(date); + } catch (ParseException e) { + throw new RuntimeException("转换为日期类型错误:DATE:" + date + " FORMAT:" + format); + } + } else { + return null; + } + } + + public static Date getDateByLongDate(Long millis) { + if (millis == null) { + return new Date(); + } + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(millis); + return cal.getTime(); + + } + + public static UUID stringToUUID(String id) { + if (StringUtil.isNotEmpty(id)) { + return UUID.fromString(id); + } else { + return null; + } + } + + public static Integer parseInteger(String str) { + if (StringUtil.isNotEmpty(str)) { + return Integer.parseInt(str); + } else { + return null; + } + } + + public static Long parseStrLong(String str) { + if (StringUtil.isNotEmpty(str)) { + return Long.parseLong(str); + } else { + return null; + } + } + + public static List listToUUID(List listStrs) { + if (listStrs != null && listStrs.size() > 0) { + List uuidList = new ArrayList(); + for (String str : listStrs) { + uuidList.add(UUID.fromString(str)); + } + return uuidList; + } else { + return null; + } + } + + public static List arrayToUUIDList(String[] uuids) { + if (uuids != null && uuids.length > 0) { + List uuidList = new ArrayList(); + for (String str : uuids) { + uuidList.add(UUID.fromString(str)); + } + return uuidList; + } else { + return null; + } + } + + //是否是JSON + public static boolean containsAny(String str, String... flag) { + if (str != null) { + if (flag == null || flag.length == 0) { + flag = "[-{-}-]-,".split("-"); + } + for (String s : flag) { + if (str.contains(s)) { + return true; + } + } + } + return false; + } + + public static String getModifyOrgOperateData(UUID resourceId, UUID orgId) { + if (resourceId != null && orgId != null) { + Map map = new HashMap(); + map.put(resourceId, orgId); + return JSON.toJSONString(map); + } + return ""; + } + + public static String[] listToStringArray(List list) { + if (list != null && !list.isEmpty()) { + return list.toArray(new String[list.size()]); + } + return new String[0]; + } + + public static Long[] listToLongArray(List list) { + if (list != null && !list.isEmpty()) { + return list.toArray(new Long[list.size()]); + } + return new Long[0]; + } + + public static List stringToListArray(String[] strings) { + if (strings != null && strings.length > 0) { + return Arrays.asList(strings); + } + return new ArrayList(); + } + + public static BigDecimal getArrSum(String[] strings) { + BigDecimal sum = BigDecimal.ZERO; + for(int i=0;i数据格式 + * String str = "1,2,3,4,5,6" -> List listLong [1,2,3,4,5,6]; + * + * @param strArr + * @return + */ + public static List strToLongList(String strArr) { + List idList=new ArrayList(); + String[] d=strArr.split(","); + for (int i = 0, size = d.length; i < size; i++) { + if(d[i]!=null) { + idList.add(Long.parseLong(d[i])); + } + } + return idList; + } + + /** + * String字符串转成List数据格式 + * String str = "1,2,3,4,5,6" -> List listBigDecimal [1,2,3,4,5,6]; + * + * @param strArr + * @return + */ + public static List strToBigDecimalList(String strArr) { + List idList=new ArrayList<>(); + String[] d=strArr.split(","); + for (int i = 0, size = d.length; i < size; i++) { + if(d[i]!=null) { + idList.add(new BigDecimal(d[i])); + } + } + return idList; + } + + /** + * String字符串转成List数据格式 + * String str = "1,2,3,4,5,6" -> List listLong [1,2,3,4,5,6]; + * + * @param strArr + * @return + */ + public static List strToStringList(String strArr) { + if(StringUtils.isEmpty(strArr)){ + return null; + } + List idList=new ArrayList(); + String[] d=strArr.split(","); + for (int i = 0, size = d.length; i < size; i++) { + if(d[i]!=null) { + idList.add(d[i].toString()); + } + } + return idList; + } + + public static List searchCondition(String search) { + if (isEmpty(search)) { + return new ArrayList(); + }else{ + //String[] split = search.split(" "); + String[] split = search.split("#"); + return stringToListArray(split); + } + } + + public static String getInfo(String search, String key){ + String value = null; + if(StringUtil.isNotEmpty(search)) { + search = search.replace("{}",""); + if(StringUtil.isNotEmpty(search)) { + JSONObject obj = JSONObject.parseObject(search); + if (obj.get(key) != null) { + value = obj.getString(key).trim(); + if (value.equals("")) { + value = null; + } + } else { + value = null; + } + } + } + return value; + } + + public static String toNull(String value) { + if(isEmpty(value)) { + value = null; + } else { + value = value.trim(); + } + return value; + } + + public static boolean isExist(Object value) { + if(value!=null) { + String str = value.toString(); + if("".equals(str.trim())) { + return false; + } else { + return true; + } + } else { + return false; + } + } + + /** + * 判断对象是否为正整数 + * @param value + * @return + */ + public static boolean isPositiveLong(Object value) { + if(value!=null) { + String str = value.toString(); + if(isNotEmpty(str)) { + if((str.matches("[0-9]+"))&&(Long.parseLong(str)>0)) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + /** + * 校验条码长度为4到40位 + * @param value + * @return + */ + public static boolean checkBarCodeLength(Object value) { + if(value!=null) { + String str = value.toString(); + if(isNotEmpty(str)) { + if(str.length()>=4 && str.length()<=40 ) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + /** + * 判断对象是否为数字(含小数) + * @param str + * @return + */ + public static boolean isPositiveBigDecimal(String str){ + Pattern pattern = Pattern.compile("[0-9]*"); + if(str.indexOf(".")>0){//判断是否有小数点 + if(str.indexOf(".")==str.lastIndexOf(".") && str.split("\\.").length==2){ //判断是否只有一个小数点 + return pattern.matcher(str.replace(".","")).matches(); + }else { + return false; + } + }else { + return pattern.matcher(str).matches(); + } + } + + /** + * sql注入过滤,保障sql的安全执行 + * @param originStr + * @return + */ + public static String safeSqlParse(String originStr){ + return originStr.replaceAll("(?i)" + regex, ""); + } + + public static void main(String[] args) { + int i = 10/3; + System.out.println(i); + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/CommonTools.java b/utils/src/main/java/com/wansensoft/utils/Tools.java similarity index 94% rename from utils/src/main/java/com/wansensoft/utils/CommonTools.java rename to utils/src/main/java/com/wansensoft/utils/Tools.java index cd023aa7..09263e51 100644 --- a/utils/src/main/java/com/wansensoft/utils/CommonTools.java +++ b/utils/src/main/java/com/wansensoft/utils/Tools.java @@ -1,18 +1,5 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils; -import com.wansensoft.utils.redis.RedisUtil; import org.springframework.util.StringUtils; import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; @@ -31,9 +18,10 @@ /** * 工具类 + * + * @author jishenghua qq:7-5-2-7-1-8-9-2-0 */ -public class CommonTools { - +public class Tools { /** * 获得32位唯一序列号 * @@ -135,6 +123,13 @@ public static String getCenternTime(Date date) { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); } + public static String parseDayToTime(String day, String timeStr) { + if(StringUtil.isNotEmpty(day)){ + return day + timeStr; + } else { + return null; + } + } /** * 获得指定时间,格式为mm:ss @@ -292,7 +287,7 @@ public static boolean CheckIsStartWithSpec(String str) { * * @param aValue * @return - + * @see 转码后的字符串 */ public static String encodeValue(String aValue) { if (aValue.trim().length() == 0) { @@ -312,6 +307,7 @@ public static String encodeValue(String aValue) { * * @param aValue * @return + * @see 转码后的字符串 */ public static String decodeValue(String aValue) { if (aValue.trim().length() == 0) { @@ -646,16 +642,12 @@ public static String removeSymbolForString(String s) { * @return 加密后的MD5字符串 * @throws NoSuchAlgorithmException */ - public static String md5Encryp(String msg) { + public static String md5Encryp(String msg) throws NoSuchAlgorithmException { // 生成一个MD5加密计算摘要 - try { - MessageDigest md = MessageDigest.getInstance("MD5"); - // 计算md5函数 - md.update(msg.getBytes()); - return new BigInteger(1, md.digest()).toString(16); - }catch (Exception e) { - return null; - } + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(msg.getBytes()); + return new BigInteger(1, md.digest()).toString(16); } /** @@ -682,6 +674,22 @@ public static String dealNullStr(String beforeStr) { return beforeStr; } + /** + * 根据token截取租户id + * @param token + * @return + */ + public static Long getTenantIdByToken(String token) { + Long tenantId = 0L; + if(StringUtil.isNotEmpty(token) && token.indexOf("_")>-1) { + String[] tokenArr = token.split("_"); + if (tokenArr.length == 2) { + tenantId = Long.parseLong(tokenArr[1]); + } + } + return tenantId; + } + /** * 使用参数Format将字符串转为Date * @@ -739,8 +747,13 @@ public static void main(String[] args) { } System.out.println(getBeforeMonth(1)); - System.out.println(md5Encryp("guest")); - System.out.println(md5Encryp("admin")); + try { + System.out.println(md5Encryp("guest")); + System.out.println(md5Encryp("admin")); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } String value = "2333"; System.out.println(checkStrIsNum(value)); diff --git a/utils/src/main/java/com/wansensoft/utils/constants/ApiVersionConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/ApiVersionConstants.java deleted file mode 100644 index 9183b588..00000000 --- a/utils/src/main/java/com/wansensoft/utils/constants/ApiVersionConstants.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.constants; - -public interface ApiVersionConstants { - - String API_VERSION_V1 = "v1/"; - - String API_METHOD_VERSION_V2 = "v2/"; - - String API_CLASS_VERSION_V2 = "/v2/"; - - String API_VERSION_Bata = "Bata/"; -} diff --git a/utils/src/main/java/com/wansensoft/utils/constants/BusinessConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/BusinessConstants.java index c399afd7..a6aea87a 100644 --- a/utils/src/main/java/com/wansensoft/utils/constants/BusinessConstants.java +++ b/utils/src/main/java/com/wansensoft/utils/constants/BusinessConstants.java @@ -1,72 +1,64 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils.constants; /** - * 业务字典类 + * @ClassName:BusinessConstants + * @Description 业务字典类 + * @Author qiankunpingtai + * @Date 2019-3-6 17:58 + * @Version 1.0 **/ -public interface BusinessConstants { +public class BusinessConstants { /** * 默认的日期格式 */ - String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; /** * 一天的初始时间 */ - String DAY_FIRST_TIME = " 00:00:00"; + public static final String DAY_FIRST_TIME = " 00:00:00"; /** * 一天的结束时间 */ - String DAY_LAST_TIME = " 23:59:59"; + public static final String DAY_LAST_TIME = " 23:59:59"; /** * 默认的分页起始页页码 */ - Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1; + public static final Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1; /** * 无数据时列表返回的默认数据条数 */ - Long DEFAULT_LIST_NULL_NUMBER = 0L; + public static final Long DEFAULT_LIST_NULL_NUMBER = 0L; /** * 默认的分页条数 */ - Integer DEFAULT_PAGINATION_PAGE_SIZE = 10; + public static final Integer DEFAULT_PAGINATION_PAGE_SIZE = 10; /** * 单据主表出入库类型 type 入库 出库 其它 * depothead * */ - String DEPOTHEAD_TYPE_IN = "入库"; - String DEPOTHEAD_TYPE_OUT = "出库"; - String DEPOTHEAD_TYPE_OTHER = "其它"; + public static final String DEPOTHEAD_TYPE_IN = "入库"; + public static final String DEPOTHEAD_TYPE_OUT = "出库"; + public static final String DEPOTHEAD_TYPE_OTHER = "其它"; /** * 付款类型 payType //现付/预付款 * */ - String PAY_TYPE_PREPAID = "预付款"; - String PAY_TYPE_BY_CASH = "现付"; + public static final String PAY_TYPE_PREPAID = "预付款"; + public static final String PAY_TYPE_BY_CASH = "现付"; /** * 删除标记 deleteFlag '0'未删除 '1'已删除 * */ - String DELETE_FLAG_DELETED = "1"; - String DELETE_FLAG_EXISTS = "0"; + public static final String DELETE_FLAG_DELETED = "1"; + public static final String DELETE_FLAG_EXISTS = "0"; /** * 是否卖出 isSell '0'未卖出 '1'已卖出 * */ - String IS_SELL_SELLED = "1"; - String IS_SELL_HOLD = "0"; + public static final String IS_SELL_SELLED = "1"; + public static final String IS_SELL_HOLD = "0"; /** * 商品是否开启序列号标识enableSerialNumber '0'未启用 '1'启用 * */ - String ENABLE_SERIAL_NUMBER_ENABLED = "1"; + public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1"; public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0"; /** * 商品是否开启批号标识enableBatchNumber '0'未启用 '1'启用 diff --git a/utils/src/main/java/com/wansensoft/utils/constants/CommonConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/CommonConstants.java deleted file mode 100644 index 570062a0..00000000 --- a/utils/src/main/java/com/wansensoft/utils/constants/CommonConstants.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.constants; - -/** - * 通用常量接口 - */ -public interface CommonConstants { - - // 逻辑删除标识对应DB的delete_flag 未删除 - int NOT_DELETED = 0; - - // 逻辑删除标识对应DB的delete_flag 已删除 - int DELETED = 1; -} diff --git a/utils/src/main/java/com/wansensoft/utils/constants/ExceptionConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/ExceptionConstants.java index 9e360c91..062d28b3 100644 --- a/utils/src/main/java/com/wansensoft/utils/constants/ExceptionConstants.java +++ b/utils/src/main/java/com/wansensoft/utils/constants/ExceptionConstants.java @@ -1,543 +1,532 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils.constants; import com.alibaba.fastjson.JSONObject; -public interface ExceptionConstants { +public class ExceptionConstants { /** * code 格式 type+五位数字,例如3500000 * ResourceInfo(value = "inOutItem", type = 35) - **/ + * + * */ - String GLOBAL_RETURNS_CODE = "code"; - String GLOBAL_RETURNS_MESSAGE = "msg"; - String GLOBAL_RETURNS_DATA = "data"; + public static final String GLOBAL_RETURNS_CODE = "code"; + public static final String GLOBAL_RETURNS_MESSAGE = "msg"; + public static final String GLOBAL_RETURNS_DATA = "data"; /** * 正常返回/操作成功 **/ - int SERVICE_SUCCESS_CODE = 200; - String SERVICE_SUCCESS_MSG = "操作成功"; + public static final int SERVICE_SUCCESS_CODE = 200; + public static final String SERVICE_SUCCESS_MSG = "操作成功"; /** * 数据查询异常 */ - int DATA_READ_FAIL_CODE = 300; - String DATA_READ_FAIL_MSG = "数据查询异常"; + public static final int DATA_READ_FAIL_CODE = 300; + public static final String DATA_READ_FAIL_MSG = "数据查询异常"; /** * 数据写入异常 */ - int DATA_WRITE_FAIL_CODE = 301; - String DATA_WRITE_FAIL_MSG = "数据写入异常"; + public static final int DATA_WRITE_FAIL_CODE = 301; + public static final String DATA_WRITE_FAIL_MSG = "数据写入异常"; /** * 系统运行时未知错误 **/ - int SERVICE_SYSTEM_ERROR_CODE = 500; - String SERVICE_SYSTEM_ERROR_MSG = "未知异常"; + public static final int SERVICE_SYSTEM_ERROR_CODE = 500; + public static final String SERVICE_SYSTEM_ERROR_MSG = "未知异常"; /** * 检测到存在依赖数据,是否强制删除? **/ - int DELETE_FORCE_CONFIRM_CODE = 601; - String DELETE_FORCE_CONFIRM_MSG = "检测到存在依赖数据,不能删除!"; + public static final int DELETE_FORCE_CONFIRM_CODE = 601; + public static final String DELETE_FORCE_CONFIRM_MSG = "检测到存在依赖数据,不能删除!"; /** * 用户信息 * type = 5 * */ //添加用户信息失败 - int USER_ADD_FAILED_CODE = 500000; - String USER_ADD_FAILED_MSG = "添加用户信息失败"; + public static final int USER_ADD_FAILED_CODE = 500000; + public static final String USER_ADD_FAILED_MSG = "添加用户信息失败"; //删除用户信息失败 - int USER_DELETE_FAILED_CODE = 500001; - String USER_DELETE_FAILED_MSG = "删除用户信息失败"; + public static final int USER_DELETE_FAILED_CODE = 500001; + public static final String USER_DELETE_FAILED_MSG = "删除用户信息失败"; //修改用户信息失败 - int USER_EDIT_FAILED_CODE = 500002; - String USER_EDIT_FAILED_MSG = "修改用户信息失败"; + public static final int USER_EDIT_FAILED_CODE = 500002; + public static final String USER_EDIT_FAILED_MSG = "修改用户信息失败"; //登录名已存在 - int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003; - String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名在本系统已存在"; + public static final int USER_LOGIN_NAME_ALREADY_EXISTS_CODE = 500003; + public static final String USER_LOGIN_NAME_ALREADY_EXISTS_MSG = "登录名在本系统已存在"; //用户录入数量超出限制 - int USER_OVER_LIMIT_FAILED_CODE = 500004; - String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系平台管理员"; + public static final int USER_OVER_LIMIT_FAILED_CODE = 500004; + public static final String USER_OVER_LIMIT_FAILED_MSG = "用户录入数量超出限制,请联系平台管理员"; //此用户名限制使用 - int USER_NAME_LIMIT_USE_CODE = 500005; - String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用"; + public static final int USER_NAME_LIMIT_USE_CODE = 500005; + public static final String USER_NAME_LIMIT_USE_MSG = "此用户名限制使用"; //启用的用户数量超出限制 - int USER_ENABLE_OVER_LIMIT_FAILED_CODE = 500006; - String USER_ENABLE_OVER_LIMIT_FAILED_MSG = "启用的用户数量超出限制,请联系平台管理员"; + public static final int USER_ENABLE_OVER_LIMIT_FAILED_CODE = 500006; + public static final String USER_ENABLE_OVER_LIMIT_FAILED_MSG = "启用的用户数量超出限制,请联系平台管理员"; //租户不能被删除 - int USER_LIMIT_TENANT_DELETE_CODE = 500008; - String USER_LIMIT_TENANT_DELETE_MSG = "抱歉,租户不能被删除"; + public static final int USER_LIMIT_TENANT_DELETE_CODE = 500008; + public static final String USER_LIMIT_TENANT_DELETE_MSG = "抱歉,租户不能被删除"; //当前机构已经存在经理 - int USER_LEADER_IS_EXIST_CODE = 500009; - String USER_LEADER_IS_EXIST_MSG = "抱歉,当前机构已经存在经理"; + public static final int USER_LEADER_IS_EXIST_CODE = 500009; + public static final String USER_LEADER_IS_EXIST_MSG = "抱歉,当前机构已经存在经理"; /** * 角色信息 * type = 10 * */ //添加角色信息失败 - int ROLE_ADD_FAILED_CODE = 1000000; - String ROLE_ADD_FAILED_MSG = "添加角色信息失败"; + public static final int ROLE_ADD_FAILED_CODE = 1000000; + public static final String ROLE_ADD_FAILED_MSG = "添加角色信息失败"; //删除角色信息失败 - int ROLE_DELETE_FAILED_CODE = 1000001; - String ROLE_DELETE_FAILED_MSG = "删除角色信息失败"; + public static final int ROLE_DELETE_FAILED_CODE = 1000001; + public static final String ROLE_DELETE_FAILED_MSG = "删除角色信息失败"; //修改角色信息失败 - int ROLE_EDIT_FAILED_CODE = 1000002; - String ROLE_EDIT_FAILED_MSG = "修改角色信息失败"; + public static final int ROLE_EDIT_FAILED_CODE = 1000002; + public static final String ROLE_EDIT_FAILED_MSG = "修改角色信息失败"; /** * 应用信息 * type = 15 * */ //添加角色信息失败 - int APP_ADD_FAILED_CODE = 1500000; - String APP_ADD_FAILED_MSG = "添加应用信息失败"; + public static final int APP_ADD_FAILED_CODE = 1500000; + public static final String APP_ADD_FAILED_MSG = "添加应用信息失败"; //删除角色信息失败 - int APP_DELETE_FAILED_CODE = 1500001; - String APP_DELETE_FAILED_MSG = "删除应用信息失败"; + public static final int APP_DELETE_FAILED_CODE = 1500001; + public static final String APP_DELETE_FAILED_MSG = "删除应用信息失败"; //修改角色信息失败 - int APP_EDIT_FAILED_CODE = 1500002; - String APP_EDIT_FAILED_MSG = "修改应用信息失败"; + public static final int APP_EDIT_FAILED_CODE = 1500002; + public static final String APP_EDIT_FAILED_MSG = "修改应用信息失败"; /** * 仓库信息 * type = 20 * */ //添加仓库信息失败 - int DEPOT_ADD_FAILED_CODE = 2000000; - String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败"; + public static final int DEPOT_ADD_FAILED_CODE = 2000000; + public static final String DEPOT_ADD_FAILED_MSG = "添加仓库信息失败"; //删除仓库信息失败 - int DEPOT_DELETE_FAILED_CODE = 2000001; - String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败"; + public static final int DEPOT_DELETE_FAILED_CODE = 2000001; + public static final String DEPOT_DELETE_FAILED_MSG = "删除仓库信息失败"; //修改仓库信息失败 - int DEPOT_EDIT_FAILED_CODE = 2000002; - String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败"; + public static final int DEPOT_EDIT_FAILED_CODE = 2000002; + public static final String DEPOT_EDIT_FAILED_MSG = "修改仓库信息失败"; /** * 功能模块信息 * type = 30 * */ //添加角色信息失败 - int FUNCTIONS_ADD_FAILED_CODE = 3000000; - String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败"; + public static final int FUNCTIONS_ADD_FAILED_CODE = 3000000; + public static final String FUNCTIONS_ADD_FAILED_MSG = "添加功能模块信息失败"; //删除角色信息失败 - int FUNCTIONS_DELETE_FAILED_CODE = 3000001; - String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败"; + public static final int FUNCTIONS_DELETE_FAILED_CODE = 3000001; + public static final String FUNCTIONS_DELETE_FAILED_MSG = "删除功能模块信息失败"; //修改角色信息失败 - int FUNCTIONS_EDIT_FAILED_CODE = 3000002; - String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败"; + public static final int FUNCTIONS_EDIT_FAILED_CODE = 3000002; + public static final String FUNCTIONS_EDIT_FAILED_MSG = "修改功能模块信息失败"; /** * 收支项目信息 * type = 35 * */ //添加收支项目信息失败 - int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000; - String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败"; + public static final int IN_OUT_ITEM_ADD_FAILED_CODE = 3500000; + public static final String IN_OUT_ITEM_ADD_FAILED_MSG = "添加收支项目信息失败"; //删除收支项目信息失败 - int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001; - String IN_OUT_ITEM_DELETE_FAILED_MSG = "删除收支项目信息失败"; + public static final int IN_OUT_ITEM_DELETE_FAILED_CODE = 3500001; + public static final String IN_OUT_ITEM_DELETE_FAILED_MSG = "删除收支项目信息失败"; //修改收支项目信息失败 - int IN_OUT_ITEM_EDIT_FAILED_CODE = 3500002; - String IN_OUT_ITEM_EDIT_FAILED_MSG = "修改收支项目信息失败"; + public static final int IN_OUT_ITEM_EDIT_FAILED_CODE = 3500002; + public static final String IN_OUT_ITEM_EDIT_FAILED_MSG = "修改收支项目信息失败"; /** * 多单位信息 * type = 40 * */ //添加多单位信息失败 - int UNIT_ADD_FAILED_CODE = 4000000; - String UNIT_ADD_FAILED_MSG = "添加多单位信息失败"; + public static final int UNIT_ADD_FAILED_CODE = 4000000; + public static final String UNIT_ADD_FAILED_MSG = "添加多单位信息失败"; //删除多单位信息失败 - int UNIT_DELETE_FAILED_CODE = 4000001; - String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败"; + public static final int UNIT_DELETE_FAILED_CODE = 4000001; + public static final String UNIT_DELETE_FAILED_MSG = "删除多单位信息失败"; //修改多单位信息失败 - int UNIT_EDIT_FAILED_CODE = 4000002; - String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败"; + public static final int UNIT_EDIT_FAILED_CODE = 4000002; + public static final String UNIT_EDIT_FAILED_MSG = "修改多单位信息失败"; /** * 经手人信息 * type = 45 * */ //添加经手人信息失败 - int PERSON_ADD_FAILED_CODE = 4500000; - String PERSON_ADD_FAILED_MSG = "添加经手人信息失败"; + public static final int PERSON_ADD_FAILED_CODE = 4500000; + public static final String PERSON_ADD_FAILED_MSG = "添加经手人信息失败"; //删除经手人信息失败 - int PERSON_DELETE_FAILED_CODE = 4500001; - String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败"; + public static final int PERSON_DELETE_FAILED_CODE = 4500001; + public static final String PERSON_DELETE_FAILED_MSG = "删除经手人信息失败"; //修改经手人信息失败 - int PERSON_EDIT_FAILED_CODE = 4500002; - String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败"; + public static final int PERSON_EDIT_FAILED_CODE = 4500002; + public static final String PERSON_EDIT_FAILED_MSG = "修改经手人信息失败"; /** * 用户角色模块关系信息 * type = 50 * */ //添加用户角色模块关系信息失败 - int USER_BUSINESS_ADD_FAILED_CODE = 5000000; - String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败"; + public static final int USER_BUSINESS_ADD_FAILED_CODE = 5000000; + public static final String USER_BUSINESS_ADD_FAILED_MSG = "添加用户角色模块关系信息失败"; //删除用户角色模块关系信息失败 - int USER_BUSINESS_DELETE_FAILED_CODE = 5000001; - String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败"; + public static final int USER_BUSINESS_DELETE_FAILED_CODE = 5000001; + public static final String USER_BUSINESS_DELETE_FAILED_MSG = "删除用户角色模块关系信息失败"; //修改用户角色模块关系信息失败 - int USER_BUSINESS_EDIT_FAILED_CODE = 5000002; - String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败"; + public static final int USER_BUSINESS_EDIT_FAILED_CODE = 5000002; + public static final String USER_BUSINESS_EDIT_FAILED_MSG = "修改用户角色模块关系信息失败"; /** * 系统参数信息 * type = 55 * */ //添加系统参数信息失败 - int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000; - String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败"; + public static final int SYSTEM_CONFIG_ADD_FAILED_CODE = 5500000; + public static final String SYSTEM_CONFIG_ADD_FAILED_MSG = "添加系统参数信息失败"; //删除系统参数信息失败 - int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001; - String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败"; + public static final int SYSTEM_CONFIG_DELETE_FAILED_CODE = 5500001; + public static final String SYSTEM_CONFIG_DELETE_FAILED_MSG = "删除系统参数信息失败"; //修改系统参数信息失败 - int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002; - String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败"; + public static final int SYSTEM_CONFIG_EDIT_FAILED_CODE = 5500002; + public static final String SYSTEM_CONFIG_EDIT_FAILED_MSG = "修改系统参数信息失败"; /** * 商品扩展信息 * type = 60 * */ //添加商品扩展信息失败 - int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000; - String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败"; + public static final int MATERIAL_PROPERTY_ADD_FAILED_CODE = 6000000; + public static final String MATERIAL_PROPERTY_ADD_FAILED_MSG = "添加商品扩展信息失败"; //删除商品扩展信息失败 - int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001; - String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败"; + public static final int MATERIAL_PROPERTY_DELETE_FAILED_CODE = 6000001; + public static final String MATERIAL_PROPERTY_DELETE_FAILED_MSG = "删除商品扩展信息失败"; //修改商品扩展信息失败 - int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002; - String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败"; + public static final int MATERIAL_PROPERTY_EDIT_FAILED_CODE = 6000002; + public static final String MATERIAL_PROPERTY_EDIT_FAILED_MSG = "修改商品扩展信息失败"; /** * 账户信息 * type = 65 * */ //添加账户信息失败 - int ACCOUNT_ADD_FAILED_CODE = 6500000; - String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败"; + public static final int ACCOUNT_ADD_FAILED_CODE = 6500000; + public static final String ACCOUNT_ADD_FAILED_MSG = "添加账户信息失败"; //删除账户信息失败 - int ACCOUNT_DELETE_FAILED_CODE = 6500001; - String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败"; + public static final int ACCOUNT_DELETE_FAILED_CODE = 6500001; + public static final String ACCOUNT_DELETE_FAILED_MSG = "删除账户信息失败"; //修改账户信息失败 - int ACCOUNT_EDIT_FAILED_CODE = 6500002; - String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败"; + public static final int ACCOUNT_EDIT_FAILED_CODE = 6500002; + public static final String ACCOUNT_EDIT_FAILED_MSG = "修改账户信息失败"; /** * 供应商信息 * type = 70 * */ //添加供应商信息失败 - int SUPPLIER_ADD_FAILED_CODE = 7000000; - String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败"; + public static final int SUPPLIER_ADD_FAILED_CODE = 7000000; + public static final String SUPPLIER_ADD_FAILED_MSG = "添加供应商信息失败"; //删除供应商信息失败 - int SUPPLIER_DELETE_FAILED_CODE = 7000001; - String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败"; + public static final int SUPPLIER_DELETE_FAILED_CODE = 7000001; + public static final String SUPPLIER_DELETE_FAILED_MSG = "删除供应商信息失败"; //修改供应商信息失败 - int SUPPLIER_EDIT_FAILED_CODE = 7000002; - String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败"; + public static final int SUPPLIER_EDIT_FAILED_CODE = 7000002; + public static final String SUPPLIER_EDIT_FAILED_MSG = "修改供应商信息失败"; /** * 商品类别信息 * type = 75 * */ //添加商品类别信息失败 - int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000; - String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败"; + public static final int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000; + public static final String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败"; //删除商品类别信息失败 - int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001; - String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; + public static final int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001; + public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; //修改商品类别信息失败 - int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; - String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败"; + public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; + public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "修改商品类别信息失败"; //商品类别编号已存在 - int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003; - String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在"; + public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003; + public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在"; //根类别不支持修改 - int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004; - String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根类别不支持修改"; + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004; + public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根类别不支持修改"; //根类别不支持删除 - int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005; - String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根类别不支持删除"; + public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005; + public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根类别不支持删除"; //该类别存在下级不允许删除 - int MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE = 7500006; - String MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG = "该类别存在下级不允许删除"; + public static final int MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE = 7500006; + public static final String MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG = "该类别存在下级不允许删除"; /** * 商品信息 * type = 80 * */ //商品信息不存在 - int MATERIAL_NOT_EXISTS_CODE = 8000000; - String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在"; + public static final int MATERIAL_NOT_EXISTS_CODE = 8000000; + public static final String MATERIAL_NOT_EXISTS_MSG = "商品信息不存在"; //商品信息不唯一 - int MATERIAL_NOT_ONLY_CODE = 8000001; - String MATERIAL_NOT_ONLY_MSG = "商品信息不唯一"; + public static final int MATERIAL_NOT_ONLY_CODE = 8000001; + public static final String MATERIAL_NOT_ONLY_MSG = "商品信息不唯一"; //该商品未开启序列号 - int MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE = 8000002; - String MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG = "该商品未开启序列号功能"; + public static final int MATERIAL_NOT_ENABLE_SERIAL_NUMBER_CODE = 8000002; + public static final String MATERIAL_NOT_ENABLE_SERIAL_NUMBER_MSG = "该商品未开启序列号功能"; //商品的序列号不能为空 - int MATERIAL_SERIAL_NUMBERE_EMPTY_CODE = 8000003; - String MATERIAL_SERIAL_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的序列号不能为空"; + public static final int MATERIAL_SERIAL_NUMBERE_EMPTY_CODE = 8000003; + public static final String MATERIAL_SERIAL_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的序列号不能为空"; //商品库存不足 - int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004; - String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; + public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004; + public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; //商品条码重复 - int MATERIAL_BARCODE_EXISTS_CODE = 8000005; - String MATERIAL_BARCODE_EXISTS_MSG = "商品条码:%s重复"; + public static final int MATERIAL_BARCODE_EXISTS_CODE = 8000005; + public static final String MATERIAL_BARCODE_EXISTS_MSG = "商品条码:%s重复"; //商品-单位匹配不上 - int MATERIAL_UNIT_MATE_CODE = 8000006; - String MATERIAL_UNIT_MATE_MSG = "抱歉,商品条码:%s的单位匹配不上,请完善计量单位信息!"; + public static final int MATERIAL_UNIT_MATE_CODE = 8000006; + public static final String MATERIAL_UNIT_MATE_MSG = "抱歉,商品条码:%s的单位匹配不上,请完善计量单位信息!"; //商品条码长度应该为4到40位 - int MATERIAL_BARCODE_LENGTH_ERROR_CODE = 8000007; - String MATERIAL_BARCODE_LENGTH_ERROR_MSG = "商品条码长度应该为4到40位"; + public static final int MATERIAL_BARCODE_LENGTH_ERROR_CODE = 8000007; + public static final String MATERIAL_BARCODE_LENGTH_ERROR_MSG = "商品条码长度应该为4到40位"; //序列号和批号只能有一项 - int MATERIAL_ENABLE_MUST_ONE_CODE = 8000008; - String MATERIAL_ENABLE_MUST_ONE_MSG = "抱歉,商品条码:%s的序列号和批号不能同时填1"; + public static final int MATERIAL_ENABLE_MUST_ONE_CODE = 8000008; + public static final String MATERIAL_ENABLE_MUST_ONE_MSG = "抱歉,商品条码:%s的序列号和批号不能同时填1"; //抱歉,文件扩展名必须为xls - int MATERIAL_EXTENSION_ERROR_CODE = 8000009; - String MATERIAL_EXTENSION_ERROR_MSG = "抱歉,文件扩展名必须为xls"; + public static final int MATERIAL_EXTENSION_ERROR_CODE = 8000009; + public static final String MATERIAL_EXTENSION_ERROR_MSG = "抱歉,文件扩展名必须为xls"; //名称为空 - int MATERIAL_NAME_EMPTY_CODE = 8000010; - String MATERIAL_NAME_EMPTY_MSG = "第%s行名称为空"; + public static final int MATERIAL_NAME_EMPTY_CODE = 8000010; + public static final String MATERIAL_NAME_EMPTY_MSG = "第%s行名称为空"; //基本单位为空 - int MATERIAL_UNIT_EMPTY_CODE = 8000011; - String MATERIAL_UNIT_EMPTY_MSG = "第%s行基本单位为空"; + public static final int MATERIAL_UNIT_EMPTY_CODE = 8000011; + public static final String MATERIAL_UNIT_EMPTY_MSG = "第%s行基本单位为空"; //状态格式错误 - int MATERIAL_ENABLED_ERROR_CODE = 8000012; - String MATERIAL_ENABLED_ERROR_MSG = "第%s行状态格式错误"; + public static final int MATERIAL_ENABLED_ERROR_CODE = 8000012; + public static final String MATERIAL_ENABLED_ERROR_MSG = "第%s行状态格式错误"; //单次导入超出1000条 - int MATERIAL_IMPORT_OVER_LIMIT_CODE = 8000013; - String MATERIAL_IMPORT_OVER_LIMIT_MSG = "抱歉,单次导入不能超出1000条"; + public static final int MATERIAL_IMPORT_OVER_LIMIT_CODE = 8000013; + public static final String MATERIAL_IMPORT_OVER_LIMIT_MSG = "抱歉,单次导入不能超出1000条"; //基础重量格式错误 - int MATERIAL_WEIGHT_NOT_DECIMAL_CODE = 8000014; - String MATERIAL_WEIGHT_NOT_DECIMAL_MSG = "第%s行基础重量格式错误"; + public static final int MATERIAL_WEIGHT_NOT_DECIMAL_CODE = 8000014; + public static final String MATERIAL_WEIGHT_NOT_DECIMAL_MSG = "第%s行基础重量格式错误"; //保质期格式错误 - int MATERIAL_EXPIRY_NUM_NOT_INTEGER_CODE = 8000015; - String MATERIAL_EXPIRY_NUM_NOT_INTEGER_MSG = "第%s行保质期格式错误"; + public static final int MATERIAL_EXPIRY_NUM_NOT_INTEGER_CODE = 8000015; + public static final String MATERIAL_EXPIRY_NUM_NOT_INTEGER_MSG = "第%s行保质期格式错误"; //比例格式错误 - int MATERIAL_RATIO_NOT_INTEGER_CODE = 8000016; - String MATERIAL_RATIO_NOT_INTEGER_MSG = "第%s行比例格式错误"; + public static final int MATERIAL_RATIO_NOT_INTEGER_CODE = 8000016; + public static final String MATERIAL_RATIO_NOT_INTEGER_MSG = "第%s行比例格式错误"; //组装拆卸单不能选择批号或序列号商品 - int MATERIAL_ASSEMBLE_SELECT_ERROR_CODE = 80000017; - String MATERIAL_ASSEMBLE_SELECT_ERROR_MSG = "抱歉,组装拆卸单不能选择批号或序列号商品:%s"; + public static final int MATERIAL_ASSEMBLE_SELECT_ERROR_CODE = 80000017; + public static final String MATERIAL_ASSEMBLE_SELECT_ERROR_MSG = "抱歉,组装拆卸单不能选择批号或序列号商品:%s"; //调拨单不能选择批号或序列号商品 - int MATERIAL_TRANSFER_SELECT_ERROR_CODE = 80000018; - String MATERIAL_TRANSFER_SELECT_ERROR_MSG = "抱歉,调拨单不能选择批号或序列号商品:%s,建议走其它入库和出库单"; + public static final int MATERIAL_TRANSFER_SELECT_ERROR_CODE = 80000018; + public static final String MATERIAL_TRANSFER_SELECT_ERROR_MSG = "抱歉,调拨单不能选择批号或序列号商品:%s,建议走其它入库和出库单"; //盘点业务不能选择批号或序列号商品 - int MATERIAL_STOCK_CHECK_ERROR_CODE = 80000019; - String MATERIAL_STOCK_CHECK_ERROR_MSG = "抱歉,盘点业务不能选择批号或序列号商品:%s,建议走其它入库和出库单"; + public static final int MATERIAL_STOCK_CHECK_ERROR_CODE = 80000019; + public static final String MATERIAL_STOCK_CHECK_ERROR_MSG = "抱歉,盘点业务不能选择批号或序列号商品:%s,建议走其它入库和出库单"; //EXCEL中存在重复的商品 - int MATERIAL_EXCEL_IMPORT_EXIST_CODE = 80000020; - String MATERIAL_EXCEL_IMPORT_EXIST_MSG = "抱歉,EXCEL中存在重复的商品,具体信息为:%s"; + public static final int MATERIAL_EXCEL_IMPORT_EXIST_CODE = 80000020; + public static final String MATERIAL_EXCEL_IMPORT_EXIST_MSG = "抱歉,EXCEL中存在重复的商品,具体信息为:%s"; //EXCEL中存在重复的条码 - int MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_CODE = 80000021; - String MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_MSG = "抱歉,EXCEL中存在重复的条码,具体条码为:%s"; + public static final int MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_CODE = 80000021; + public static final String MATERIAL_EXCEL_IMPORT_BARCODE_EXIST_MSG = "抱歉,EXCEL中存在重复的条码,具体条码为:%s"; //名称长度超出 - int MATERIAL_NAME_OVER_CODE = 8000022; - String MATERIAL_NAME_OVER_MSG = "第%s行名称长度超出100个字符"; + public static final int MATERIAL_NAME_OVER_CODE = 8000022; + public static final String MATERIAL_NAME_OVER_MSG = "第%s行名称长度超出100个字符"; //规格长度超出 - int MATERIAL_STANDARD_OVER_CODE = 8000023; - String MATERIAL_STANDARD_OVER_MSG = "第%s行规格长度超出100个字符"; + public static final int MATERIAL_STANDARD_OVER_CODE = 8000023; + public static final String MATERIAL_STANDARD_OVER_MSG = "第%s行规格长度超出100个字符"; //型号长度超出 - int MATERIAL_MODEL_OVER_CODE = 8000024; - String MATERIAL_MODEL_OVER_MSG = "第%s行型号长度超出100个字符"; + public static final int MATERIAL_MODEL_OVER_CODE = 8000024; + public static final String MATERIAL_MODEL_OVER_MSG = "第%s行型号长度超出100个字符"; //多属性商品不能输入库存,建议进行盘点录入 - int MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE = 8000025; - String MATERIAL_SKU_BEGIN_STOCK_FAILED_MSG = "多属性商品%s不能输入库存,建议进行盘点录入"; + public static final int MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE = 8000025; + public static final String MATERIAL_SKU_BEGIN_STOCK_FAILED_MSG = "多属性商品%s不能输入库存,建议进行盘点录入"; //商品条码不存在,请重新选择 - int MATERIAL_BARCODE_IS_NOT_EXIST_CODE = 8000026; - String MATERIAL_BARCODE_IS_NOT_EXIST_MSG = "商品条码%s不存在,请重新选择"; + public static final int MATERIAL_BARCODE_IS_NOT_EXIST_CODE = 8000026; + public static final String MATERIAL_BARCODE_IS_NOT_EXIST_MSG = "商品条码%s不存在,请重新选择"; /** * 单据信息 * type = 85 * */ //添加单据信息失败 - int DEPOT_HEAD_ADD_FAILED_CODE = 8500000; - String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败"; + public static final int DEPOT_HEAD_ADD_FAILED_CODE = 8500000; + public static final String DEPOT_HEAD_ADD_FAILED_MSG = "添加单据信息失败"; //删除单据信息失败 - int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001; - String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败"; + public static final int DEPOT_HEAD_DELETE_FAILED_CODE = 8500001; + public static final String DEPOT_HEAD_DELETE_FAILED_MSG = "删除单据信息失败"; //修改单据信息失败 - int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002; - String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败"; + public static final int DEPOT_HEAD_EDIT_FAILED_CODE = 8500002; + public static final String DEPOT_HEAD_EDIT_FAILED_MSG = "修改单据信息失败"; //单据录入-仓库不能为空 - int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004; - String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空"; + public static final int DEPOT_HEAD_DEPOT_FAILED_CODE = 8500004; + public static final String DEPOT_HEAD_DEPOT_FAILED_MSG = "仓库不能为空"; //单据录入-调入仓库不能为空 - int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005; - String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空"; + public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空"; //单据录入-明细不能为空 - int DEPOT_HEAD_ROW_FAILED_CODE = 8500006; - String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006; + public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; //单据录入-账户不能为空 - int DEPOT_HEAD_ACCOUNT_FAILED_CODE = 8500007; - String DEPOT_HEAD_ACCOUNT_FAILED_MSG = "结算账户不能为空"; + public static final int DEPOT_HEAD_ACCOUNT_FAILED_CODE = 8500007; + public static final String DEPOT_HEAD_ACCOUNT_FAILED_MSG = "结算账户不能为空"; //单据录入-请修改多账户的结算金额 - int DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE = 8500008; - String DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG = "请修改多账户的结算金额"; + public static final int DEPOT_HEAD_MANY_ACCOUNT_FAILED_CODE = 8500008; + public static final String DEPOT_HEAD_MANY_ACCOUNT_FAILED_MSG = "请修改多账户的结算金额"; //单据录入-调入仓库与原仓库不能重复 - int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010; - String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复"; + public static final int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010; + public static final String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复"; //单据删除-只有未审核的单据才能删除 - int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011; - String DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; + public static final int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011; + public static final String DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; //单据审核-只有未审核的单据才能审核 - int DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE = 8500012; - String DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG = "抱歉,只有未审核的单据才能审核"; + public static final int DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE = 8500012; + public static final String DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG = "抱歉,只有未审核的单据才能审核"; //单据反审核-只有已审核的单据才能反审核 - int DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE = 8500013; - String DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG = "抱歉,只有已审核的单据才能反审核"; + public static final int DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE = 8500013; + public static final String DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG = "抱歉,只有已审核的单据才能反审核"; //单据录入-商品条码XXX的数量需要修改下 - int DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE = 85000014; - String DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG = "商品条码%s的数量需要修改下"; + public static final int DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE = 85000014; + public static final String DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG = "商品条码%s的数量需要修改下"; //单据录入-商品的批号不能为空 - int DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE = 8500015; - String DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的批号不能为空"; + public static final int DEPOT_HEAD_BATCH_NUMBERE_EMPTY_CODE = 8500015; + public static final String DEPOT_HEAD_BATCH_NUMBERE_EMPTY_MSG = "抱歉,商品条码:%s的批号不能为空"; //单据录入-会员预付款余额不足 - int DEPOT_HEAD_MEMBER_PAY_LACK_CODE = 8500016; - String DEPOT_HEAD_MEMBER_PAY_LACK_MSG = "抱歉,会员预付款余额不足"; + public static final int DEPOT_HEAD_MEMBER_PAY_LACK_CODE = 8500016; + public static final String DEPOT_HEAD_MEMBER_PAY_LACK_MSG = "抱歉,会员预付款余额不足"; //单据录入-累计订金超出原订单中的订金 - int DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE = 8500017; - String DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG = "抱歉,累计订金超出原订单中的订金"; + public static final int DEPOT_HEAD_DEPOSIT_OVER_PRE_CODE = 8500017; + public static final String DEPOT_HEAD_DEPOSIT_OVER_PRE_MSG = "抱歉,累计订金超出原订单中的订金"; //单据录入-商品条码XXX的单价低于最低售价 - int DEPOT_HEAD_UNIT_PRICE_LOW_CODE = 8500018; - String DEPOT_HEAD_UNIT_PRICE_LOW_MSG = "商品条码%s的单价低于最低售价"; + public static final int DEPOT_HEAD_UNIT_PRICE_LOW_CODE = 8500018; + public static final String DEPOT_HEAD_UNIT_PRICE_LOW_MSG = "商品条码%s的单价低于最低售价"; //单据录入-单据明细中必须要有组合件和普通子件 - int DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_CODE = 8500020; - String DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_MSG = "抱歉,单据明细中必须要有组合件和普通子件"; + public static final int DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_CODE = 8500020; + public static final String DEPOT_HEAD_CHECK_ASSEMBLE_EMPTY_MSG = "抱歉,单据明细中必须要有组合件和普通子件"; //单据录入-商品条码XXX的数量与序列号不一致 - int DEPOT_HEAD_SN_NUMBERE_FAILED_CODE = 8500021; - String DEPOT_HEAD_SN_NUMBERE_FAILED_MSG = "抱歉,商品条码:%s的数量与序列号不一致"; + public static final int DEPOT_HEAD_SN_NUMBERE_FAILED_CODE = 8500021; + public static final String DEPOT_HEAD_SN_NUMBERE_FAILED_MSG = "抱歉,商品条码:%s的数量与序列号不一致"; //单据录入-单据编号已经存在 - int DEPOT_HEAD_BILL_NUMBER_EXIST_CODE = 8500022; - String DEPOT_HEAD_BILL_NUMBER_EXIST_MSG = "抱歉,单据编号已经存在"; + public static final int DEPOT_HEAD_BILL_NUMBER_EXIST_CODE = 8500022; + public static final String DEPOT_HEAD_BILL_NUMBER_EXIST_MSG = "抱歉,单据编号已经存在"; //单据录入-单据当前状态下不能修改 - int DEPOT_HEAD_BILL_CANNOT_EDIT_CODE = 8500023; - String DEPOT_HEAD_BILL_CANNOT_EDIT_MSG = "抱歉,单据当前状态下不能修改"; + public static final int DEPOT_HEAD_BILL_CANNOT_EDIT_CODE = 8500023; + public static final String DEPOT_HEAD_BILL_CANNOT_EDIT_MSG = "抱歉,单据当前状态下不能修改"; //单据删除-单据中的序列号已经出库,不能删除 - int DEPOT_HEAD_SERIAL_IS_SELL_CODE = 8500024; - String DEPOT_HEAD_SERIAL_IS_SELL_MSG = "抱歉,单据%s的序列号已经出库,不能删除"; + public static final int DEPOT_HEAD_SERIAL_IS_SELL_CODE = 8500024; + public static final String DEPOT_HEAD_SERIAL_IS_SELL_MSG = "抱歉,单据%s的序列号已经出库,不能删除"; //单据录入-单据附件不能超过规定数量 - int DEPOT_HEAD_FILE_NUM_LIMIT_CODE = 8500025; - String DEPOT_HEAD_FILE_NUM_LIMIT_MSG = "抱歉,单据附件不能超过%s份"; + public static final int DEPOT_HEAD_FILE_NUM_LIMIT_CODE = 8500025; + public static final String DEPOT_HEAD_FILE_NUM_LIMIT_MSG = "抱歉,单据附件不能超过%s份"; /** * 单据明细信息 * type = 90 * */ //添加单据明细信息失败 - int DEPOT_ITEM_ADD_FAILED_CODE = 9000000; - String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败"; + public static final int DEPOT_ITEM_ADD_FAILED_CODE = 9000000; + public static final String DEPOT_ITEM_ADD_FAILED_MSG = "添加单据明细信息失败"; //删除单据明细信息失败 - int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001; - String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败"; + public static final int DEPOT_ITEM_DELETE_FAILED_CODE = 9000001; + public static final String DEPOT_ITEM_DELETE_FAILED_MSG = "删除单据明细信息失败"; //修改单据明细信息失败 - int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002; - String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败"; + public static final int DEPOT_ITEM_EDIT_FAILED_CODE = 9000002; + public static final String DEPOT_ITEM_EDIT_FAILED_MSG = "修改单据明细信息失败"; //单据明细-明细中商品不存在 - int DEPOT_ITEM_BARCODE_IS_NOT_EXIST_CODE = 9000003; - String DEPOT_ITEM_BARCODE_IS_NOT_EXIST_MSG = "抱歉,商品条码:%s在商品管理中不存在"; + public static final int DEPOT_ITEM_BARCODE_IS_NOT_EXIST_CODE = 9000003; + public static final String DEPOT_ITEM_BARCODE_IS_NOT_EXIST_MSG = "抱歉,商品条码:%s在商品管理中不存在"; /** * 财务信息 * type = 95 * */ //添加财务信息失败 - int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000; - String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败"; + public static final int ACCOUNT_HEAD_ADD_FAILED_CODE = 9500000; + public static final String ACCOUNT_HEAD_ADD_FAILED_MSG = "添加财务信息失败"; //删除财务信息失败 - int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001; - String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败"; + public static final int ACCOUNT_HEAD_DELETE_FAILED_CODE = 9500001; + public static final String ACCOUNT_HEAD_DELETE_FAILED_MSG = "删除财务信息失败"; //修改财务信息失败 - int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002; - String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败"; + public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002; + public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败"; //单据录入-明细不能为空 - int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003; - String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; + public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003; + public static final String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空"; //单据删除-只有未审核的单据才能删除 - int ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 9500004; - String ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; + public static final int ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 9500004; + public static final String ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除"; //财务信息录入-单据编号已经存在 - int ACCOUNT_HEAD_BILL_NO_EXIST_CODE = 9500005; - String ACCOUNT_HEAD_BILL_NO_EXIST_MSG = "抱歉,单据编号已经存在"; + public static final int ACCOUNT_HEAD_BILL_NO_EXIST_CODE = 9500005; + public static final String ACCOUNT_HEAD_BILL_NO_EXIST_MSG = "抱歉,单据编号已经存在"; /** * 财务明细信息 * type = 100 * */ //添加财务明细信息失败 - int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000; - String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败"; + public static final int ACCOUNT_ITEM_ADD_FAILED_CODE = 10000000; + public static final String ACCOUNT_ITEM_ADD_FAILED_MSG = "添加财务明细信息失败"; //删除财务明细信息失败 - int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001; - String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败"; + public static final int ACCOUNT_ITEM_DELETE_FAILED_CODE = 10000001; + public static final String ACCOUNT_ITEM_DELETE_FAILED_MSG = "删除财务明细信息失败"; //修改财务明细信息失败 - int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002; - String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败"; + public static final int ACCOUNT_ITEM_EDIT_FAILED_CODE = 10000002; + public static final String ACCOUNT_ITEM_EDIT_FAILED_MSG = "修改财务明细信息失败"; /** * 序列号 * type = 105 * */ /**序列号已存在*/ - int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000; - String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号:%s已存在"; + public static final int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000; + public static final String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号:%s已存在"; /**序列号不能为为空*/ - int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500001; - String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空"; + public static final int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500001; + public static final String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空"; /**商品%s下序列号不充足,请补充后重试*/ - int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002; - String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足,请补充后重试"; + public static final int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002; + public static final String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足,请补充后重试"; /**删序列号信息失败*/ - int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003; - String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败"; + public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003; + public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败"; /** * 机构信息 * type = 110 * */ //添加机构信息失败 - int ORGANIZATION_ADD_FAILED_CODE = 11000000; - String ORGANIZATION_ADD_FAILED_MSG = "添加机构信息失败"; + public static final int ORGANIZATION_ADD_FAILED_CODE = 11000000; + public static final String ORGANIZATION_ADD_FAILED_MSG = "添加机构信息失败"; //删除机构信息失败 - int ORGANIZATION_DELETE_FAILED_CODE = 11000001; - String ORGANIZATION_DELETE_FAILED_MSG = "删除机构信息失败"; + public static final int ORGANIZATION_DELETE_FAILED_CODE = 11000001; + public static final String ORGANIZATION_DELETE_FAILED_MSG = "删除机构信息失败"; //修改机构信息失败 - int ORGANIZATION_EDIT_FAILED_CODE = 11000002; - String ORGANIZATION_EDIT_FAILED_MSG = "修改机构信息失败"; + public static final int ORGANIZATION_EDIT_FAILED_CODE = 11000002; + public static final String ORGANIZATION_EDIT_FAILED_MSG = "修改机构信息失败"; //机构编号已存在 - int ORGANIZATION_NO_ALREADY_EXISTS_CODE = 11000003; - String ORGANIZATION_NO_ALREADY_EXISTS_MSG = "机构编号已存在"; + public static final int ORGANIZATION_NO_ALREADY_EXISTS_CODE = 11000003; + public static final String ORGANIZATION_NO_ALREADY_EXISTS_MSG = "机构编号已存在"; //根机构不允许删除 - int ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE = 11000004; - String ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG = "根机构不允许删除"; + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE = 11000004; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG = "根机构不允许删除"; //根机构不允许修改 - int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005; - String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改"; + public static final int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005; + public static final String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改"; //该机构存在下级不允许删除 - int ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE = 11000006; - String ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG = "该机构存在下级不允许删除"; + public static final int ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE = 11000006; + public static final String ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG = "该机构存在下级不允许删除"; /** * 机构用户关联关系 * type = 115 * */ //添加机构用户关联关系失败 - int ORGA_USER_REL_ADD_FAILED_CODE = 11500000; - String ORGA_USER_REL_ADD_FAILED_MSG = "添加机构用户关联关系失败"; + public static final int ORGA_USER_REL_ADD_FAILED_CODE = 11500000; + public static final String ORGA_USER_REL_ADD_FAILED_MSG = "添加机构用户关联关系失败"; //删除机构用户关联关系失败 - int ORGA_USER_REL_DELETE_FAILED_CODE = 11500001; - String ORGA_USER_REL_DELETE_FAILED_MSG = "删除机构用户关联关系失败"; + public static final int ORGA_USER_REL_DELETE_FAILED_CODE = 11500001; + public static final String ORGA_USER_REL_DELETE_FAILED_MSG = "删除机构用户关联关系失败"; //修改机构用户关联关系失败 - int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002; - String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败"; + public static final int ORGA_USER_REL_EDIT_FAILED_CODE = 11500002; + public static final String ORGA_USER_REL_EDIT_FAILED_MSG = "修改机构用户关联关系失败"; //进销存统计,如果有权限的仓库数量太多则提示要选择仓库 - int REPORT_TWO_MANY_DEPOT_FAILED_CODE = 510; - String REPORT_TWO_MANY_DEPOT_FAILED_MSG = "请选择仓库,再进行查询"; + public static final int REPORT_TWO_MANY_DEPOT_FAILED_CODE = 510; + public static final String REPORT_TWO_MANY_DEPOT_FAILED_MSG = "请选择仓库,再进行查询"; //演示用户禁止操作 - int SYSTEM_CONFIG_TEST_USER_CODE = -1; - String SYSTEM_CONFIG_TEST_USER_MSG = "演示用户禁止操作"; + public static final int SYSTEM_CONFIG_TEST_USER_CODE = -1; + public static final String SYSTEM_CONFIG_TEST_USER_MSG = "演示用户禁止操作"; /** diff --git a/utils/src/main/java/com/wansensoft/utils/constants/SecurityConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/SecurityConstants.java deleted file mode 100644 index 23956247..00000000 --- a/utils/src/main/java/com/wansensoft/utils/constants/SecurityConstants.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.constants; - -public interface SecurityConstants { - - /** - * 验证码缓存前缀 - */ - String REGISTER_VERIFY_CODE_CACHE_PREFIX = "AUTH:VERIFY_CODE:REGISTER:"; - - String LOGIN_VERIFY_CODE_CACHE_PREFIX = "AUTH:VERIFY_CODE:LOGIN:"; - - String UPDATE_PASSWORD_VERIFY_CODE_CACHE_PREFIX = "AUTH:VERIFY_CODE:UPDATE_PASSWORD:"; - - - String EMAIL_VERIFY_CODE_CACHE_PREFIX = "AUTH:VERIFY_CODE:EMAIL:"; - - /** - * 用户权限集合缓存前缀 - */ - String USER_PERMS_CACHE_PREFIX = "AUTH:USER_PERMS:"; - - /** - * 黑名单Token缓存前缀 - */ - String BLACK_TOKEN_CACHE_PREFIX = "AUTH:BLACK_TOKEN:"; -} diff --git a/utils/src/main/java/com/wansensoft/utils/constants/SmsConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/SmsConstants.java deleted file mode 100644 index 56d8f0c5..00000000 --- a/utils/src/main/java/com/wansensoft/utils/constants/SmsConstants.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.constants; - -public interface SmsConstants { - - String SMS_SIGN_NAME = "万森云服务"; - - int SMS_TEMPLATE_REGISTER_USER = 0; - - int SMS_TEMPLATE_PHONE_LOGIN = 1; - - int SMS_TEMPLATE_UPDATE_PASSWORD = 2; - - String SMS_TEMPLATE_ID_REGISTER_USER = "1933307"; - - String SMS_TEMPLATE_ID_PHONE_LOGIN = "1934058"; - - String SMS_TEMPLATE_ID_UPDATE_PASSWORD = "1933311"; -} diff --git a/utils/src/main/java/com/wansensoft/utils/constants/UserConstants.java b/utils/src/main/java/com/wansensoft/utils/constants/UserConstants.java deleted file mode 100644 index 8324835e..00000000 --- a/utils/src/main/java/com/wansensoft/utils/constants/UserConstants.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.constants; - -/** - *

- * 用户状态常量类 - * User Status Constants - *

- */ -public interface UserConstants { - - /** 用户状态启用 */ - int USER_STATUS_ENABLE = 0; - - /** 用户状态停用 */ - int USER_STATUS_DISABLE = 1; - - /** 用户状态封禁 */ - int USER_STATUS_BAN = 2; - - /** 默认密码 */ - String DEFAULT_PASSWORD = "123456"; -} diff --git a/utils/src/main/java/com/wansensoft/utils/enums/BaseCodeEnum.java b/utils/src/main/java/com/wansensoft/utils/enums/BaseCodeEnum.java deleted file mode 100644 index ecb24b81..00000000 --- a/utils/src/main/java/com/wansensoft/utils/enums/BaseCodeEnum.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.enums; - -import lombok.Getter; - -/** - *

- * 通用响应状态枚举 - *

- */ -@Getter -public enum BaseCodeEnum { - - // 一级基本宏观状态码 - SUCCESS("00000", "系统执行成功"), - - ERROR("B0001", "系统执行出错"), - - QUERY_DATA_EMPTY("A0404", "查询数据不存在"), - - PARAMETER_NULL("A0410","请求必填参数为空"), - - VERIFY_CODE_ERROR("A0240", "验证码错误"), - - VERIFY_CODE_EXPIRE("A0242", "验证码已过期"), - - SMS_VERIFY_CODE_EXPIRE("A0243", "短信校验码已过期"), - - SMS_VERIFY_SEND_SUCCESS("A0002", "短信验证码发送成功"), - - SMS_VERIFY_CODE_ERROR("A0131", "短信校验码错误"), - - PHONE_NUMBER_FORMAT_ERROR("A0131", "手机格式校验失败"); - - /** - * 响应状态码 - */ - private final String code; - - /** - * 响应提示 - */ - private final String msg; - - BaseCodeEnum(String code, String msg) { - this.code = code; - this.msg = msg; - } - -} diff --git a/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java b/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java new file mode 100644 index 00000000..c15e62c9 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java @@ -0,0 +1,46 @@ +package com.wansensoft.utils.enums; + +public enum CodeEnum { + + // 一级基本宏观状态码 + SUCCESS("A0000", "系统执行成功"), + ERROR("B0001", "系统执行出错"), + // 用户类代码 + REGISTER_SUCCESS("A0001", "用户注册成功"), + USER_EXISTS("A0011", "用户名已存在"), + USER_LOGOUT("A0012", "账户注销成功"), + QUERY_DATA_EMPTY("A0404", "查询数据不存在"), + PARAMETER_NULL("C0001","请求必填参数为空"), + NOT_PERMISSION("D0000", "没有权限"); + + /** + * 响应状态码 + */ + private String code; + + /** + * 响应提示 + */ + private String msg; + + CodeEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public void setCode(String code) { + this.code = code; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/enums/RoleCodeEnum.java b/utils/src/main/java/com/wansensoft/utils/enums/RoleCodeEnum.java deleted file mode 100644 index 2e735b19..00000000 --- a/utils/src/main/java/com/wansensoft/utils/enums/RoleCodeEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.wansensoft.utils.enums; - -import lombok.Getter; - -@Getter -public enum RoleCodeEnum { - - ADD_ROLE_SUCCESS("A0004", "添加角色成功"), - - ADD_ROLE_ERROR("A0207", "添加角色失败"), - - UPDATE_ROLE_STATUS_SUCCESS("A0005", "角色状态修改成功"), - - UPDATE_ROLE_STATUS_ERROR("A0208", "角色状态修改失败"), - - UPDATE_ROLE_SUCCESS("A0006", "修改角色资料成功"), - - UPDATE_ROLE_ERROR("A0209", "修改角色资料失败"), - - DELETE_ROLE_SUCCESS("A0007", "删除角色成功"), - - DELETE_ROLE_ERROR("A0210", "删除角色失败"); - - /** - * 响应状态码 - */ - private final String code; - - /** - * 响应提示 - */ - private final String msg; - - RoleCodeEnum(String code, String msg) { - this.code = code; - this.msg = msg; - } -} diff --git a/utils/src/main/java/com/wansensoft/utils/enums/UserCodeEnum.java b/utils/src/main/java/com/wansensoft/utils/enums/UserCodeEnum.java deleted file mode 100644 index 38391cdd..00000000 --- a/utils/src/main/java/com/wansensoft/utils/enums/UserCodeEnum.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.enums; - -import lombok.Getter; - -/** - * 用户类枚举代码 - */ -@Getter -public enum UserCodeEnum { - - // login business - USER_REGISTER_SUCCESS("A0001", "用户注册成功"), - - USER_NAME_EXISTS("A0111", "用户名已存在"), - - USER_LOGOUT("A0012", "账户注销成功"), - - USER_NOT_EXISTS("A0201", "用户账户不存在"), - - USER_REGISTER_PHONE_EXISTS("A0112", "当前手机号已注册,请直接登陆"), - - PHONE_EXISTS("A0113", "当前手机号已存在"), - - USERNAME_OR_PASSWORD_ERROR("A0210", "登录失败,用户名或密码错误"), - - UPDATE_PASSWORD_ERROR("A0211", "系统错误,密码修改失败"), - - USER_RESET_PASSWORD_ERROR("A0212", "系统错误,用户重置密码失败"), - - UPDATE_PASSWORD_SUCCESS("A0013", "密码修改成功"), - - USER_RESET_PASSWORD_SUCCESS("A0015", "用户重置密码成功"), - - USER_ACCOUNT_FREEZE("A0202", "用户账户被冻结"), - - USER_ACCOUNT_INVALID("A0203", "用户账户已作废"), - - // user list table business - USER_ADD_SUCCESS("A0002", "用户添加成功"), - - USER_INFO_UPDATE_SUCCESS("A0014", "用户资料修改成功"), - - USER_INFO_UPDATE_ERROR("A0205", "用户资料修改失败"), - - USER_ADD_ERROR("A0204", "用户添加失败"), - - USER_DELETE_SUCCESS("A0003", "用户删除成功"), - - USER_DELETE_ERROR("A0206", "用户删除失败"), - - // user role - USER_NOT_PERMISSION("D0000", "用户没有权限"); - - /** - * 响应状态码 - */ - private final String code; - - /** - * 响应提示 - */ - private final String msg; - - UserCodeEnum(String code, String msg) { - this.code = code; - this.msg = msg; - } -} diff --git a/utils/src/main/java/com/wansensoft/utils/enums/test.kt b/utils/src/main/java/com/wansensoft/utils/enums/test.kt deleted file mode 100644 index 46787671..00000000 --- a/utils/src/main/java/com/wansensoft/utils/enums/test.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.enums; - -import lombok.Data - -@Data -enum class test(val code: String, val msg: String) { - - UPDATE_ROLE_STATUS_SUCCESS("A0005", "角色状态修改成功"), - - UPDATE_ROLE_STATUS_ERROR("A0208", "角色状态修改失败"); -} \ No newline at end of file diff --git a/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java b/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java index e378337a..5c96dd04 100644 --- a/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java +++ b/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils.redis; import com.alibaba.fastjson.JSON; diff --git a/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java b/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java index 7e877d77..9919802f 100644 --- a/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java +++ b/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils.redis; import com.fasterxml.jackson.annotation.JsonAutoDetect; diff --git a/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java b/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java index fda32acf..b582b77d 100644 --- a/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java @@ -1,15 +1,3 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ package com.wansensoft.utils.redis; import jakarta.annotation.Resource; diff --git a/utils/src/main/java/com/wansensoft/utils/response/Response.java b/utils/src/main/java/com/wansensoft/utils/response/Response.java deleted file mode 100644 index edc8143a..00000000 --- a/utils/src/main/java/com/wansensoft/utils/response/Response.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.response; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.wansensoft.utils.enums.BaseCodeEnum; -import com.wansensoft.utils.enums.RoleCodeEnum; -import com.wansensoft.utils.enums.UserCodeEnum; -import lombok.Data; - -import java.io.Serial; -import java.io.Serializable; - -@Data -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Response implements Serializable { - - @Serial - private static final long serialVersionUID = 793034041048451317L; - - private String msg; - - private String code; - - private T data; - - public static Response success() { - return responseMsg(BaseCodeEnum.SUCCESS); - } - - public static Response fail() { - return responseMsg(BaseCodeEnum.ERROR); - } - - public static Response responseMsg(BaseCodeEnum baseCodeEnum) { - Response baseResponse = new Response(); - baseResponse.setCode(baseCodeEnum.getCode()); - baseResponse.setMsg(baseCodeEnum.getMsg()); - return baseResponse; - } - - public static Response responseMsg(UserCodeEnum userCodeEnum) { - Response baseResponse = new Response(); - baseResponse.setCode(userCodeEnum.getCode()); - baseResponse.setMsg(userCodeEnum.getMsg()); - return baseResponse; - } - - public static Response responseMsg(RoleCodeEnum roleCodeEnum) { - Response baseResponse = new Response(); - baseResponse.setCode(roleCodeEnum.getCode()); - baseResponse.setMsg(roleCodeEnum.getMsg()); - return baseResponse; - } - - public static Response responseMsg(String code, String msg) { - Response baseResponse = new Response(); - baseResponse.setCode(code); - baseResponse.setMsg(msg); - return baseResponse; - } - - public static Response responseData(T data) { - Response baseResponse = new Response(); - baseResponse.setCode(BaseCodeEnum.SUCCESS.getCode()); - baseResponse.setData(data); - return baseResponse; - } - - public static Response responseData(String code, T data) { - Response baseResponse = new Response(); - baseResponse.setCode(code); - baseResponse.setData(data); - return baseResponse; - } -} diff --git a/utils/src/main/java/com/wansensoft/utils/verifcode/KaptChaConfig.java b/utils/src/main/java/com/wansensoft/utils/verifcode/KaptChaConfig.java deleted file mode 100644 index 3dbc193d..00000000 --- a/utils/src/main/java/com/wansensoft/utils/verifcode/KaptChaConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance - * with the License. A copy of the License is located at - * - * http://opensource.wansenai.com/apache2.0/ - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES - * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ -package com.wansensoft.utils.verifcode; - -import com.google.code.kaptcha.impl.DefaultKaptcha; -import com.google.code.kaptcha.util.Config; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.Properties; -@Configuration -public class KaptChaConfig { - - private static final String KAPTCHA_BORDER = "kaptcha.border"; - private static final String KAPTCHA_TEXTPRODUCER_FONT_COLOR = "kaptcha.textproducer.font.color"; - private static final String KAPTCHA_TEXTPRODUCER_CHAR_SPACE = "kaptcha.textproducer.char.space"; - private static final String KAPTCHA_IMAGE_WIDTH = "kaptcha.image.width"; - private static final String KAPTCHA_IMAGE_HEIGHT = "kaptcha.image.height"; - private static final String KAPTCHA_TEXTPRODUCER_CHAR_LENGTH = "kaptcha.textproducer.char.length"; - private static final Object KAPTCHA_IMAGE_FONT_SIZE = "kaptcha.textproducer.font.size"; - - @Bean - public static DefaultKaptcha producer() { - Properties properties = new Properties(); - properties.setProperty(KAPTCHA_BORDER, "no"); - properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "5"); - properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black"); - properties.setProperty(KAPTCHA_IMAGE_WIDTH, "150"); - properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "50"); - Config config = new Config(properties); - DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); - defaultKaptcha.setConfig(config); - return defaultKaptcha; - } -}